[vtkusers] Custom vtkImageData Reader Question

Herbert Mullens herbert.mullens at imts.us
Fri Feb 8 03:20:27 EST 2008


I am building a custom reader that outputs a vtkImageData object.  When I try to run the reader in a test program I get the following error:

Warning: In /Users/Shared/src/ParaView3/VTK/Filtering/vtkDataSet.cxx, line 414
vtkImageData (0xc11ce0): Point array RoboMet Voxels with 1 components, has 0 tuples but there are only -145742597 points

The following snippet of code is from the beginning of my RequestData method:

	output->SetScalarType(VTK_TYPE_UINT8);
	output->SetSpacing( this->DataSpacing );
	output->SetOrigin( this->DataOrigin );
	output->SetDimensions( x, y, z );
	output->AllocateScalars();	
	output->SetNumberOfScalarComponents( 1 );
	output->GetPointData()->GetScalars()->SetName("RoboMet Voxels");
	output->GetPointData()->SetActiveScalars("RoboMet Voxels");
	output->GetPointData()->GetScalars()->SetNumberOfTuples(x*y*z);
	output->AllocateScalars();

I am setting the number of tuples there and allocating, so why are there 0 tuples when the reader runs?  Is there something obvious I am not seeing?  Also, the data I am writing to the vtkImageData object is a stack of grayscale images that I am reading out of an HDF5 file.  In this case, does it matter how many points it says I have, or will that sort itself out when I get the correct number of tuples?

Thanks in advance for any help given,

Herb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080208/ccfa41a0/attachment.htm>


More information about the vtkusers mailing list