通过vtkResliceImageViewer事项MRP功能,得到的XY切面和YZ切面的图像都是反向的,而且XZ切面的图像还是反向加翻转的,这个问题怎么处理?
dicomImageReader = vtkDICOMImageReader.New();
dicomImageReader.SetDirectoryName(DicPath);
dicomImageReader.Update();
resliceImageViewers = new vtkResliceImageViewer[SliceNum];
for (int i = 0; i < SliceNum; i++)
{
resliceImageViewers[i] = vtkResliceImageViewer.New();
resliceImageViewers[i].SetInputData(dicomImageReader.GetOutput());
vtkResliceCursorLineRepresentation rep = vtkResliceCursorLineRepresentation.SafeDownCast(resliceImageViewers[i].GetResliceCursorWidget().GetRepresentation());
for (int k = 0; k < 3; k++)
{
rep.GetResliceCursorActor().GetCenterlineProperty(k).SetRepresentationToWireframe();
rep.GetResliceCursorActor().GetCenterlineProperty(k).RenderLinesAsTubesOn();
rep.GetResliceCursorActor().GetCenterlineProperty(k).SetLineWidth(2);
switch (k)
{
case 0:
;
rep.GetResliceCursorActor().GetCenterlineProperty(k).SetColor(0, 0, 255);
break;
case 1:
rep.GetResliceCursorActor().GetCenterlineProperty(k).SetColor(0, 255, 0);
break;
case 2:
rep.GetResliceCursorActor().GetCenterlineProperty(k).SetColor(255, 0, 0);
break;
}
}
switch (i)
{
case 0:
{
resliceImageViewers[i].SetRenderWindow(renderWindowControlAxial.RenderWindow);
resliceImageViewers[i].SetupInteractor(renderWindowControlAxial.RenderWindow.GetInteractor());
rep.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormalToZAxis();
resliceImageViewers[i].SetSliceOrientationToXY();
break;
}
case 1:
{
resliceImageViewers[i].SetRenderWindow(renderWindowControlSagittal.RenderWindow);
resliceImageViewers[i].SetupInteractor(renderWindowControlSagittal.RenderWindow.GetInteractor());
rep.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormalToXAxis();
resliceImageViewers[i].SetSliceOrientationToYZ();
break;
}
case 2:
{
resliceImageViewers[i].SetRenderWindow(renderWindowControlCoronal.RenderWindow);
resliceImageViewers[i].SetupInteractor(renderWindowControlCoronal.RenderWindow.GetInteractor());
rep.GetResliceCursorActor().GetCursorAlgorithm().SetReslicePlaneNormalToYAxis();
resliceImageViewers[i].SetSliceOrientationToXZ();
break;
}
}
resliceImageViewers[i].SetResliceModeToAxisAligned();
resliceImageViewers[i].SetLookupTable(resliceImageViewers[0].GetLookupTable());
resliceImageViewers[i].SetColorWindow(DefaultWindowLevel[0]);
resliceImageViewers[i].SetColorLevel(DefaultWindowLevel[1]);
resliceImageViewers[i].SetThickMode(0);
resliceImageViewers[i].SetResliceMode(1);
rep.SetManipulationMode(2);
resliceImageViewers[i].SetResliceCursor(resliceImageViewers[0].GetResliceCursor());
//resliceImageViewers[i].GetResliceCursorWidget().SetEnabled(1);
resliceImageViewers[i].GetResliceCursorWidget().SetManageWindowLevel(0);
resliceImageViewers[i].SetSlice(resliceImageViewers[i].GetSliceMax() / 2);
resliceImageViewers[i].GetRenderer().ResetCameraScreenSpace();
resliceImageViewers[i].Render();
resliceImageViewers[i].Reset();
}