<div>Hello...I really have problems&nbsp;visualizing this mask consisting of only 2 different values. Foreground and background. Is it even possible to show this in VTK.</div>
<div>Does anyone have a moment to help me out.</div>
<div>Thank you<br><br>&nbsp;</div>
<div><span class="gmail_quote">2006/10/14, Prename Surname &lt;<a href="mailto:bsd.diverse@gmail.com">bsd.diverse@gmail.com</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hello. I seem to have a small problem using the functions vtkPiecewiseFunction and vtkColorTransferFunction.</div>
<div>&nbsp;</div>
<div>I have a very simple mask consisting of values</div>
<div>background=-2949120<br>foreground= 2949030</div>
<div>&nbsp;</div>
<div>I just want to visualize this volume in vtk. I have defined the vtkPiecewiseFunction and vtkColorTransferFunction like this:</div>
<div>&nbsp;</div>
<div>
<div>unsigned short bg=-2949120;<br>unsigned short fg= 2949030;</div>
<div>
<p>//Create transfer mapping scalar value to color<br>vtkPiecewiseFunction *opacityTransferfunction=vtkPiecewiseFunction::New();<br>vtkColorTransferFunction *colorTransferFunction=vtkColorTransferFunction::New();</p>
<p>opacityTransferfunction-&gt;AddPoint(bg,0.0);<br>opacityTransferfunction-&gt;AddPoint(fg,1.0);</p>
<p>colorTransferFunction-&gt;AddRGBPoint(bg,0.0,0.0,0.0);<br>colorTransferFunction-&gt;AddRGBPoint(fg,1.,1.,1.);</p><font size="1"></font></div></div>
<div>But when i then run the program, the volume is just rendered as one solid gray cube. All I want to is to visualize the foreground in a certain color, and not show the background.</div>
<div>How do i do that? Am i missing something?</div>
<div>Many regards<font size="1"></font></div></blockquote></div><br>