<div dir="ltr"><div>Hi everybody,<br>Once I retrieve the list of points (IDs) in an octree region/octant, by coding<br><br>vtkIdTypeArray* points = octree->GetPointsInRegion(i);<br><br>I'd like to know the scalar voxel value (0 or 1 since the image is binary) of every point in the "points" array.<br></div><div>I've tried with "points->GetValue(iterator)" and with "points->GetTuple1()" but the result is not the expected.<br></div><div><br></div><div>Please, does someone know what I should I do or what am I doing wrong?<br><br></div><div>Sincerely, thank you very much.<br></div><div>Regards<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-09 23:49 GMT+02:00 Francisco Lopez de la Franca <span dir="ltr"><<a href="mailto:franciscolopezdelafranca@gmail.com" target="_blank">franciscolopezdelafranca@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi again,<div><span style="font-size:15px">Could anybody tell what is the difference between vtkoctreepointlocator and vtkhyperoctree? I am using the former for ceating an octree from an image, but i donot know which one is the best. My intention is mainly to know how many points there are per octant.</span></div><span class="im HOEnZb"><div>Thank you very much.</div><div>My best regards.</div></span><div class="HOEnZb"><div class="h5"><div><br>El miércoles, 3 de junio de 2015, Francisco Lopez de la Franca <<a href="mailto:franciscolopezdelafranca@gmail.com" target="_blank">franciscolopezdelafranca@gmail.com</a>> escribió:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Thanks a lot.<br>
And is there an example on how to traverse the whole octree? I mean, i would like to know how many points there are per octant.<br>
And finally, independently on the image, if i create an octree with a fixed level, will the representation be the same? I mean, the same number of octants with the same distribution independently on the image?<br>
Thank you very much.<br>
My best regards.</p>
<div class="gmail_quote">El 03/06/2015 15:36, "Bill Lorensen" <<a>bill.lorensen@gmail.com</a>> escribió:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This example may help:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/OctreeVisualize" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/DataStructures/OctreeVisualize</a><br>
<br>
<br>
On Wed, Jun 3, 2015 at 8:48 AM, Francisco Lopez de la Franca<br>
<<a>franciscolopezdelafranca@gmail.com</a>> wrote:<br>
> Hi.<br>
> I've created an example (see below) but everything is OK except that the<br>
> output image is not created. I'd be very pleased if someone can help me<br>
> (maybe with an explanatory example or whatever).<br>
><br>
>     char* filename = new char[255];<br>
>     strcpy(filename, "nifti_image.nii");<br>
><br>
>     vtkSmartPointer<vtkNIFTIImageReader> reader =<br>
> vtkSmartPointer<vtkNIFTIImageReader>::New();<br>
><br>
>     reader->SetFileName(filename);<br>
>     reader->Update();<br>
><br>
>     //Create the octree<br>
>     vtkSmartPointer<vtkOctreePointLocator> octree =<br>
> vtkSmartPointer<vtkOctreePointLocator>::New();<br>
>     octree->SetDataSet((vtkDataSet*) reader->GetOutput());<br>
>     octree->BuildLocator();<br>
><br>
>     std::cout << "Number of cells in tree: " <<<br>
> octree->GetDataSet()->GetNumberOfCells() << std::endl;<br>
>     std::cout << "Number of points in tree: " <<<br>
> octree->GetDataSet()->GetNumberOfPoints() << std::endl;<br>
><br>
>     char* outfile = new char[255];<br>
>     strcpy(outfile, "OcTree.vtp");<br>
><br>
>     vtkSmartPointer<vtkXMLPolyDataWriter> writer =<br>
> vtkSmartPointer<vtkXMLPolyDataWriter>::New();<br>
>     writer->SetInputData((vtkPolyData*) octree->GetDataSet());<br>
>     writer->SetFileName(outfile);<br>
>     writer->Write();<br>
><br>
><br>
> 2015-05-29 12:40 GMT+02:00 Francisco Lopez de la Franca<br>
> <<a>franciscolopezdelafranca@gmail.com</a>>:<br>
>><br>
>> Hi everybody,<br>
>> I'd like to represent a 3D image as a fixed number of cubes, I mean,<br>
>> something like a spatial occupancy matrix in 3D.<br>
>><br>
>> Could you, please, recommend me a fast way to do it or does it exist  a<br>
>> data structure in VTK to achieve this?<br>
>><br>
>> I've found the OcTree structure but I donot know if it is valid for this.<br>
>><br>
>> Thank you very much.<br>
>> My best regards.<br>
>> /Francisco<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" 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" 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" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
><br>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</blockquote></div>
</blockquote></div>
</div></div></blockquote></div><br></div>