[Insight-users] itkAnalyzeImageIO.cxx

richardh richardh at comp.leeds.ac.uk
Wed May 23 10:07:27 EDT 2007


re ReadImageInformation()

In a previous posting, remi.chapeaublanc at free.fr observed that s/he 
had to comment out the line as:

     std::vector<double> dirx = this->GetDirection(0),
       diry = this->GetDirection(1),
       dirz = this->GetDirection(2);
     typedef itk::SpatialOrientationAdapter<3>::DirectionType DirectionType;
     DirectionType dir;
     for(unsigned int i = 0; i < 3; i++)
       {
       dir[i][0] = dirx[i];
       dir[i][1] = diry[i];
   //  dir[i][2] = dirz[i];
       }

In ITK 3.2.0, I see "ReadImageInformation()" is still hard-coded as 
(line 972):

       unsigned dims = this->GetNumberOfDimensions();
       std::vector<double> dirx(dims,0),
         diry(dims,0),
         dirz(dims,0);
       dirx[0] = dir[0][0];
       dirx[1] = dir[1][0];
       dirx[2] = dir[2][0];
       diry[0] = dir[0][1];
       diry[1] = dir[1][1];
       diry[2] = dir[2][1];
       dirz[0] = dir[0][2];
       dirz[1] = dir[1][2];
       dirz[2] = dir[2][2];
       for(unsigned i = 3; i < dims; i++)

	...

which does not make much sense if dims==2 (as with some of our itk-snap 
examples). Is dims>=3 being assumed and why?

thanks,
Richard




More information about the Insight-users mailing list