[Insight-users] iterator gives different values in 32 and 64 bit linux ?

gregthom gregthom99 at yahoo.com
Mon Jul 6 06:41:46 EDT 2009


Greetings

I am using this code to determine the number of voxels that lie withing a
binary mask image

  //create meshtoimage filter
  BinaryImageType::ValueType  m_MaskValue =
itk::NumericTraits<BinaryImageType::ValueType>::One;  
  typedef  itk::ImageRegionConstIteratorWithIndex<BinaryImageType>
MaskIteratorType;  
  MaskIteratorType mit( triangleMeshToImage->GetOutput(),
triangleMeshToImage->GetOutput()->GetBufferedRegion() );   
  
  //typedef itk::PointSet< double, 3 > PointSetType;
  BinaryImageType::PointType InputPointType;

  // lets get number of voxels
  mexPrintf(">> first pass to get # voxels \n");
  unsigned int nvoxels;
  for (mit.GoToBegin(); !mit.IsAtEnd(); ++mit)
  {
     
     BinaryImageType::PointType iPoint;
     triangleMeshToImage->GetOutput()->TransformIndexToPhysicalPoint(
mit.GetIndex(), iPoint );  
     
     if (m_MaskValue == mit.Get())
     {     
         nvoxels++;         
     }
     else
     {
        
     }      
  }//
  mexPrintf(">> number of voxels in mask :: %d \n",nvoxels);



When run in 32 bits linux environment everything runs fine but on 64 bits
environment, there number of voxels is not correct. Anybody know what is
going on ?


thank you

G
-- 
View this message in context: http://www.nabble.com/iterator-gives-different-values-in-32-and-64-bit-linux---tp24353264p24353264.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list