<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Raul,<div><br></div><div>You can also get the range of values directly from the array that holds the intensity of the image (I call it "Intensity" here):</div><div><br></div><div>double i_range[2];</div><div>ImageData-&gt;GetPointData()-&gt;GetArray("Intensity")-&gt;GetRange(i_range);<br><br></div><div>-Eric</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div>------------------------------------------------------</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><span class="Apple-style-span" style="font-size: medium;"><br></span></div></span>
</div>
<br><div><div>On Jun 28, 2010, at 8:47 AM, John Fraser wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<div>Hi Raul,</div>
<div>&nbsp;</div>
<div>You could try using vtkImageAccumulator like this:</div>
<div>&nbsp;</div>
<div>vtkImageAccumulate acc = new vtkImageAccumulate();</div>
<div>acc.SetInput(imageReader.GetOutput());<br>acc.Update();<br>double[]&nbsp;max = acc.GetMax();</div>
<div>double[]&nbsp;min = acc.GetMin();</div>
<div>&nbsp;</div>
<div>John<br><br>&gt;&gt;&gt; Raúl Ferriz &lt;<a href="mailto:raul@torresyvalero.com">raul@torresyvalero.com</a>&gt; 28/06/2010 12:30:28 &gt;&gt;&gt;<br></div>
<div style="COLOR: #000000">El 28/06/2010 12:31, Raúl Ferriz escribió:<br>&gt; Is there an easy way to autobalance window-level on a dicom image?<br>&gt;<br>&gt; I have searched on vtk samples and google but I have not found how to <br>&gt; do this.<br>&gt;<br>&gt; I use an vtkImageViewer2 to display.<br>&gt;<br>&gt;<br>&gt; Many thanks.<br>What I need exactly is the way to get minimum and maximum value of the <br>input (imagedata). So I can manually compute and apply window level with <br>this two values. But I don't know to get this two values. Any advice?<br><br></div></div>_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br><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></blockquote></div><br></div></body></html>