[vtkusers] Re: URGENT, PLEASE RESPOND: Getting Voxels from vtkImageData
Valerie R Coffman
valerie.coffman at nist.gov
Wed Jun 20 15:50:15 EDT 2007
Hi,
It sounds like what you want to do is somewhat similar to the Picker classes. I
have written a picker class for my own purposes, which picks the voxel you click
on (assuming you are using a mapper which places voxel (0,0,0) between (0,0,0)
and (1,1,1)). I found that none of the Picker classes did exactly this. Maybe
this code will be useful to you?
I'm attaching my VoxelPicker.py class. It's part of a work in progress, so
I'm not making any promises on how well it works....
Valerie
> Message: 5
> Date: Tue, 19 Jun 2007 21:14:45 -0400
> From: "Meisam Aliroteh" <meisam.aliroteh at gmail.com>
> Subject: [vtkusers] URGENT, PLEASE RESPOND: Getting Voxels from
> vtkImageData
> To: vtkusers at vtk.org
> Message-ID:
> <394c464d0706191814v2e4e33bdta4337841d02e9e7e at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi all,
>
> I've used vtkDICOMImageReader to load a set of DICOM images representing the
> MRI scan of the brain of a patient. I've resampled the images using AMIRA to
> get cubical voxels. There are 192 images in total, placed in a directory and
> using the SetDirectoryName() method of the vtkDICOMImageReader I've loaded
> all. The output that I get from vtkDICOMImageReader is vtkImageData and here
> is what I need to do:
>
> Given the coordinate of a point in the data set and a direction vector, is
> there a feature in vtk that can return to me the set of voxels in the data
> set starting at this point going along the direction vector? For example,
> let's say that my point is located at (0,0,0) and the direction vector is
> (0,0,1) and I'm interested in getting 10 voxels along this direction vector
> starting at the point. How can I do this (rather efficiently since it is
> going to be done for a lot of points)??
> Also, how can this be done if the point coordinates and the vector
> coordinates are not integer values ?? i.e starting at (0.25, 1.7, 0.33) and
> going along the direction vector (1.2, 3.2, 0.1)
>
> Thanks in advance for your replies
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
>
http://public.kitware.com/pipermail/vtkusers/attachments/20070619/79a02e5c/attachment-0001.htm
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: voxelpicker.py
Type: text/x-python
Size: 6554 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070620/b0ba1744/attachment.py>
More information about the vtkusers
mailing list