[Insight-users] Filtering region by region an image

Mathieu Malaterre Mathieu.Malaterre@creatis.insa-lyon.fr
Fri, 21 Feb 2003 19:41:28 +0100


James,

	I tried to use itkChangeInformationImageFilter for my purpose. But the 
whole code base its work on the LargestPossibleRegion. And 
LargestPossibleRegion isn't changed with ->SetRequestedRegion(region).

	Could you please take this into account when you write this filter 
(whether to use RequestedRegion or LargestPossibleRegion).

Thanks,
mathieu



Mathieu Malaterre wrote:
> THANK YOU JAMES ! (cry of joy)
> 
> Right, I tried your suggested pipeline, and it seems to work. If I print
> someFilter->GetOutput()->Print(cout);
> 
> I got:
> Image (0x8082100)
>   Reference Count: 2
>   Modified Time: 60
>   Debug: Off
>   Observers:
>     none
>   Source: (0x80818d0)
>   Source output index: 0
>   Release Data: Off
>   Data Released: False
>   Global Release Data: Off
>   PipelineMTime: 52
>   UpdateTime: 62
>   LastRequestedRegionWasOutsideOfTheBufferedRegion: 1
>   LargestPossibleRegion:
>     Dimension: 2
>     Index: [0, 0]
>     Size: [1402, 424]
>   BufferedRegion:
>     Dimension: 2
>     Index: [50, 50]
>     Size: [50, 50]
>   RequestedRegion:
>     Dimension: 2
>     Index: [50, 50]
>     Size: [50, 50]
>   Origin: [0, 0]
>   Spacing: [1, 1]
>   PixelContainer: ImportImageContainer (0x80821b8)
>   Reference Count: 2
>   Modified Time: 61
>   Debug: Off
>   Observers:
>     none
>   Pointer: 0x80821e4
>   Container manages memory: true
>   Size: 2500
>   Capacity: 2500
> 
> 
> when I try to write it back to a file I got a seg fault, because the 
> output image is smaller than the original image. By the way I don't 
> understand why this happen because
> 
> LargestPossibleRegion: Size: [1402, 424] (which is the initial image).
> 
> But anyway, I guess now I'll have to play with 
> ChangeInformationImageFilter to simulate your PasteImageFilter.
> 
> Again thank you,
> mathieu

-- 
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www.creatis.insa-lyon.fr/~malaterre/