Hello,
I would like to compare the value of a voxel in a DICOM volume before and after reformatting (reslicing) the volume.
I am stuck on this and hope someone may know how to do this.
Here is what I do:
- Read a DICOM image series using vtkDICOMImageReader (I understand the quirks of this reader, and I think I handle them appropriately thanks to the advice of @dgobbi)
- Perform some arithmetic on the volume.
- Pipe the volume through vtkImageReslice, but set the reslice axes to be the identity matrix.
…
slicer = vtk.vtkImageReslice()
[ … do some flipping and casting…]
slicer.SetInputConnection(caster.GetOutputPort())
ident_mat, inverse_ident = vtk.vtkMatrix4x4(), vtk.vtkMatrix4x4()
ident_mat.Identity()
vtk.vtkMatrix4x4.Invert(ident_matrix, inverse_ident)
slicer.SetResliceAxes(inverse_ident)
… - Display the volume, slice by slice, “in the volume plane”. That is, without reformatting. That is, without reslicing axially.
At this point, I can examine the values of the displayed pixels. Let’s say I select a pixel to examine: [x=25, y=25, z=0]. I note this pixel’s corresponding scalar value.
Next, I will apply the DICOM’s affine transformation matrix to this volume and display the reformatted (resliced) volume. (Note that the DICOM was acquired in a double-oblique orientation. So reformatting/reslicing will result in a very different-looking volume.) I want to find that pixel that I examined before.
How can I find it? Can I somehow use the DICOM’s affine transformation matrix?
Thank you in advance,
Michelle