Thanks. I tested the image with the TestDICOMDisplay example, and the rectification worked properly. Here’s a screenshot, the sagittal view is in the lower right corner:
I’m not able to run the code that you sent, because it isn’t a complete program. But the part of the code where it does the rectification looks fine. Here is the similar code from TestDICOMDisplay.cxx, for comparison:
vtkSmartPointer<vtkDICOMCTRectifier> rect;
if (meta->Get(DC::Modality).Matches("CT"))
{
rect = vtkSmartPointer<vtkDICOMCTRectifier>::New();
rect->SetVolumeMatrix(reader->GetPatientMatrix());
rect->SetInputConnection(portToDisplay);
rect->Update();
portToDisplay = rect->GetOutputPort();
}
So I’m not sure what the problem is. Is it possible that your display pipeline is actually displaying the wrong image? Or maybe the display pipeline is using the PatientMatrix in a way that causes the rectification to be reversed? I notice that you never call rectify.GetRectifiedMatrix()
. If you want to use the matrix to set the orientation of the image after rectification, it’s necessary to use the RectifiedMatrix (since the original PatientMatrix no longer applies, once the rectification has been done).