[Insight-users] How to compute the correct center of image?

Yongqiang Zhao zhaoyq76 at live.com
Mon Mar 22 22:49:46 EDT 2010


Hi,

I have an 3D image and use the following method to compute the center of this image. 

ImageType::IndexType index = image->GetLargestPossibleRegion()->GetIndex();
for(unsigned int i=0;i<3; i++)
{
   index[i] += image->GetLargestPossibleRegion()->GetSize()/2;
}

ImageType::PointType center;
image->TransformIndexToPhysicalPoint(index, center);

Can this method get correct center of image?

Thanks!

Y.Q
 		 	   		  
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100322/f04900e0/attachment.htm>


More information about the Insight-users mailing list