<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Have you tried vtkDataArray::GetRange()?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><a href="https://www.vtk.org/doc/nightly/html/classvtkDataArray.html#a717568beffb50a7ddff9ed3919dcf153">https://www.vtk.org/doc/nightly/html/classvtkDataArray.html#a717568beffb50a7ddff9ed3919dcf153</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Computing range may take a long time on large data sets. GetRange() has an important feature that it caches the computed range and the value is also propagated
 through the processing pipeline.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Andras<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> vtkusers [mailto:vtkusers-bounces@vtk.org]
<b>On Behalf Of </b>Cory Quammen<br>
<b>Sent:</b> Monday, December 18, 2017 10:11 AM<br>
<b>To:</b> scotsman60 <doug@beachmailing.com><br>
<b>Cc:</b> vtkusers <vtkusers@vtk.org><br>
<b>Subject:</b> Re: [vtkusers] How to find range of data in Cell Scalar Array?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I'm not sure if there is something in VTK that does this, but the good news is you can use numpy to do it. See Berk's blog post series on VTK/numpy integration starting with <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fblog.kitware.com%2Fimproved-vtk-numpy-integration%2F&data=02%7C01%7Classo%40queensu.ca%7C9e44ae347d034dd9a79708d546298e0b%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636492066658759271&sdata=bo1AD39UpsmbDQrtzVsAswaqwGloD33ChgklbtqwJAQ%3D&reserved=0">https://blog.kitware.com/improved-vtk-numpy-integration/</a>.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">HTH,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Cory<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Sun, Dec 17, 2017 at 8:32 PM, scotsman60 <<a href="mailto:doug@beachmailing.com" target="_blank">doug@beachmailing.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hello,<br>
<br>
I'm using vtk in a Python app and I need to set parameters on a lookup table<br>
based on the range of values in an integer scalar array associated to Cells<br>
in a vtkUnstructuredGrid.<br>
<br>
I can access the array ,<br>
<br>
name = self.mesh.GetCellData().GetArrayName('PID')<br>
<br>
where self.mesh is my vtkUnstructuredGrid<br>
<br>
But how can I find the unique value sin this array?<br>
<br>
I need something like numpy.unique () - is there a vtk method available?<br>
<br>
Thanks in advance,<br>
<br>
<br>
Doug<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7C9e44ae347d034dd9a79708d546298e0b%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636492066658759271&sdata=MPzOr4k9tUJIWf31Hxefu8JTDFWlUUc215%2BqHjsba1s%3D&reserved=0" target="_blank">
http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br>
_______________________________________________<br>
Powered by <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C9e44ae347d034dd9a79708d546298e0b%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636492066658759271&sdata=6PzkUDGy%2BmGbm%2F6bEwpVvAUC7SsIRFkXlbMmwC5PI%2Bk%3D&reserved=0" target="_blank">
www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C9e44ae347d034dd9a79708d546298e0b%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636492066658759271&sdata=%2BcZHkAwRayN7hhA9Q%2FythlnRNhX0xKyJoq5ygDQ3Nks%3D&reserved=0" 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="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C9e44ae347d034dd9a79708d546298e0b%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636492066658759271&sdata=arBOCytrI9tUJHN9S3BD8TkAJoQtPfSXN051UAg3jeY%3D&reserved=0" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7C9e44ae347d034dd9a79708d546298e0b%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636492066658759271&sdata=a3Eu3ZqHZT7GKC%2FUZ%2Fg%2Fdr8b%2BgcAJUHFBM8xBziWPag%3D&reserved=0" target="_blank">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7C9e44ae347d034dd9a79708d546298e0b%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636492066658759271&sdata=woK52v%2FtkoGlaRe6yhJx%2FlHfmVmK2%2B1j8ivd5TYehFI%3D&reserved=0" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>