Re: [ITK-users] Recentering Output of fast marching

Matt McCormick <[email protected]>
Newsgroups gmane.comp.lib.itk.user
Message-ID <CALzTN-QMZ-wHweR4p5u46Of3oT0e0idQtWaOwp7EO17+Cftp4g@mail.gmail.com>
Hi,

This example shows how to find the bounding box of a binary image:

  https://itk.org/Insight/Doxygen/html/Examples_2SpatialObjects_2BoundingBoxFromImageMaskSpatialObject_8cxx-example.html

Hope this helps,
Matt

On Mon, Jun 26, 2017 at 12:39 PM, Andaharoo <[email protected]> wrote:
> I've been using the fast marching filter to segment out a particular piece of
> a 3d image and now I would like to recenter this segmented part. Sometimes
> the segmented part can be at the edge of the image which makes it hard to
> rotate since it will only rotate around the center. I tried using fast
> marchings getOutputOrigin but that doesn't do what I had hoped it would do.
> If I were to write it would go something along the lines of this with a
> binary image:
> for every pixel
>     if the pixel is 1
>         if the pixels x val is greater than maxX
>             maxX = the pixels x val
>         if the pixels x val is smaller than minX
>             minX = the pixels x val
>         Do the same with the y and z and mins
> Then after getting the extents I coudl just do (minX + maxX) / 2, (minY +
> maxY) / 2, (minZ + maxZ) / 2
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Recentering-Output-of-fast-marching-tp7590022.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> 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.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

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.