[vtkusers] How to Read *.pic file into vtk?????

Waltraud Henrich henrich at ira.uka.de
Thu Aug 8 04:52:33 EDT 2002


Hello, I want to load a pic file. I am trying to read using vtkImageReader.
It solved but I must enter the value for each file whit 
reader->SetData Extent(int,int,int,int,int,int). I have different files with
different dimensions.
The code I used like this: 

bool ImportImage::DoPICImage()
{
	vtkImageReader *reader = vtkImageReader::New();
	if (m_sFileName.right(4) != ".pic") 
		m_sFileName = m_sFileName + ".pic";
	reader->SetFileName((char*)m_sFileName.latin1());

	reader->SetDataExtent(0, 255, 0, 255, 0, 5); 
	reader->SetFileDimensionality(3);
	reader->Update();

	SetImageData(reader->GetOutput());

	GfxPrint(m_sFileName + " loaded"); 

	return GetImageData()!=NULL;
}



Thanks you in advance.

Waltraut



More information about the vtkusers mailing list