[vtkusers] vtkImageToStructuredPoints problem

Ali Hashimi benkasmi at yahoo.com
Wed Mar 30 10:11:44 EST 2005


Hi everybody

I am having a problem with vtkImageToStructuredPoints


when I instantiate an object of this class and pass
the vtkImageData object it causes a Segmentation
fault.

the image data is a 128x128x62  unsigned char
every unsigned char is a grayscale value representing
the density of the material.

does vtkImageToStructuredPoints handle RGB format
only.

I am using vtk 4.2 on Linux Fedora Core 3 running on
an AMD64.


here is the following piece of code

thanks in advance

/////////////////////////////////////




vtkImageData* imageData = vtkImageData::New();
	imageData->SetDimensions(dim[0], dim[1], dim[2]);
	imageData->SetScalarTypeToUnsignedChar();
	imageData->SetNumberOfScalarComponents(1);
	imageData->AllocateScalars();
	
	unsigned char* ptr = (unsigned
char*)imageData->GetScalarPointer();
	
	
	// read the bytes and push them into the data pointer
	
	...
	
	
	// make points from image data	
	// it is this code that caused the segmentation fault
	
	vtkImageToStructuredPoints *imageToPoints =
	vtkImageToStructuredPoints::New();
	imageToPoints->SetInput(imageData);
	
	vtkVolumeRayCastMapper* mapper =
vtkVolumeRayCastMapper::New();
	
	....
	...
	

/////////////////////////////////


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 



More information about the vtkusers mailing list