[vtkusers] ImagePlaneWidget - Wrong Colors!

Dean Inglis dean.inglis at camris.ca
Mon Jul 5 12:40:52 EDT 2004


Istvan,

you may have to adjust the window/level for your data
which you can do either by right mouse button control 
or programmatically by, for example,  

double min = v16->GetOutput()->GetScalarRange()[0];
double max = v16->GetOutput()->GetScalarRange()[1];
double w = max - min;
double l = 0.5*(min + max);

vImagePlaneWidget[i]->SetWindowLevel(w, l);

If your data has sparse scalar values in the high
and/or low range, then the window/level calculation
above will not work very well and this is what
vtkImagePlaneWidget attempts as a best guess.
If you were to construct a histogram of your input
data, you would be better able to decide on a 
window/level setting.

Dean




More information about the vtkusers mailing list