[vtkusers] usage of vtkImageMapToWindowLevelColors
Frederik Van Broeckhoven
silvester.the.8th at gmail.com
Thu Jun 23 07:10:38 EDT 2005
I need a filter in my pipeline to adjust the colorwindow and -level of
some input image(s).
My first guess was to use the vtkImageMapToWindowLevelColors, but this
doesn't give the desired result. Window and level get changed, but the
resulting image is too dark.
Here's some code(JAVA) where I initialize the filter:
... /* source has type vtkImageData */
// source has scalar type double
// source has scalar type unsigned short
range = source.GetScalarRange();
window = range - range;
level = range + (window / 2.0);
windowLevelMapper = new vtkImageMapToWindowLevelColors();
* replacing SetOutputFormatToLuminance() by SetOutputFormatToRGB(),
gives the same result.
* using SetOutputFormatToLuminanceAlpha() gives th same result, but
with green colors.
* removing SetOutputFormatToLuminance() or replacing by
SetOutputFormatToRGBA(), gives nothing (black image).
anybody an idea?
thx in advance
More information about the vtkusers