[vtkusers] image with variable spacing

Miro Drahos mdrahos at robodoc.com
Tue Nov 19 14:28:11 EST 2013


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



More information about the vtkusers mailing list