[Insight-users] spatial objects and Update

Xabier Artaechevarria Artieda xabiarta at unav.es
Thu Aug 30 12:34:26 EDT 2007


Hi all,
I am calculating statistics inside a spatial object, varying its  
position across the image. I based on the example  
SpatialObjectToImageStatisticsCalculator.txx for that.
I just change the offset in every iteration, according to an image  
iterator. However, I have realized that the bounding box is not  
correct, if I do not ?update? the spatial object in every iteration.  
The problem with that is that it takes a considerable time. Is it  
necessary to update every time?  Is there a way to avoid it or do it  
faster?

The relevant part of the code is shown below:

for(inIt.GoToBegin(); !inIt.IsAtEnd(); ++inIt)
     {
     for(int dim=0; dim < maximumDimension; ++dim)
       {
       ellipseCenter[dim] = inIt.GetIndex()[dim];
       }
       m_Ellipse->SetRadius(5);
       m_Ellipse->GetIndexToObjectTransform()->SetOffset(ellipseCenter);
       m_Ellipse->ComputeObjectToParentTransform();
       m_Ellipse->Update();  // can this be avoided?

       m_Calculator->SetImage(edgeImage);
       m_Calculator->SetSpatialObject(m_Ellipse);
       m_Calculator->Update();
    }

Thanks in advance,
  Xabi
-- 
Xabier Artaechevarria
Cancer Imaging Laboratory
Centre for Applied Medical Research
www.cima.es






----------------------------------------------------------------
Este mensaje ha sido enviado desde https://webmail.unav.es



More information about the Insight-users mailing list