<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>

<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>[vtkusers] usage of vtkImageMapToWindowLevelColors</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText55261 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>vtkImageViewer also supports 
these methods, you might use the viewer to learn the level and window parameters 
that give the best result.</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Van:</B> 
vtkusers-bounces+wouter.cuypers=ua.ac.be@vtk.org namens Frederik Van 
Broeckhoven<BR><B>Verzonden:</B> do 6/23/2005 1:10<BR><B>Aan:</B> 
vtkusers@vtk.org<BR><B>Onderwerp:</B> [vtkusers] usage of 
vtkImageMapToWindowLevelColors<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Hi,<BR><BR>I need a filter in my pipeline to adjust the 
colorwindow and -level of<BR>some input image(s).<BR>My first guess was to use 
the vtkImageMapToWindowLevelColors, but this<BR>doesn't give the desired result. 
Window and level get changed, but the<BR>resulting image is too 
dark.<BR><BR>Here's some code(JAVA) where I initialize the filter:<BR><BR>... /* 
source has type vtkImageData */<BR><BR>// source has scalar type 
double<BR>source.Update();<BR>// source has scalar type unsigned short<BR>range 
= source.GetScalarRange();<BR>window = range[1] - range[0];<BR>level = range[0] 
+ (window / 2.0);<BR><BR>windowLevelMapper = new 
vtkImageMapToWindowLevelColors();<BR>windowLevelMapper.SetOutputFormatToLuminance();<BR>windowLevelMapper.SetInput(source);<BR><BR>windowLevelMapper.SetWindow(window);<BR>windowLevelMapper.SetLevel(level);<BR>...<BR><BR>* 
replacing SetOutputFormatToLuminance() by SetOutputFormatToRGB(),<BR>gives the 
same result.<BR>* using SetOutputFormatToLuminanceAlpha() gives th same result, 
but<BR>with green colors.<BR>* removing SetOutputFormatToLuminance() or 
replacing by<BR>SetOutputFormatToRGBA(), gives nothing (black 
image).<BR><BR>anybody an idea?<BR><BR>thx in 
advance<BR>S.<BR>_______________________________________________<BR>This is the 
private VTK discussion list.<BR>Please keep messages on-topic. Check the FAQ at: 
<A 
href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>Follow 
this link to subscribe/unsubscribe:<BR><A 
href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR></FONT></P></DIV>

</BODY>
</HTML>