[Insight-users] Pipeline execution when output information depends on input data

Jim Miller millerjv at gmail.com
Sat Jul 8 08:54:50 EDT 2006


Can you provide a bit more information as to the output dimensions are not
known until GenerateData() is invoked?

If the output dimension is a function of the input dimension and other
parameters of the filter, then you should be able to code that in the
GenerateOutputInformation() method.

If the output dimension is a function of the data in the input image, for
instance a bounding region about a foreground object, then this is another
story.

GenerateOutputInformation() is responsible for setting the
LargestPossibleRegion of the output, the spacing, the origin, the
directions, and the number of components per pixel. A filter needs to
provide an implementation of this method if the filter changes the size of a
pixel, changes the dimension of an image (3D to 2D), etc.

The RequestedRegions are established via other calls to the pipeline.

Jim


On 7/6/06, Hämäläinen Janne <Janne.Hamalainen at hus.fi> wrote:
>
>  Hi,
>
> I've made a filter that changes the output dimensions based on the data in
> the input. I know that I need give the correct output regions when pipeline
> update goes upstream using the GenerateOutputInformation-method, but in my
> filter the output dimensions are known only after the GenerateData-method is
> invoked. My question is what is the correct way to handle this situation? I
> cannot obviously calculate the output regions (RequestedRegion etc.) during
> the GenerateOutputInformation, because I cannot assume that the input is
> unchanged. On the otherhand if I update the output regions during
> GenerateData, the pipeline-mechanism does not work correctly, but I end up
> giving the original (the regions of the input) to the next filter along the
> pipeline. I hope I made myself clear, and hope someone can give a hint on
> how to handle this situation...
>
> Cheers, Janne
>
>
> --
> Janne Hämäläinen
> Physicist
> HUS, Helsinki Medical Imaging Center
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060708/6e6e7716/attachment.htm


More information about the Insight-users mailing list