[Insight-users] Automated cropping of an image based on image segmentation

Lodron, Gerald Gerald.Lodron at joanneum.at
Tue Dec 22 03:32:17 EST 2009


Hi

Thanks for the tip in A, i think i will try it but i think my secound question was misinterpreted:

Which one is faster (or better):

A) Using itkAutoCropLabelMapFilter with an fixed and moving image mask

Or

B) Using SetFixedImageMask and SetMovingImageMask of the image to image metric with the same fixed and moving image mask


Best regards




-----Ursprüngliche Nachricht-----
Von: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
Gesendet: Dienstag, 22. Dezember 2009 01:36
An: Lodron, Gerald
Cc: insight-users at itk.org
Betreff: Re: [Insight-users] Automated cropping of an image based on image segmentation

Hi Lodron,


A) About your first question:

For cropping an image to the size of the segmented object you can use the recently added filter:

     Insight/Code/Review/
                             itkAutoCropLabelMapFilter.h


B) About your second question:

The size of the image mask will be (mostly**) irrelevant for the purpose of evaluating the computation time of the registration algorithm.

The "mostly" qualifier is added here, just because with a smaller image you "may" get better memory caching in your processor... but.... in practice, given all the things that are moving on in the registration framework at the same time, I would think that it is unlikely that such potential caching manages to make any difference.
(... of course,... only a carefully executed experiment will tell for sure).

In any case, using the filter in (A) is so easy, the you may just go for it.


     Regards,


           Luis





----------------------------------------------------------------------------------------
On Wed, Dec 16, 2009 at 3:53 AM, Lodron, Gerald <Gerald.Lodron at joanneum.at> wrote:
>
> Hello,
>
> I have two 3D CT images which i want to register. I want first segment the human from the rest because I think the environment (patient table etc) will/can disturb the registration. The segmentation already works perfect, I use a simple connected threshold filter in combination with an image closing which results in an image of zeros and ones.
>
> Now I have two questions:
>
> - I think it would be a great idea (performance reasons) to automatically crop the image depending on that segmentation result but i have no idea how to do this efficiently, any ideas?
>
>
> - In the imageToImageMetric I found the functions: SetFixedImageMask 
> and SetMovingImageMask
>  They needs a type called Spatial Objects so I think i had to use the itk::ImageSpatialObject class to convert my itk Image into such a spatial object type. Here is my question: Is it advisable to make a cropping and this image mask stuff or will the image mask stuff make everything internal to compute the result fast?
>
> Best regards
>
> _____________________________________
> 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