[ITK-users] 3D image centre

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Mon Mar 6 08:54:55 EST 2017


You are missing that application of your image’s orientation/direction cosine matrix.

I’d recommend computing the center index (as a ContinuousIndex type), and then using the Image::TransformContinuousIndexToPhysicalPoint[1] method.

HTH,
Brad

[1] https://itk.org/Doxygen/html/classitk_1_1ImageBase.html#ad3965f819b7d61e34605dc0331df0751

On Mar 5, 2017, at 6:48 PM, Dženan Zukić <dzenanz at gmail.com<mailto:dzenanz at gmail.com>> wrote:

Hi Fabio,

that sound right.

Regards,
Dženan

On Sun, Mar 5, 2017 at 5:14 PM, D'Isidoro Fabio <fisidoro at ethz.ch<mailto:fisidoro at ethz.ch>> wrote:
Hi,

since the image origin is defined in the middle of the “first” voxel and not at the very corner of the CT scan, I would calculate the image centre as:

               img_centre[0] = origin[0] + spacing[0] * static_cast<double>(size[0]) / 2.0 - spacing[0] / 2.;

Is that right?

Thank you


_____________________________________
Powered by www.kitware.com<http://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.php

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://public.kitware.com/mailman/listinfo/insight-users


_____________________________________
Powered by www.kitware.com<http://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.php

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://public.kitware.com/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170306/5b9539d4/attachment.html>


More information about the Insight-users mailing list