[vtkusers] Resizing dicom files to same volume

David Gobbi david.gobbi at gmail.com
Mon Oct 13 18:19:43 EDT 2014

Hi Jamie,

Have you verified that the image data produced by the reader has the
correct spacing, i.e. the same spacing as specified in the DICOM
metadata for your files?  You should definitely verify that the reader
is producing accurate data before investigating the rest of the
pipeline.  As long as the spacing is correct, VTK should at least be
able to display the images with the correct relative scale.

The vtkImageResize and vtkImageResample filters do not change the
physical size of the images, they just change the spacing between the
data samples.  If the image was 150mm across before resampling, it
will still be 150mm across after resampling.  The way to change the
physical size of an image (and to perform alignment) is to provide a
ResliceTransform for vtkImageReslice.  Note that when I say "physical
size" I mean size in mm, not size in voxels.

 - David

On Mon, Oct 13, 2014 at 10:51 AM, Wright James (NHS Greater Glasgow &
Clyde) <jamie.wright at nhs.net> wrote:
> VTK'ers
> I have multiple DICOM datasets with different spacing and dimensions. I am using vtkImagePlaneWidget() to view them
>  I want to resample the datasets so they occupy the same volume in space, to then use e.g. vtkImageBlend to merge the images by opacity. I have tried vtkImageResample and vtkImageReslice (in the documentation for this class it even mentions the method SetInformationInput() as the way to go for matching voxel sampling. However whatever I try still results in the final output having image slices of different scales on the screen. Could anyone guide me as to what pipeline to use with  to get the datasets aligned?

More information about the vtkusers mailing list