[Insight-users] gdcmwriter makes pixel spacing 1.00\1.00 instead of original pixel spacing

Mathieu Malaterre mathieu.malaterre at gmail.com
Mon Jun 30 17:59:51 EDT 2008


Hi Sachin,

On Mon, Jun 30, 2008 at 10:21 PM, Sachin Jambawalikar
<sachinjam at gmail.com> wrote:
> Hi  Mathieu,
>
> I'm using  gdcm through itk  to write dicom images.
> I have original dicom data with pixel spacing tag 0028,0030 = 0.45\0.45

You forgot the most important information: what is the IOD ? Is it a
MR Image Storage, CT Image Storage ... ?

> However after writing new dicom images through gdcm  the pixel spacing
> tags 0028,0030 changed to 1.00\1.00
>
> I checked the original dicom image MetaDataDiconary and it shows the
> right pixel spacing     0.45\0.45
>
> std::string pixelspacing;
>  itk::ExposeMetaData<std::string>(*dict, "0028|0030", pixelspacing);
> std::cout<< pixelspacing;
>
> also tried to  write an arbitrary spacing  too but still get pixel
> spacing 1.00\1.00:
>  itk::EncapsulateMetaData<std::string>(*dict, "0028|0030", pixelspacing);

itk::GDCMImageIO is meant for people to believe DICOM is a file format
for image :) If your itk::Image has a spacing of 1, then the spacing
that will be used in the output file will be 1.
This make is very convenient for people loading DICOM images, resample
the spacing to something aritrary, and then simply rewrite passing the
meta datadictionary. You do not even not know what IOD you are using
since the real information (complex) meta data is passed behind the
scene.

In conclusion, it simply means the Spacing of your itk::Image was 1.0
just before writing it.

HTH
-- 
Mathieu


More information about the Insight-users mailing list