[ITK-users] [ITK] registering ROI

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Mar 30 07:15:19 EDT 2015


Hello,

Since you have done the ROI extraction with ITK, then the physical location of each pixel has been maintained. Use the ROI Image's TransformIndexToPhysicalPoint method[1], then use your original image's TransformPhysicalPointToIndex method[2]. This would be the most generalized and robust method which the documentation refers too. You could use it to validate your optimized approach.

Yes, alternatively you can use the RegionOfInterestImageFilter ( I believe ) to extract a region which has a non-zero starting index, and is the same indexing and the input image. Alternatively you can use the pipeline and rely on the streaming to produce the regions, but then you have to deal with the fact that the buffered region is different than the largest possible region. There are many possibilities on what to do here.

Hope that helps,
Brad

[1] http://www.itk.org/Doxygen/html/classitk_1_1ImageBase.html#ab003313ba1a078d89a832dc0a35d2efa
[2] http://www.itk.org/Doxygen/html/classitk_1_1ImageBase.html#af4a7c9c3787e9fdafbaaade2e02efa25

On Mar 30, 2015, at 5:50 AM, Pol Monsó Purtí <lluna.nova at gmail.com> wrote:

> Hello all,
> 
> tl; dr
> 
> How can I reset the index of two labelObjects' bounding box generated from a ROIExtractor output to the original image's LargestPossibleRegion() coordinate system?
> 
> --
> 
> I need to apply a series of (non-itk) operations on a ShapeLabelObject present in a small ROI of the image with the purpose of dividing it in two. I was using ROI filter because among other things I want the Indexes to be referred to the ROI so it is less complex to refer to the voxels' coordinates.
> 
> But afterwards I need the original Index so that the GetBoundingBox() of the two generated label objects returns a region that refers to the original image repectively, while maintaining the size (probably index offset shift) of the new labelobject.
> 
> I could do as for now and store the roi and then do something like (roi.getIndex() + obj->GetBoudingBox().GetIndex() ) to create a shifted bounding box, but maybe there is a better way to do it, as read in the documentation:
> 
> The origin coordinates of the output images will be computed in such a way that if mapped to physical space, the output image will overlay the input image with perfect registration. In other words, a registration process between the output image and the input image will return an identity transform.
> 
> So how could I remap to the original "physical space"? I don't know to what does that phrase refer to, but it sounds like it's exactly what I am trying to do.
> 
> I've looked into SetRequestedRegion also as an alternative, but that would not give me indexes relative to roi, so I would have to substract them right before the operations, which might be an option too, but I believe things get complicated if I do that.
> 
> Cheers,
> 
> Pol
> 
> 
> 
> 
> _____________________________________
> 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
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community



More information about the Insight-users mailing list