[vtkusers] Image Rendering- raw float STD file

Luigi Laneve luigi_laneve at hotmail.com
Wed Apr 6 09:16:59 EDT 2011


Hi to all,
I'm trying to open in the correct way images in *.sdt format.
I know the following information about this binary file:
1) every pixel is a float;2) minimum value 0;3) maximum value: near 1.2 (it can varies from image to image);4) the geometry is 1092x1092;

I'm trying to open it with the following lines of code:
	imageReader= vtkImageReader::New();	imageReader->SetFileName(fileName.toStdString().c_str());			imageReader->SetDataByteOrderToLittleEndian();		imageReader->SetDataExtent(0,1091,0,1091,0,0);
		imageReader->SetDataScalarTypeToFloat(); // in order to read float values			vtkImageViewer* image_view = vtkImageViewer::New();	image_view->SetInputConnection(imageReader->GetOutputPort());
	// this : is a QVTKWidget	this->SetRenderWindow(image_view->GetRenderWindow());	image_view->SetupInteractor(this->GetRenderWindow()->GetInteractor());
	image_view->SetColorWindow(255.0);	image_view->SetColorLevel(1.0);
With this code i see a fully grey image; however i can obtain an image very similar to the original (see attached file) interacting via mouse with renderWindow.
I think that there's a problem with SetColorX methods; can you explain me the correct meaning of  SetColorWindow and SetColorLevel methods. I think that SetColorWindow(255.0) and SetColorLevel(1.0) map the 1.0 image Level to 255 (white) window level; is correct?
I would like to know how interactor varies the rendered image.
Thanks in advance,
Luigi

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110406/65df564c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Original-ImageJ-IMPORT.JPG
Type: image/jpeg
Size: 45286 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110406/65df564c/attachment.jpeg>


More information about the vtkusers mailing list