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

Luis Ibanez luis.ibanez at kitware.com
Tue Mar 23 15:48:20 EDT 2010


Hi Zhao,

Please look at the code of

          Insight/Code/Common
             itkCenteredTransformInitializer.txx


in lines 95 to 153,
it shows how to compute the physical coordinates
of the center of an image.


Your current code is not covering all cases.


      Regards,


             Luis


--------------------------------------------------------------------
On Mon, Mar 22, 2010 at 10:49 PM, Yongqiang Zhao <zhaoyq76 at live.com> wrote:
> 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.
> Learn More.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list