[Insight-users] Bug report and bug fix in GDCM

Pierre Fillard Pierre.Fillard at inria.fr
Fri Jun 15 12:57:33 EDT 2007


Not sure whether this is the right place to submit a bug in GDCM, but as 
it is distributed with ITK, I thought you might be interesting.

In one of my program, I use GDCM to split DICOMs when they are 
interlaced (case of DTI for instance).
I call the function 'SplitOnPosition' of the class SerieHelper (the code 
is in the file Utilities/gdcm/src/gdcmSerieHelper.cxx) to split the 
volume into several other volumes.
This function always skips the very first DICOM, and eventually removes 
it from the list, because of this part of the code (starting line 466 of 
file gdcmSerieHelper.cxx):

*FileList::const_iterator it = fileSet->begin();
   it ++;
   for ( ;
         it != fileSet->end();
       ++it)
   {     (...)*

Maybe I am missing something, but there is no reason why there should be 
a  (it++) right before the loop. It makes the split always skip the 
first dicom. Changing it to:

*FileList::const_iterator it = fileSet->begin();
   for ( ;
         it != fileSet->end();
       it++)
   {     (...)*

solved the problem. Two other functions should be changed the same way: 
SplitOnOrientation and SplitOnTagValue.

By the way, I am using the CVS version of ITK.
I hope this was useful.

Pierre Fillard,
PhD Candidate,
Asclepios Research Team, INRIA, France.



More information about the Insight-users mailing list