Update extent does not lie within whole extent
John Biddiscombe
j.biddiscombe at rl.ac.uk
Wed Apr 26 13:57:21 EDT 2000
Lisa,
Seems to be a problem here...
> Keep
> in mind that if your filter shrinks data by a factor of 2, then you must
be
> expanding your update extent by a factor of 2 during the
> PropogateUpdateExtent. Is it possible that you are asking for more data
here's my ExecuteInformation call...
//
vtkImageData *pop = this->GetPopulation();
vtkImageData *cov = this->GetCoverage();
vtkImageData *output = this->GetOutput();
//
float spacing[3], spa1[3], spa2[3], origin1[3], origin2[3];
int wholeExtent[6], dims1[3], dims2[3];
//
pop->GetWholeExtent(wholeExtent);
pop->GetSpacing(spa1); pop->GetDimensions(dims1);
pop->GetOrigin(origin1);
cov->GetSpacing(spa2); cov->GetDimensions(dims2);
cov->GetOrigin(origin2);
//
bool valid = true;
for (int j=0; j<3; j++) {
if (spa1[j] != spa2[j]) valid = false;
if (dims1[j] != dims2[j]) valid = false;
if (origin1[j] != origin2[j]) valid = false;
}
if (!valid) {
vtkErrorMacro(<< "DataSets were not consistent");
return;
}
//
wholeExtent[1] = wholeExtent[1]/PixelAveraging[0];
wholeExtent[3] = wholeExtent[3]/PixelAveraging[1];
spacing[0] = spa1[0]*PixelAveraging[0];
spacing[1] = spa1[1]*PixelAveraging[1];
spacing[2] = 1;
//
output->SetWholeExtent(wholeExtent);
output->SetDimensions(wholeExtent[1]-wholeExtent[0]+1,
wholeExtent[3]-wholeExtent[2]+1, 1);
output->SetSpacing(spacing);
output->SetScalarType(VTK_FLOAT);
output->SetNumberOfScalarComponents(1);
The pixelAveraging just tells the routine to make the output smaller than
the input datasets. At no point to I ever tell UpdateExtent anything at all.
This is all handled by the ancestral vtkTwoImageInput and vtkImageFilter -
no?
I was under the impresion that updateextent was used by the multithreading
code to divide up the image?
shall I just add
output->SetUpdateExtent(wholeExtent);
to the code and stop worrying?
John B
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------
More information about the vtkusers
mailing list