[Insight-users] Streaming and memory allocation

Jarek Sacha galicjan at yahoo . com
Wed, 5 Jun 2002 07:31:21 -0700 (PDT)


I am trying to figure out how streaming works in ITK and write some
streaming applications. I see how a 'RequestedRegion' can be pulled
through a pipeline during processing (StreamingImageFilter). 

I have problem figuring out, however, what is the process of allocating
the memory for streaming. Memory allocation is critical since in most
streaming applications you want to do processing using amount of memory
that is a fraction of the size of the image that is being process. For
instance, I want to do processing on an image that is 6GB while my RAM is
only 1GB.

Here are some issues that I see as roadblocks of proper memory allocation
or as my lack of understanding what is going on:

1) Image objects tend to allocate memory for the LargestPossibleRegion
rather then BufferedRegion, see ImageBase< >::UpdateOutputInformation()

2) ImageFileReader<>::GenerateOutputInformation() forces allocation of
memory buffer equal to input image size.

3) Allocation is performed during GenerateOutputInformation, which is
before information about RequestedRegion is pushed up the pipeline

4) StreamingImage filter does not overwrite GetInputRequestedRegion,
rather this method is called from ImageToImageFilter and in turn from
ProcessObject that calls an all inputs
SetRequestedRegionToLargestPossibleRegion()

Could somebody give me some clues how memory allocation for streaming
works?

Jarek

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com