[vtkusers] Extents? Surely it's wrong this way? : was ....

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Fri Jan 5 19:25:13 EST 2001


Charles,

Thanks for the feedback. I've double checked everything and find that I've 
overridden
Execute()
and
ExecuteInformation()

It looks like I should be aiming at
void Execute(vtkImageData **inputs, vtkImageData *output);
void ExecuteInformation(vtkImageData **inputs, vtkImageData *output);
for multiple input imaging filters
and
void ExecuteInformation(vtkImageData *input, vtkImageData *output);
for single input

however, I'm still deeply unhappy....Quite a while back I sent you an 
ImageClip example...here's an almost identical ImageShrink Example which 
exhibits the same problem. In fact all imaging filters do. The question is 
: Is is necessary to invalidate the Update extents whenever Update is called?
Try the test below with the comment in place.
The first update is fine, but on the second, the Update Extent is
256/16, 256/16 and the WholeExtent is only 256/32, 256/32
You can see the problem?
Is there an alternative Update method which first clears all UpdateExtents 
and then updates the pipelines? If the Shrink Factors are controlled by a 
scrollbar or something and the user is updating them, the last object in 
the pipeline is doomed!

JB -
code follows

#include "vtkImageEllipsoidSource.h"
#include "vtkImageShrink3D.h"

#include "SaveImage.h"

void main( int argc, char *argv[] )
{
   char a;

   // create an actor and give it ellipse geometry
   vtkImageEllipsoidSource  *ellipse = vtkImageEllipsoidSource::New();
     ellipse->SetWholeExtent(0,255,0,255,0,1);
     ellipse->SetCenter(0,0,0);
     ellipse->SetRadius(15,15,1);
     ellipse->SetInValue(127);
     ellipse->SetOutValue(0);

   vtkImageShrink3D *shrink = vtkImageShrink3D::New();
     shrink->SetInput(ellipse->GetOutput());
     shrink->SetShrinkFactors(16,16,1);
   shrink->Update();
     shrink->SetShrinkFactors(32,32,1);
//  shrink->GetOutput()->SetUpdateExtent(0,-1,0,-1,0,-1);
   shrink->Update();

// render shrink output and pray!
   cin >> a;

   ellipse->Delete();
   shrink->Delete();
}





More information about the vtkusers mailing list