[vtkusers] Error reading raw pgm data!

adceran adrianca88 at hotmail.com
Mon Sep 9 07:37:56 EDT 2013


Hello to everybody.

I'm trying to get a surface by using the vtkSliceCubes algorithm because I'm
working with large number of voxels (1000^3). I have readed that I need to
create a vtkVolume16Reader and then pass it to the vtkSliceCubes. I have
1000 slices of size 1000x1000 in format BMP that have been created using
OpenCV. In this slices, object is difined as a 255 pixel value and 0 for the
background pixel value. My images are located in DATA_DIR/slice_X.bmp. The
code that read the images is:

	vtkSmartPointer<vtkVolume16Reader> volumeReader =
vtkSmartPointer<vtkVolume16Reader>::New();
	std::stringstream filePrefix;
	filePrefix << DATA_DIR << "/slice_";
	volumeReader->SetFilePrefix(filePrefix.str().c_str());
	volumeReader->SetFilePattern("%s%d.bmp");
	volumeReader->SetDataOrigin(params.startX, params.startY, params.startZ);
	volumeReader->SetImageRange(0,1000);
	volumeReader->SetDataSpacing(params.voxelWidth, params.voxelHeight,
params.voxelDepth);
	volumeReader->SetDataDimensions(1000, 1000);
	volumeReader->SetDataByteOrderToLittleEndian();
	volumeReader->Update();

However, when I run this code I get the following error:

vtkVolume16Reader: Error reading raw pgm data!

I think that the problem is the format of the images, but I haven't found
documentation with image format specification. Example code is difficult to
find too.

Any suggestion is good received, a lot of thanks.
Adrian.





--
View this message in context: http://vtk.1045678.n5.nabble.com/Error-reading-raw-pgm-data-tp5723334.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list