[vtkusers] vtkImageActor can't display for certain SetDisplayExtent
kdsfinger at gmail.com
kdsfinger at gmail.com
Wed Sep 6 02:07:17 EDT 2006
hi, all
I am following the example of Medical3. I read a stack image
(256x256x127, unsigned char png) from itk and passed to vtk. I checked
the vtkImageData, the values (size and pixel values) are all correct.
And here is the problem: it can only display with the
SetDisplayExtent(0,255, 0,255, z,z) (z set to 90~126 and everything
looks correct). It will display a pure blank white window if z sets
less than 90. Attached is the piece of my code mainly copyed from
Medical3.cxx. Thanks for comments.
zl2k
vtkImageMapToColors *axialColors = vtkImageMapToColors::New();
axialColors->SetInput(data);//vtkImageData
axialColors->SetLookupTable(hueLut);
axialColors->Update();
vtkImageActor *axial = vtkImageActor::New();
axial->SetInput(axialColors->GetOutput());
int p = (int)atoi(argv[1]);
axial->SetDisplayExtent(0,255, 0,255, p,p);
More information about the vtkusers
mailing list