[vtkusers] Resizing dicom files to same volume

Wright James (NHS Greater Glasgow & Clyde) jamie.wright at nhs.net
Tue Oct 14 10:58:03 EDT 2014

Hi David,

Thanks for your insight. Yes without applying a reslice transform all I was managing to do with vtkImageReslice was pad the bounding box with zeros or chop off part of the data when I was attempting to align the datasets.

So I have to apply SetResliceTransform() to vtkImageReslice passing in a vtkAbstractTransform to go from one coordinate space to the other. I will only require a linear transform as there shouldn't be any deformation between them. I have the origin of both datasets (0,0,0), the spacing of the voxels in each dataset and the dimensions of the images. Could you tell me what kind of transform I should be applying to shrink one dataset (or expand the other) so they match? Or a reference to documentation would be helpful


Jamie Wright
From: David Gobbi [david.gobbi at gmail.com]
Sent: 13 October 2014 23:19
To: Wright James (NHS Greater Glasgow & Clyde)
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Resizing dicom files to same volume

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?


This message may contain confidential information. If you are not the intended recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents:
to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSi recipients
NHSmail provides an email address for your career in the NHS and can be accessed anywhere


More information about the vtkusers mailing list