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

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Mon Jun 26 13:06:13 EDT 2017


Hello,

Have you looked at the LabelImageStatisticsImageFilter[1]? This should compute what you describe.

The “GetRegion” methods returns a bounding ImageRegion, for a given label. In your case this would be for the label 1.

Brad

[1]https://itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html#aa0de894e901cf64495f5690f77b73efb


On 6/26/17, 12:39 PM, "Andaharoo" <andx_roo at live.com> 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


More information about the Community mailing list