<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On May 9, 2011, at 1:50 PM, David Gobbi wrote:</div><div><div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Nicolas,<div><br></div><div>If you provide the new text that you would like to see in the documentation, I can modify the file and commit the change.</div><div><br></div><div> - David</div><div> <br><br><div class="gmail_quote">

On Mon, May 9, 2011 at 11:29 AM, Nicolas Rannou <span dir="ltr"><<a href="mailto:Nicolas_Rannou@hms.harvard.edu">Nicolas_Rannou@hms.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">

<div style="word-wrap:break-word">Thanks David, <div><br></div><div>yes such a feature to get the scalar range over all the components would be nice.</div><div>Maybe we should also update the documentation (<a href="http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a9c8f06877f41b3e1944f2d10281083a6" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkDataSet.html#a9c8f06877f41b3e1944f2d10281083a6</a>).</div></div></blockquote></div></div></blockquote><div><br></div><div>What about:</div><div><br></div><blockquote type="cite"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "><div style="word-wrap:break-word">

<div><br></div><div><span style="font-family:'Lucida Grande', Verdana, Geneva, Arial, sans-serif;font-size:12px"><div style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(168, 184, 217); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(168, 184, 217); border-right-width: 1px; border-right-style: solid; border-right-color: rgb(168, 184, 217); padding-top: 6px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; color: rgb(37, 53, 85); font-weight: bold; background-color: rgb(226, 232, 242); position: static; z-index: auto; background-repeat: repeat no-repeat; ">

<table style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; white-space: nowrap; font-weight: bold; margin-left: 6px; position: static; z-index: auto; "><tbody><tr><td style="white-space:nowrap;font-weight:bold;margin-left:6px">

virtual void vtkDataSet::GetScalarRange</td><td>(</td><td style="white-space:nowrap">double </td><td style="color:rgb(96, 32, 32);white-space:nowrap"><em style="font-style:normal">range</em>[2]</td><td>)</td><td><code>[virtual]</code></td>

</tr></tbody></table></div><div style="font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(168, 184, 217); border-left-width: 1px; border-left-style: solid; border-left-color: rgb(168, 184, 217); border-right-width: 1px; border-right-style: solid; border-right-color: rgb(168, 184, 217); padding-top: 2px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; background-color: rgb(251, 252, 253); border-top-width: 0px; position: static; z-index: auto; "><p style="font-family:'Lucida Grande', Verdana, Geneva, Arial, sans-serif;font-size:12px">Convenience method to get the range of the scalar data (if there is any scalar data). Returns the (min/max) range of combined point and cell data <font class="Apple-style-span" color="#FF1924">first component (if the dataset attributes have multiple components)</font>. If there are no point or cell scalars the method will return (0,1). Note: Update needs to be called to create the scalars. THIS METHOD IS THREAD SAFE IF FIRST CALLED FROM A SINGLE THREAD AND THE DATASET IS NOT MODIFIED</p>

<div><br></div></div></span></div><div><br><div><div>To  highlight that it computes the scalar range on the first component?</div><div><br></div><div>Thanks!</div><div><br></div><font color="#888888"><div>Nicolas</div></font><div>

<div></div><div class="h5"><div><br></div><div>On May 7, 2011, at 5:25 PM, David Gobbi wrote:</div><br><blockquote type="cite"><div>The only way that I know of is to get the range directly from the scalars,<br><br>double range[2];<br>

data->GetPointData()->GetScalars()->GetRange(range, component);<br><br>Personally, I would not be opposed to changing vtkDataSet::ComputeRange()<br>so that it computed the range over all components.<br><br>  David<br>

<br><br>On Sat, May 7, 2011 at 1:37 PM, Nicolas Rannou<br><<a href="mailto:Nicolas_Rannou@hms.harvard.edu" target="_blank">Nicolas_Rannou@hms.harvard.edu</a>> wrote:<br><blockquote type="cite">Hi David,<br></blockquote>

<blockquote type="cite"><br></blockquote><blockquote type="cite">Thanks for the clarification.<br></blockquote><blockquote type="cite">Which is the best practice to get the scalar range of each component then?<br></blockquote>

<blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On May 6, 2011, at 5:53 PM, David Gobbi wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">

<blockquote type="cite">Hi Nicolas,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The GetScalarRange() method computes the scalar range of the first component.<br>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">- David<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Fri, May 6, 2011 at 3:00 PM, Nicolas Rannou<br></blockquote></blockquote>

<blockquote type="cite"><blockquote type="cite"><<a href="mailto:nicolas_rannou@hms.harvard.edu" target="_blank">nicolas_rannou@hms.harvard.edu</a>> wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite">Hello,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite">I'm experiencing a strange behavior in VTK which might be a bug.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">It took me a while to locate the issue:<br>

</blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">

if I create a LUT with a NULL red component:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  iRed = 0;<br></blockquote></blockquote></blockquote><blockquote type="cite">

<blockquote type="cite"><blockquote type="cite">  iGreen = 255;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  iBlue = 255;<br></blockquote></blockquote>

</blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  iAlpha = 255;<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  double iRange[2] = {0, 255};<br>

</blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">

  vtkSmartPointer<vtkLookupTable> lut =<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">      vtkSmartPointer<vtkLookupTable>::New();<br></blockquote>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  double* HSV = vtkMath::RGBToHSV(iRed,iGreen,iBlue);<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite">  lut->SetAlpha(iAlpha);<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  lut->SetHueRange(HSV[0], HSV[0]);<br></blockquote>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  lut->SetSaturationRange(1, 1);<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite">  lut->SetValueRange(0, 1);<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  lut->SetRange(iRange);<br></blockquote></blockquote>

</blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  lut->Build();<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br>

</blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I color my image with this LUT:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  vtkSmartPointer<vtkImageMapToColors> coloredImage =<br></blockquote></blockquote>

</blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">      vtkSmartPointer<vtkImageMapToColors>::New();<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite">  coloredImage->SetLookupTable(iLUT);<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  coloredImage->SetInput( iImage );<br>

</blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  coloredImage->PassAlphaToOutputOff();<br></blockquote></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">  coloredImage->SetOutputFormatToRGB();<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  coloredImage->Update();<br></blockquote>

</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">then:<br>

</blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">  double* range = coloredImage->GetOutput()->GetScalarRange();<br></blockquote></blockquote></blockquote>

<blockquote type="cite"><blockquote type="cite"><blockquote type="cite">returns [0,0].<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">then everything I do with this image is messed up...<br>

</blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">

If iRed != 0, the scalar range of the "coloredImage" will be correct then my<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">pipeline is working.<br>

</blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">

Am I doing something wrong?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite">Thanks,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">

<blockquote type="cite">Nicolas<br></blockquote></blockquote></blockquote></div></blockquote></div></div></div><br></div></div></blockquote></div><br></div>
</blockquote></div><br></div></body></html>