[vtkusers] help!!imageview

Jeremy Winston winston at cat.rpi.edu
Tue Mar 4 09:26:50 EST 2003


zhao yong qiang wrote:
> Hi,all
>     I  am a new user of VTK. The enviroment is MSVC + VTK+ ITK for win2000.
>     In MSVC, I write the following code:
> 
>     vtkBMPReader* reader = vtkBMPReader::New(); 
>     reader->SetFileName(BMP file path);
>     vtkImageViewer* viewer = vtkImageViewer::New();
>     viewer->SetInput(reader->GetOutput());
>     viewer->SetSize(256,256);
>     viewer->Render();

>From the vtk "Histogram.tcl" example:

    vtkImageViewer viewer2
      viewer2 SetInput [magnify GetOutput]
      viewer2 SetZSlice 14
      viewer2 SetColorWindow 2000
      viewer2 SetColorLevel 1000
    [...]

Perhaps you need to set your color window and level?
Window is the range of pixel values;
level is the center of the range.

HTH,
-Jeremy





More information about the vtkusers mailing list