[Dcmlib] vtkGdcmReader and load options

Luca Picello luca.picello at libero.it
Fri Jul 15 11:44:13 CEST 2005


Hello Benoit,
there is not any sort of images made by the vtkGdcmReader. that's the point!

But I need something like it (read imagenumber from image file to sort 
them):

        if( parser->IsDICOM == true )
        {
          AnsiString PatientName;
          AnsiString StudyInstanceUID;
          AnsiString StudyDate;

          // 7FE0 0010 OX "Pixel Data"
          if( parser->FindElement( 0x7FE0, 0x0010 ) == 1 )
          {
            char input[255];
            strcpy(input, parser->ReadElement() );
            char* p = strtok(input, " ");
            p = strtok(NULL, " ");
            p = strtok(NULL, " ");
            p = strtok(NULL, " ");
            p = strtok(NULL, " ");

            int NextBlock = AnsiString( p ).ToInt();
            int ImageNumber = parser->ReadIntAsciiNumeric( NextBlock );
          }
          else
            continue; // DICOM file not valid
 
it should be done inside gdcm somewhere (I believe not in vtkGdcmReader).
Heuristic prefix, pattern etc are not needed with dicoms: there are all 
the information inside files header, as patient name etc.
and it is unsafe. Please let me know you opinion.

thank you,
Luca




Benoit Regrain wrote:

> Hi,
>
> I haven't found any sort of images made by the vtkGdcmReader.
> Could you point the source code where you have seen it.
>
> With the vtkGdcmReader, you have 2 possibilities to read volumes :
> - add all files you want with the RemoveAllFileName and   AddFileName 
> methods. - specify an heuristic to load an image, using the Prefix, 
> Pattern, etc.
>   informations. This solution is the same than in other vtk Readers.
>
> Cheers
> Benoit Regrain
>
> ----- Original Message ----- From: "Luca Picello" 
> <luca.picello at libero.it>
> To: "dcmlib" <dcmlib at creatis.univ-lyon1.fr>
> Sent: Friday, July 15, 2005 12:06 AM
> Subject: [Dcmlib] vtkGdcmReader and load options
>
>
>> Hello everybody,
>> I have found a little trickery on loading of images stacks.
>> My previous approach was (however it still is...) on searching for 
>> all files in a directory and adding them to vtkGdcmReader object.
>> I thought vtkGdcmReader loads images and organizes itself with dicom 
>> ImageNumber tag but it is untrue. :-(
>> Is there a method or do I need to seek and modify it to obtain 
>> correct volumes?
>> If second option is forced, where, more or less, what have I to look 
>> for? which module?
>>
>> Thank you,
>> Luca
>>
>> _______________________________________________
>> Dcmlib mailing list
>> Dcmlib at creatis.insa-lyon.fr
>> http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib
>
> .
>




More information about the Dcmlib mailing list