[vtkusers] Access to Cells in VTK.js
sebastien.jourdain at kitware.com
Thu Jan 17 15:49:29 EST 2019
You can do that by calling getPoint(idx) on the image data based on it's
idx = i + j * dims + k * dims * dims
for the ijk of the points. You can easily convert from the ijk of a cell to
the ijk of the point. based on which corner you want.
On Thu, Jan 17, 2019 at 11:56 AM Andrzej Marciniak <
marciniak.andrzej.zg at gmail.com> wrote:
> Hi All,
> My question is: for a given IJK data cell position in vtkImageData, how can
> I get access to:
> - voxel value,
> - voxel bounds (position of all 8 vertices of a voxel)
> - all voxels belonging to a given vtkImageSlice.
> More detailed description of why I need this:
> I am working on a tool for annotations and segmentations of MRI images
> vtk.js with vtkImageData to represent MRI volume. I tried to use
> vtkImageSlice for both original image (grayscale) and overlay (color), but
> since there is no transparency for background voxels in vtkImageSlice (i.e.
> there is opacity property but no alpha), I had to use a different
> Now, I am using "my own" transparent canvas as segmentation/annotation
> and vtkImageSlice to represent original image.
> To establish position of annotation I use picker. Using
> - picker.getPickedPositions()
> - picker.getCellIJK()
> I can get both world position and cell position for a picked point. This
> works great, including interactions like zooming, pan, windowlevel, slicing
> etc. (see picture).
> However, I would like to draw on my canvas not only points (as in the
> picture), but also full rectangles covering voxels. To do that I need to
> know position of 4 vertices of voxel in a given plane and its value (I want
> to mark it with different color regarding the value).
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the VTK FAQ at:
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers