<div dir="ltr">You can do that by calling getPoint(idx) on the image data based on it's index. <div><br></div><div>idx = i + j * dims[0] + k * dims[0] * dims[1]</div><div><br></div><div>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.</div><div><br></div><div>HTH,</div><div><br></div><div>Seb</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 17, 2019 at 11:56 AM Andrzej Marciniak <<a href="mailto:marciniak.andrzej.zg@gmail.com">marciniak.andrzej.zg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi All,<br>
<br>
My question is: for a given IJK data cell position in vtkImageData, how can<br>
I get access to:<br>
- voxel value,<br>
- voxel bounds (position of all 8 vertices of a voxel)<br>
- all voxels belonging to a given vtkImageSlice.<br>
<br>
More detailed description of why I need this: <br>
I am working on a tool for annotations and segmentations of MRI images using<br>
vtk.js with vtkImageData to represent MRI volume. I tried to use<br>
vtkImageSlice for both original image (grayscale) and overlay (color), but<br>
since there is no transparency for background voxels in vtkImageSlice (i.e.<br>
there is opacity property but no alpha), I had to use a different approach. <br>
<br>
Now, I am using "my own" transparent canvas as segmentation/annotation layer<br>
and vtkImageSlice to represent original image. <br>
To establish position of annotation I use picker. Using <br>
- picker.getPickedPositions()[0] <br>
- picker.getCellIJK() <br>
I can get both world position and cell position for a picked point. This<br>
works great, including interactions like zooming, pan, windowlevel, slicing<br>
etc. (see picture).<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/t342677/annotationTool.png" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/file/t342677/annotationTool.png</a>> <br>
<br>
However, I would like to draw on my canvas not only points (as in the<br>
picture), but also full rectangles covering voxels. To do that I need to<br>
know position of 4 vertices of voxel in a given plane and its value (I want<br>
to mark it with different color regarding the value).<br>
<br>
Thanks<br>
Andrzej<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div>