[vtkusers] How to use vtkVolume16Reader->GetImage

Ma Qianli ma_nju at hotmail.com
Sat Aug 9 22:34:59 EDT 2003


Hi, all

I'm using vtkVolume16Reader to read the images in 
$VTK_DATA_DIR/Data/headsq.
Here is my reader program:

    vtkVolume16Reader *v16 = vtkVolume16Reader::New();
    v16->SetDataDimensions (64, 64);
    v16->SetImageRange (1, 93);
    v16->SetDataByteOrderToLittleEndian();
    v16->SetFilePrefix ("VTKData/Data/headsq/quarter");
    v16->SetDataSpacing (1, 1, 3);

Then I want to display each image on user's request:

    vtkImageViewer *imageViewer = vtkImageViewer::New();
    imageViewer->SetInput(v16->GetOutput());
    imageViewer->SetZSlice(Index);
    imageViewer->Render();

That's ok, and exactly what I want.
But I want the program more simple, so I implemented this function as:

    vtkImageViewer *imageViewer = vtkImageViewer::New();
    imageViewer->SetInput(v16->GetImage(Index));
    imageViewer->Render();

This time I got a image of noise!
Does anybody have any idea on this problem?
Did I use vtkVolume16Reader->GetImage in a wrong way?

Thanks in advance!

Ma Qianli
Nanjing University

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  




More information about the vtkusers mailing list