[Insight-developers] managing filter outputs

Miller, James V (CRD) millerjv at crd.ge.com
Mon Sep 25 08:08:05 EDT 2000


Josh,

itkRandomImageSource illustrates what a filter writer should provide.  You can assume the output
image is already available by the time execute is called. Currently, the memory for the output image
has not been allocated by the time execute is called.  You will have to call Image::Allocate() inside
execute for now.

The goal is for all the memory allocation to be performed prior to execute being called.  We have not
inserted that code yet since there are several optimizations that can be performed but are rather
complicated (for instance, if a filter is run a second time and is required to produce the same
amount of output data as the last time it executed, then we do not need to reallocate the memory).

If you think the implementation is different from the above design (where the output object is
available by the time execute is called) then let us know.

Currently, as a filter writer, there may be as many as 4 functions that you may want to override in
your filter. (The names are these are subject to change).

1. Execute - otherwise your filter will not be very interesting

2. ExecuteInformation - if you filter is going to change the configuration of the output (spacing,
ImageSize, etc.) then override this method.

3. ComputeInputUpdateExtent - how much data do you need on input in order to produce the amount of
data requested on output?

4. EnlargeOutputUpdateExtent - if you receive a request for a certain amount of output data but your
filter needs to produce more than that, then provide an implementation for this function.  Examples
of cases where you would need this are filters that do not support streaming and must produce the
entire output image, or filters that are more efficient is the image size is a power of 2.

I hope to pin down new names, design, and implementation for these functions by Visualization 2000.

Jim

-----Original Message-----
From: Joshua Cates [mailto:cates at cs.utah.edu]
Sent: Friday, September 22, 2000 3:23 PM
To: Insight-Developers
Subject: [Insight-developers] managing filter outputs


I am having some trouble understanding how a ProcessObject should manage
the creation and destruction of its output objects.

For example, say I have a FilterImageToImage subclass:

 MyFilterImageToImage : public FilterImageToImage

On a call to MyFilterImageToImage::Execute(), should a new output
Image::Pointer be created, configured, and Allocate()'d?  What happens to
any prior existing output Image::Pointer?


Josh.

+--+--+--+--+--+--+--+--+--+--+--+--
 Josh Cates			
 Department of Computer Science	
 University of Utah
 Email: cates at cs.utah.edu
 Phone: 
 URL:   www.cs.utk.edu/~cates
--+--+--+--+--+--+--+--+--+--+--+---


_______________________________________________
Insight-developers mailing list
Insight-developers at public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers




More information about the Insight-developers mailing list