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

Tadimalla, Sirisha sirisha-tadimalla at uiowa.edu
Tue Apr 8 18:48:15 EDT 2008


Hi, 

Yes, I am not changing the tags. I just need it to be there in the registered image for later use. 

Mathieu, I looked at the example in gdcm, and it seems like I should read in the tag content into a string. 
f = GDCM_NAME_SPACE::File::New();
f->SetFileName( filename );
f->AddForceLoadElement( 0029, 1020);
std::string T1rho_value = f->GetEntryString( 0029, 1020);

But I dont know how to use it in my program. This is the first time I am using ITK, please bear with me.
Thank you

-Sirisha

Hi Mathieu,

  I've had occasional need to reference a vender private tag for
processing.  I'm guessing Sirisha needs to look at a vender private tag
generated by the scanner, not insert a new one.  DICOM does not require
an implementation to preserve private tags, but sometimes it's a nice
feature.

-dan

-----Original Message-----
From: insight-users-bounces at itk.org
[mailto:insight-users-bounces at itk.org] On Behalf Of Mathieu Malaterre
Sent: Tuesday, April 08, 2008 3:29 PM
To: Tadimalla, Sirisha
Cc: insight-users at itk.org
Subject: Re: [Insight-users] read dicom images,register and write out
dicoms with no change in metadata

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
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list