[Insight-users] itk::GDCMImageIO - GetValueFromTag

Jean-Pierre Roux jpr at creatis.insa-lyon.fr
Wed Nov 21 08:18:48 EST 2007


David Lambiel wrote:
> Hello
> Thanks in advance for the help.
> I'm extracting some tags from a DICOM image set. Some tags are 
> correct, some seem to be empty... But I checked with imageJ and they 
> exists.
>
> For example: I'm getting the tags with something like this:
>
> itk::GDCMImageIO::Pointer dicomIO = itk::GDCMImageIO::New();
>
> [...]
>
> std::string patientID;
> std::string tagkey = "0010|0020";
> dicomIO->GetValueFromTag(tagkey, patientID);
> std::cout  << "    Patient ID: " << patientID << std::endl;
>        
> std::string patientBirthDate;
> tagkey = "0010|0030";
> dicomIO->GetValueFromTag(tagkey, patientBirthDate);
> std::cout  << "    Patient BirthDate: " << patientBirthDate << std::endl;
>
> [...]
>
> std::string studyInstanceUID;
> tagkey = "0020|000D";

==> I'm not 100% sure, but I remember some troubles with gdcm when we 
mixed uper case and lower case hexadecimal values..
Did you try
tagkey = "0020|000d";

Jean-Pierre Roux

> bool found = dicomIO->GetValueFromTag(tagkey, studyInstanceUID);
> std::cout  << "    Study Instance UID: " << studyInstanceUID << std::endl;
>
> The 2 first are correct, but the third is empty. The getValueFromTag 
> return me a 0. But imageJ give me for the same set:
>
> [...]
> 0010,0020  Patient ID: 278579
> [...]
> 0020,000D  Study Instance UID: 1.2.840.41213141111.2.9.3.400025584
>
> So I'm lost. Does someone has an idea where/what is the problem ?
> Perhaps I'm missing something, important or dumb...
>
> Thanks
>
> David Lambiel
> -----------------------------------------------------------------
> Swiss Federal Institute of Technology Lausanne (EPFL)
> Signal Processing Institute (ITS)
> Signal Processing Laboratory 5
> Station 11
> ELD 225 (Bâtiment ELD)
> 1015 Lausanne
> Switzerland
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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