<div dir="ltr"><div>Hi.<br></div>I've created an example (see below) but everything is OK except that the output image is not created. I'd be very pleased if someone can help me (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 = vtkSmartPointer<vtkNIFTIImageReader>::New();<br><br> reader->SetFileName(filename);<br> reader->Update();<br><br> //Create the octree<br> vtkSmartPointer<vtkOctreePointLocator> octree = vtkSmartPointer<vtkOctreePointLocator>::New();<br> octree->SetDataSet((vtkDataSet*) reader->GetOutput());<br> octree->BuildLocator();<br><br> std::cout << "Number of cells in tree: " << octree->GetDataSet()->GetNumberOfCells() << std::endl;<br> std::cout << "Number of points in tree: " << octree->GetDataSet()->GetNumberOfPoints() << std::endl;<br><br> char* outfile = new char[255];<br> strcpy(outfile, "OcTree.vtp");<br><br> vtkSmartPointer<vtkXMLPolyDataWriter> writer = vtkSmartPointer<vtkXMLPolyDataWriter>::New();<br> writer->SetInputData((vtkPolyData*) octree->GetDataSet());<br> writer->SetFileName(outfile);<br> writer->Write();<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-29 12:40 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"><div dir="ltr"><div><div><div><div>Hi everybody,<br></div>I'd like to represent a 3D image as a fixed number of cubes, I mean, something like a spatial occupancy matrix in 3D.<br><br></div>Could you, please, recommend me a fast way to do it or does it exist a data structure in VTK to achieve this?<br><br></div><div>I've found the OcTree structure but I donot know if it is valid for this.<br></div><div><br></div><div>Thank you very much.<br></div>My best regards.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">/Francisco<br></font></span></div>
</blockquote></div><br></div>