[vtkusers] peoblem with getting a point or cell from vtkImageData
medo abdelmonem
abdelmonem76 at yahoo.com
Wed Mar 28 05:14:00 EDT 2007
Hi Everybody,
i'm operating on volume of type "vtkImageData" as an o/p of vtkVolume16Reader(or actually vtkDicomReader)....
i need to get the coordinate of a point in the volume. typically decided to use the method "GetPoint()".....but when i tried to use it this error appeared on vtk output window (or at least that's a part of it)
"error : requesting a point from an empty image"
i did everything to work this out....even reforming this "vtkImageData" to "vtkStructuredPoints" using "vtkCastToConcrete" class....but the same error reappeared...
here are some code snippets that illustrate how i got the vtk data and how i tried to get the point coordinates
//////////////////////////////////////////////////////////////////////////////////////
//Volume reader used to construct volume
vtkVolume16Reader v16 = new vtkVolume16Reader();
v16.SetDataDimensions(64, 64);
v16.SetDataByteOrderToLittleEndian();
v16.SetFilePrefix("D:/New Folder/vtk/vtkdata-5.0.2/VTKData/Data/headsq/quarter");
v16.SetImageRange(1, 93);
v16.SetDataSpacing(3.2, 3.2, 1.5);
//////////////////////////////////////////////////////////////////////////////////////
//an object of the class that Extract views....i pass the o/p of volume reader directly
// it's of vtkImageData type
Views N = new Views(v16.GetOutput(),v16.GetDataDimensions(),93);
//////////////////////////////////////////////////////////////////////////////////////
//here is the problem...when i try to get certain point (defined by its index)
//coordinates and pass the o/p of this method to a reference...AND HERE I GET THE
//ERROR
double [] x=Volume.GetPoint((32+2*64*64));
//////////////////////////////////////////////////////////////////////////////////////
thanks alot....and really sorry for your time....
---------------------------------
No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070328/6f3172d3/attachment.htm>
More information about the vtkusers
mailing list