[vtkusers] intersection of line with bounding-box

Oliver Weinheimer mail at oliwe.com
Wed Oct 19 09:02:33 EDT 2005


Hi all,

i have imported data from an C++-array.
What is the best way for calculating the intersection points of a line
with the bounding-box of the imported volume. At the moment i'm using
the class vtkCellLocator, see the code below  - i think, there must be a
better way ....
    
regards
Oliver

---

unsigned long int size = rows*cols*slices;
volumeValues = new float[size];
...
importer = vtkImageImport::New();
importer->SetWholeExtent(0,cols-1,0,rows-1,0,slices-1);
importer->SetDataSpacing (volume_res,volume_res,volume_res);
importer->SetDataExtentToWholeExtent();
importer->SetDataOrigin(volume_origin[0],
                          volume_origin[1],
                          volume_origin[2]);
importer->SetDataScalarTypeToFloat();
importer->SetImportVoidPointer(volumeValues);
...
cellLocator = vtkCellLocator::New();
cellLocator->SetDataSet((vtkDataSet*)importer->GetOutput());
cellLocator->CacheCellBoundsOn();
cellLocator->SetTolerance(0.0);
cellLocator->AutomaticOn();
cellLocator->BuildLocator();
...
cellLocator->IntersectWithLine(...)

---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mail.vcf
Type: text/x-vcard
Size: 261 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051019/e343905d/attachment.vcf>


More information about the vtkusers mailing list