[vtkusers] Problem Image Reader/Viewer?

oliveira at alumni.deec.uc.pt oliveira at alumni.deec.uc.pt
Tue Jun 3 09:53:47 EDT 2003


Hi,

I have a file (binary) with a simple 7x7 matrix (integers 0-10), with no
header.
I want to display that data (as image), like we do in matlab.
I use that code and only have a black image.
How can I view that data?
Are there any diferent classes to use in this case not vtkImageReader or
Viewer?

Thanks.

vtkImageReader *imagedata = vtkImageReader::New();

imagedata->SetFileName(filename);
imagedata->SetDataOrigin(0.0,0.0,0.0);
imagedata->SetNumberOfScalarComponents(1);
imagedata->SetDataScalarType(imagedata->GetDataScalarType ());
imagedata->SetDataExtent(0,7,0,7,0,0);
imagedata->SetDataSpacing(1.0,1.0,1.0);

vtkImageViewer *viewer=vtkImageViewer::New();
viewer->SetInput(imagedata->GetOutput() );
viewer->Render();







More information about the vtkusers mailing list