[Paraview] Getting Z Boundaries Correct on Custom Reader

Mike Jackson mike.jackson at bluequartz.net
Tue Jul 7 11:27:01 EDT 2009


I have a custom reader that I am updating and all is going well
(thanks to all for help earlier) but I am having a problem
understanding how some values are computed.

When I load my data set and I look in the "Information" tab the X and
Y boundaries are correct but the z boundary is not correct. In fact it
is off by the z origin multiplied by the z spacing which I find odd
because the X & Y origins are correct. Even if I set a z origin to
Zero.

Some output from my reader:

MicronOriginVoi: 46979.1 48347.6
MicronSizeVoi: 1545.97 1731.28
CurrentScalingFactor: 0.207987 0.207987 1.2
PixelVOI: 0 7432 0 8322 490 491
PixelActual: 0 7440 0 8330 490 727
requestedExtent: 0 7432 0 8322 490 491

And I setup the vtkImageData like this:
output->SetSpacing(this->CurrentScalingFactor);
output->SetOrigin(this->MicronOriginVoi[0], this->MicronOriginVoi[1], 0.0 );
output->SetScalarType(VTK_TYPE_UINT8);
output->SetExtent(requestedExtent);
output->SetNumberOfScalarComponents( 1 );
output->AllocateScalars();
output->GetPointData()->GetScalars()->SetName("RoboMet Voxels");
output->GetPointData()->SetActiveScalars("RoboMet Voxels");

At this point the "Information" tab shows a Z Bounds of 588 to 589
(Delta 1.2). So the delta is correct but not the bounds. Also during
the RequestInformation method I have the following code:

double origin[3] = { this->MicronOriginVoi[0], this->MicronOriginVoi[1], 0.0  };
outInfo->Set( vtkDataObject::ORIGIN(), origin, 3 );

I am not really sure what I am doing wrong at this point.

_________________________________________________________
Mike Jackson                               mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net


More information about the ParaView mailing list