[Insight-users] read dicom images, register and write out dicoms with no change in metadata

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Apr 8 16:28:59 EDT 2008


Hi Sirisha,

  Please CC the itk users mailing list as others might benefit from
this thread too. See my comments interlaced.


On Tue, Apr 8, 2008 at 6:32 PM, Tadimalla, Sirisha
<sirisha-tadimalla at uiowa.edu> wrote:
> Hi Mathieu,
>
>  Thanks for replying. I need one particular private tag to remain in the
>  output header. I will be using it for further processing of the image in
>  MATLAB.

Don't take me as arrogant, but this not something you should be doing.
Why don't you set a particular comment in Ipublic tags, such as mage
Comments (0020,4000). Private tags belong to the private vendor and
-again- you should not manipulate them AFAIK. Unless of course you are
creating your set of private tags, in which case you can do whatever
you like.

>  Can you elaborate on how I can extract this from the input and copy it
>  for writing?
>

Get the gdcm 1.2 tarball from the official repository and have a look
at: exReadWriteFile.cxx for instance (any other example in the
gdcm/Example should be a good starting point).


>  Another issue that I have is that I use the registered image pixel
>  values for a curve fitting procedure, so I need those values to remain
>  the same. The original pixel values are doubles, but GDCM doesn't accept
>  it when I define my pixeltype as double. What should I do?

It should work out of the box. Are you copying back everything from
the meta data dictionary (see itk user guide for example) ? If so make
sure you are not dropping actidentally the Rescale Slope / Rescale
Intercept DICOM tag. They are used at read time to convert the stored
pixel into your 'double' pixel type, and then again at write time to
convert your double pixel type to regular DICOM pixel type (generally
16bits unsigned short). Be sure to keep the same Rescale Slope /
Rescale Intercept to avoid any data loss.


HTH
-- 
Mathieu


More information about the Insight-users mailing list