[Insight-users] RegionOfInterestImageFilter not updating imag e pixel container

Glenn Pierce glennpierce at connectfree.co.uk
Tue Jul 6 17:24:29 EDT 2004


On Tue, 2004-07-06 at 16:18 -0400, Miller, James V (Research) wrote:

> This is probably a bug in ImageToListAdaptor (the superclass to
> ScalarImageToListAdaptor).  ImageToListAdaptor uses information from
> the Image->LargestPossibleRegion when it should really use the
> BufferedRegion.  
>  
> Can you try something quickly?  Change lines 69 and 74 of Insight/
> Code/Numerics/Statistics/itkImageToListAdaptor.txx such that instead
> of calling GetLargestPossibleRegion() they call GetBufferedRegion().  
>  
> If this fixes your problem, please let us know and we will fix the
> code in the repository.


Afraid that doesn't work.

Note that  image->GetLargestPossibleRegion().GetSize() as used
in ImageToListAdaptor->SetImage does return the correct size of the
region of interest.

It only seems to be ImageToListAdaptor's Size() function that delegates
to  PixelContainer->Size() 
that returns the size of the original image.





> 
> Jim
> 
>         -----Original Message-----
>         From: Glenn Pierce [mailto:glennpierce at connectfree.co.uk]
>         Sent: Tuesday, July 06, 2004 2:49 PM
>         To: insight-users at itk.org
>         Subject: [Insight-users] RegionOfInterestImageFilter not
>         updating image pixel container
>         
>         
>         Hi
>         
>         I am currently trying to generate a grey level histogram from
>         from a region of interest of an image.
>         
>         
>         To select the roi from the original image I am using
>         RegionOfInterestImageFilter.
>         
>         I am then using a ListSampleToHistogramGenerator to generate
>         the histogram.
>         
>         The trouble is the ScalarImageToListAdaptor I am passing to
>         the ListSampleToHistogramGenerator
>         insists that the size of the roi I am passing is the size of
>         the original image.
>         
>         I have tracked this down I believe to the fact that the
>         pixelcontainer of the region of interest does not get
>         changed. ie
>         
>         if clip is a n instance of RegionOfInterestImageFilter
>         
>         clip->GetOutput()->GetPixelContainer()->Size() is constant no
>         matter the region
>         passed to clip.
>         
>         Is this a bug. Should the GetPixelContainer() be updated by
>         RegionOfInterestImageFilter ?
>         Or is there a work around ?
>         
>         Thanks for the help.
>         
>         Glenn  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20040706/bbac9dfc/attachment.html


More information about the Insight-users mailing list