[vtkusers] vtkVolumePicker

Richard Frank rickfrank at me.com
Thu Apr 21 22:19:46 EDT 2016


Hi David

I have a binary volume (thresholded from a gray volume).  The opacity transfer function sets 0 to transparent and 1.0 to opaque.

There are some noise areas and I've created an eraser tool so the user can erase some individual voxels.

Since the volume is mostly black, and I need to do computations on the non-zero voxels later, I first go through the volume k = 0  < kmax,  j = 0  < jmax x= 0 < xmax
and build a point list where each voxel != 0 has it's voxel ijk and pointId recorded. So I have a cursor.


When the user clicks, picker->GetPointIJK(ijk)  returns in one case 318 391 452.

but my cursor has

318 364 452
318 390 452 <------
319 307 88
319 308 88

And so I don't think the point is actually hit, so I don't erase it.

My ijk s are accurate - I presume - because I walk through the whole volume voxel by voxels to build the cursor.

This is a "close" match but others are off by 4 - 10 voxels (usually in the z direction).

I've tried doing a distance match based on the xyz coordinates (which I also record in my cursor) and that works the best so far, but, I still wind up with a lone pixel (or say a row or column of 4 - 5 pixels) that I can't do an inverse map to  - from the hit xyz to my ijk.

So it seems that the picker->ijk has some rounding or something going on that doesn't exactly match my precomputed ijk.

Any thoughts on how to accomplish what I want to do?

Thanks

Rick


On Apr 21, 2016, at 06:18 PM, David Gobbi <david.gobbi at gmail.com> wrote:

Hi Richard,

You'll have to lay out your methods in a bit more detail... you say that you need a way "reach all the voxels" in the volume, and I'm trying to wrap my head around what you mean by this.  Picking transparent voxels is obviously going to be impossible.  Ditto for picking any voxels that are surrounded by opaque voxels.  I'm not sure what you man by "small rows/columns" either... aren't all the rows and columns in the volume the same size?

 - David


On Thu, Apr 21, 2016 at 3:44 PM, Richard Frank <rickfrank at me.com> wrote:
Hi,

I'm having trouble reaching all ijk in a volume using the Volume Picker.

The computed ijk returned from the picker is in a few cases incorrect. I realize there are rounding issues and such, but I'm trying to pick a single voxel and I get back, say, 314,391,454 instead of 313,392,454 - in image coordinates, for example.

Most often it is fine - it's just in some cases there are small rows / columns that are unreachable. Anyone have any advice on this? I assume it's some sort of fractional voxel issue but I need to find a way to reach all the voxels. I've tried setting the tolerance but it's unclear if that's really the issue....


Thanks

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160422/f50884f5/attachment.html>


More information about the vtkusers mailing list