[Insight-developers] propagating region size changes through the pipeline

Miller, James V (CRD) millerjv@crd.ge.com
Mon, 10 Sep 2001 08:59:51 -0400


Josh,

I finally have a handle on this.  I'm not too happy with the solution/explaination. So I may end up
reworking some things.

ProcessObject has two methods: Update() and UpdateLargestPossibleRegion().  Update() always brings
the output requested region up-to-date.  If an output requested region has not been set, then
Update() will set the output requested region to the output largest possible region. Once the output
requested region is set, Update() will continue using that requested region.  If changes are made to
the pipeline such that the largest possible region changes, these changes will not change the output
requested region.

So for your pipeline, changing the file to be read resulted in different largest possible regions.
The first time through the pipeline, Update() set the filter's output requested region to the largest
possible region for the first dataset.  When you changed the file to be read, the filter tried to use
the previous requested region.

If you always want the entire image to be processed, you should call UpdateLargestPossibleRegion()
instead of calling Update().

I have modified the documentation for ProcessObject to amplify this distinction. But I am not happy
with Update() having different behaviors when it is called the first time verses subsequent calls.
The difficulty is that you really don't know whether the user is calling Update() or the pipeline is
calling Update() internally.

Jim


-----Original Message-----
From: Joshua Cates [mailto:cates@cs.utah.edu]
Sent: Thursday, August 23, 2001 12:21 PM
To: Insight-Developers
Subject: [Insight-developers] propagating region size changes through
the pipeline


Hi,

I am having pipeline troubles.  I cannot get the pipeline to propagate
changes to the size of output regions on updates.

Consider the pipeline:

 myFileReader -> myFilter -> myFileWriter

And the code

for (i = 1 to 10)
  myFileReader->SetFileName(myInputData.i)
  myFileWriter->SetFileName(myOutputData.i)
  myFileWriter->Update()


The trouble is that not every data set myInputData.i is the same size.  
When myFileReader reads a new file, it defines the region sizes in
GenerateOutputRequestedRegion (also in UpdateOutputInformation(), though I
don't know if this is necessary?).

When I print myFilter->GetInput()->GetRequestedRegion(), this region is
correct.  myFilter->GetOutputRegion()->GetRequestedRegion(), however, is
still the same as in the previous execution of the pipeline.

What am I missing?

Thanks,

Josh.


______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates@cs.utah.edu
 Phone: (801) 587-7697
 URL:   www.cs.utk.edu/~cates



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