[vtkusers] image with variable spacing

Miro Drahos mdrahos at robodoc.com
Tue Nov 19 16:11:26 EST 2013


Hi David,
I have put together the vector of vtkImageResliceMapper's coupled with 
vtkImageSlice's and they work great! Thank you so much for contributing 
these classes! Slicing at the camera focal plane is super convenient and 
really fast.
I do see clipping that happens at certain angles; I attached a couple 
screenshots to illustrate the problem. The *Clipped.png shot shows the 
clipping in the lower left and upper right corner; I have a feeling it 
may have to do with how the actor's bounds are calculated, but I am not 
sure how to fix this.
Do you have an idea on how to remediate this?
Thank you tons once again!
Miro


On 11/19/2013 11:28 AM, Miro Drahos wrote:
> Hi David,
> thank you very much for the valuable input.
> I think I will follow your advice and go with a vector of
> vtkImageResliceMappers, and roll my own reslice widget. It sounds like a
> much cleaner solution than what I have done so far (vectors of reslice
> cursors, reps and widgets, with much of the interaction code rewritten
> to suite my needs).
>
> Thank you also for the pointer on how to fill the gaps; I was wondering
> what would be the best way to do this so that objects behind the plane
> don't "shine through" the gaps.
> Best,
> Miro
>
>
> On 11/19/2013 08:31 AM, David Gobbi wrote:
>> Hi Miro,
>>
>> There is no easy way to work with images that have variable sampling.
>> You will almost certainly have to create your own widgets in order to
>> get the kind of user interaction that you are looking for.  However, I
>> have some suggestions on how to at least get the data to render
>> properly:
>>
>> 1) You will definitely need to use one vtkImageData object per
>> segment, given the restrictions on vtkImageData.
>>
>> 2) Likewise, each segment will need to have its own mapper (I suggest
>> using the vtkImageResliceMapper, but of course I'm biased towards it
>> because I wrote it).
>>
>> 3) The mappers for each segment will have to be synchronized to each
>> other.  For vtkImageResliceMapper, this can be done by using the same
>> SlicePlane for all the mappers, or alternatively by using
>> SliceAtFocalPoint/SliceFacesCamera and controlling the slicing via the
>> camera position and focal point.
>>
>> 4) You will have to fill in the gaps between the segments.  One
>> quick-and-dirty way of doing this with vtkImageResliceMapper is to
>> call SetBorder(1) to slightly extend the rendered bounds of the image.
>>
>> As I mentioned in my first paragraph, none of this will work with
>> vtkResliceCursorWidget, you'd have to write your own user interaction
>> code.
>>
>>     David
>>
>>
>> On Tue, Nov 19, 2013 at 12:46 AM, Miroslav Drahos <MDrahos at robodoc.com> wrote:
>>> Hi,
>>> I am working with medical image (a 3D volume) that consists of several segments with different spacing in z-direction. I was hoping to get an opinion on how to work with this data; I need to be able to visualize it all at once, and reslice it at arbitrary direction.
>>> One quite natural idea was to resample the image and then work with it as one vtkImageData object, use vtkResliceCursorWidget on it, etc. However, the origin of the individual image segments changes too, and the gap between them is not an integer multiple of z-resolution, so I can't fit an integer number of (empty) slices between the segments, and the origin will be shifted.
>>> The other idea that I am about to implement is to store a vector of images, and dynamically re-plug the reslice cursor to the segment that it is currently on, and have multiple representations that would copy their parametric plane representation from the active on and display several planes with their own textures.
>>> But it just seems so clumsy, and makes me feel there must be a more elegant and efficient solution.
>>> I have seen vtkRectilinearGrid, but that cannot be plugged into a reslice cursor.
>>>
>>> Anybody has an idea of how to work with such data?
>>> Thank you very much,
>>> Miro
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: combinedImgsClipped.png
Type: image/png
Size: 28237 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131119/5615a37b/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: combinedImgs.png
Type: image/png
Size: 27014 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131119/5615a37b/attachment-0001.png>


More information about the vtkusers mailing list