[ITK-users] Minimal example for writing Dicom sets an incorrect spacing between slices
Jim Miller
millerjv at gmail.com
Wed Mar 26 17:08:55 EDT 2014
If you are writing a 2D image (Image<*,2> or a 3D image with one slice), then GDCMImageiO is at a loss at to how write reasonable spacing information.
If you are writing a volume using an ImageSeriesWriter, then you should have proper spacing information.
But as Bill pointed out, the only reliable means to know the spacing between slices is to base it off of the ImagePositionPatient for adjacent slices.
Jim
> On Mar 26, 2014, at 1:57 PM, Joël Schaerer <joel.schaerer at gmail.com> wrote:
>
> Hi all,
>
> I think I may have found a problem in the Dicom writing example ImageReadDicomSeriesWrite.cxx included with the sources (version 4.3.1). The spacing between slices in the output dicom files is systematically set to 1, no matter the spacing of the input image.
>
> Here is a sample image:
>
> http://sd-33294.dedibox.fr/~joel/input.mha
>
> This is the output from gdcminfo on one of the output files:
>
> MediaStorage is 1.2.840.10008.5.1.4.1.1.4 [MR Image Storage]
> TransferSyntax is 1.2.840.10008.1.2 [Implicit VR Little Endian: Default Transfer Syntax for DICOM]
> NumberOfDimensions: 2
> Dimensions: (256,256,1)
> SamplesPerPixel :1
> BitsAllocated :16
> BitsStored :16
> HighBit :15
> PixelRepresentation:1
> ScalarType found :INT16
> PhotometricInterpretation: MONOCHROME2
> PlanarConfiguration: 0
> TransferSyntax: 1.2.840.10008.1.2
> Origin: (0,0,0)
> Spacing: (0.9375,0.9375,1)
> DirectionCosines: (1,0,0,0,1,0)
> Rescale Intercept/Slope: (0,1)
> Orientation Label: AXIAL
>
> Here is the relevant gdcmdump output:
>
> (0018,0088) ?? (DS) [1 ] # 2,1 Spacing Between Slices
>
> I've tried forcing a number of dicom tags in the GDCMImageIO metadata dict, with no success.
>
> Is there a workaround around this? Is it a bug in ITK?
>
> Thanks for your help!
>
> joel
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list