[Dcmlib] vtkGdcmReader and load options

Jean-Pierre ROUX jean-pierre.roux at creatis.insa-lyon.fr
Fri Jul 15 14:50:59 CEST 2005


At 12:15 +0200 15/07/05, Luca Picello wrote:
>Thanks a lot JP,
>I'll take a look on how to do it. Do you have any example or 
>documentation related?
>ok... an example is enough ;-)

I'm afraid we didn't write a lot about it.

Have a look at Testing/TestSerieHelper.cxx, to see how to use 
gdcm::SerieHelper.
Since you probabely have only *one* Serie in your directory, remove 
the last part,(// For all the coherent File lists ...)
just keep :
gdcmFileList *l = s->GetFirstCoherentFileList();
s->OrderFileList(l);

Then you loop on all file File * within l
for(FileList::const iterator it=l->begin(); it != l->end(); ++it)
{
    fileName=(*it)->GetFileName();

and you pass AddFileName to your vtkGdcmReader, the file are in the 
right order.



And here we reach the stupid point :
vtkGdcmReader will parse again all the files, to be sure they are 'coherent'.
The thing we have to add is to allow user to pass a 
'CoherentFileList' (i.e. a std::vector of File*, comming from 
SerieHelper), and vtkGdcmReader will not perform any Parsing nor any 
coherence check.

--> Mathieu, Benoit ? Any opinion?

But right now, you need to proceed as described.







>
>luca
>
>
>Jean-Pierre ROUX wrote:
>
>>At 0:06 +0200 15/07/05, Luca Picello wrote:
>>
>>>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. :-(
>>
>>
>>
>>
>>Hi, Luca!
>>
>>Sorting images on 'ImageNumber' is not enough, in a general case 
>>(it may not be present, or contain stupid values, or give time 
>>info, insteda of spacial info, etc.
>>
>>There is a gdcm::SerieHelper that does the job, even in the worst cases.
>>
>>-> You create the SerieHelper
>>-> You AddFileName() for each one or your files,
>>  or you SetDirectory to explore (recursively or not) the directory
>>  that contains your files.
>>
>>The files are splitted into Coherent File Lists (on list for each 
>>Dicom Serie he found)
>>
>>-> you sort the Coherent File List you want to work on, with OrderFileList.
>>
>>And you are sure the files are in the right order.
>>
>>It works, even on huge and complicated Series;
>>We are not very happy with the whole stuff, because there is 
>>overhead in simple cases.
>>We are sure, some day, we shall reorganize it, but we have not yet 
>>very claer ideas.
>>HTH.
>>
>>JP
>>
>>
>>
>>>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
>>
>>
>> Jean-Pierre ROUX
>> CREATIS - CNRS UMR 5515, INSERM U 630
>> Laboratoire de Radiologie Experimentale
>> Hopital Cardiologique
>> 28 Avenue du Doyen LEPINE
>> B.P. Lyon-Montchat
>> 69394 Lyon Cedex 03
>>
>> Tel      : (+33) 04 72 35 74 12
>> Fax      : (+33) 04 72 68 49 16
>> URL      : http://www.creatis.univ-lyon1.fr
>> e-mail   : jpr at creatis.univ-lyon1.fr
>>                                  .
>>
>
>_______________________________________________
>Dcmlib mailing list
>Dcmlib at creatis.insa-lyon.fr
>http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib

   Jean-Pierre ROUX
   CREATIS - CNRS UMR 5515, INSERM U 630
   Laboratoire de Radiologie Experimentale
   Hopital Cardiologique
   28 Avenue du Doyen LEPINE
   B.P. Lyon-Montchat
   69394 Lyon Cedex 03
 
   Tel      : (+33) 04 72 35 74 12
   Fax      : (+33) 04 72 68 49 16
   URL      : http://www.creatis.univ-lyon1.fr
   e-mail   : jpr at creatis.univ-lyon1.fr
								   



More information about the Dcmlib mailing list