<div dir="ltr">You can use the LookupValue() member function, e.g.,<div><br></div><div>// Assuming vtkScalars is a subclass of vtkDataArray</div><div><span style="font-size:12.8000001907349px">minIndex = vtkScalars.LookupValue(minValue)</span><br></div><div><span style="font-size:12.8000001907349px">maxIndex = vtkScalars.LookupValue(maxValue)</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">This will do the scanning David mentioned and return (probably) the first index that matches the value you are querying.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">There is even a variant that puts all the IDs with the query value in a vtkIdList. See</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><a href="http://www.vtk.org/doc/release/6.2/html/classvtkDataArrayTemplate.html#aefa527440fb06df9da217831f2bf3704">http://www.vtk.org/doc/release/6.2/html/classvtkDataArrayTemplate.html#aefa527440fb06df9da217831f2bf3704</a></span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Hope that helps,</span></div><div><span style="font-size:12.8000001907349px">Cory</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 7, 2015 at 3:35 PM, David Cole via vtkusers <span dir="ltr"><<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">0 0 1 2 8 9 10 9 0 0 0 9 10 9 8 6 4 3 0 0<br>
<br>
What's the index of 10?<br>
<br>
:-P<br>
<br>
<br>
You'll have to scan looking for the first or last index, I think,<br>
since, in general, the min and max may occur any number of times in a<br>
data set.<br>
<br>
HTH,<br>
David C.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
On Tue, Jul 7, 2015 at 4:30 PM, mightos <<a href="mailto:mightos@gmail.com">mightos@gmail.com</a>> wrote:<br>
> Hello<br>
><br>
> Let's say I have a vtkScalars with 100000 values.<br>
> I would like to know the minimum and maximum values and their position in<br>
> the vtkScalars.<br>
><br>
> I currently use vtkScalars.GetRange()[0] to get the minimum value and<br>
> vtkScalars.GetRange()[1] for the maximum. However, I was wondering how I<br>
> could get the indexes from that.<br>
><br>
> Any help is welcome :)<br>
><br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://vtk.1045678.n5.nabble.com/How-to-get-the-IDs-of-min-and-max-from-a-GetRange-tp5732756.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/How-to-get-the-IDs-of-min-and-max-from-a-GetRange-tp5732756.html</a><br>
> Sent from the VTK - Users mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>