[Insight-users] Problem reading itkTransform files

Francois Budin insight.mailinglist.francois at budin.fr
Mon Dec 14 17:15:40 EST 2009


Hi everybody,

I am trying to read itkTransform files using the itk::TransformFileReader
class and I cannot succeed to make it work properly. The code I wrote for
debugging purposes is:

itk::TransformFileReader::Pointer transformFile ;
    transformFile=itk::TransformFileReader::New() ;
    transformFile->SetFileName( fileName.c_str() ) ;
    transformFile->Update() ;
    for( itk::TransformFileReader::TransformListType::const_iterator it =
transformFile->GetTransformList()->begin() ;
         it != transformFile->GetTransformList()->end() ; ++it )
        {
        std::cout<< "message"<<std::endl;
        }
 // transformFile->GetTransformList()->pop_back() ;
 transformFile->GetTransformList()->size() ;

My first problem was that calling the function size() to get the size of the
std::list ended up being an infinite loop. I monitored the value of
"m_TransformList" in itk::TransformFileReader and everything seems to work
fine. But when I get the pointer on this variable, it does not work
properly. Calling the function pop_front() works, but calling pop_back()
makes my program crash. I tried to add a loop manually to compute the size
of the std::list but it is also an infinite loop.
Has anybody ever had these problems or does somebody see what is wrong in my
code?
Sincerely,

Francois
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091214/d8a3d60b/attachment.htm>


More information about the Insight-users mailing list