[vtkusers] vtkImageReslice axes direction, based on a vtkPlane

Tijmen Klein T.R.Klein at student.rug.nl
Thu Sep 22 07:54:22 EDT 2011


As some extra information, since using the newest git version, I also get an
error when exiting my application: "a vtkShader2 object is being deleted
before ReleaseGraphicsResources() has been called.", this error is repeated
quite a few times.

Cheers,
Tijmen

On Thu, Sep 22, 2011 at 1:03 PM, Tijmen Klein <T.R.Klein at student.rug.nl>wrote:

> Hi David,
>
> This is exactly what I was looking for, thank you! Got the newest VTK
> version from git, compiled it and modified my program (using
> http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Python/ImageInteractorReslice.py as
> an example). vtkImageResliceMapper really makes a world of difference, and
> makes the slicing a lot easier.
>
> However, there is still one small issue for me. I would like to display
> this slice as if it was a 2D image. Would you have an idea how to do this?
> If I simply add the vtkImageSlice to my renderer, it shows up at the exact
> location of the cut (which is to be expected). I could set the camera
> position + focal point based on the origion and normal of the cutting plane,
> but I would like the slice to fill the whole viewport. The
> method  ResampleToScreenPixelsOn() seems to be designed to do this, using
> this however does not change a thing for me.
>
> Cheers,
> Tijmen
>
>
> On Wed, Sep 21, 2011 at 5:06 PM, David Gobbi <david.gobbi at gmail.com>wrote:
>
>> Hi Tijmen,
>>
>> If you are able to grab the devel version of VTK from git, your
>> best option is to use the new image rendering classes:
>> http://www.vtk.org/Wiki/VTK/Image_Rendering_Classes
>> The vtkImageResliceMapper has a method called SetSlicePlane(),
>> so all you have to do is set the image as the input, then set the
>> plane you want to slice with.  The mapper will do everything else.
>>
>>  - David
>>
>>
>> On Wed, Sep 21, 2011 at 3:42 AM, Tijmen Klein <T.R.Klein at student.rug.nl>
>> wrote:
>> > Hello Everyone,
>> > I have a volume that I cut off using a vtkPlane
>> > (volume->AddClippingPlane()), which works really well. But sometimes I
>> also
>> > need to show to cut itself. First I tried to use a vtkCutter for this,
>> the
>> > geometry of the output is fine, but the texture is incorrect.
>> > So I'm now used a vtkImageReslice, which gives the desired output.
>> However,
>> > the textured plane of the output does not always cover the whole area of
>> the
>> > vtkCutter. For example, see this
>> > image: http://dl.dropbox.com/u/27566470/slice_and_cut.png The red bar
>> > indicates the geometry of the vtkCutter, the blue plane is the slice of
>> the
>> > vtkImageReslice.
>> > How can I make sure that the output of vtkImageReslice covers the whole
>> > vtkCutter? I have the feeling that my current method is too complex. I
>> want
>> > an output that is equal to the output of creating a slice in Paraview.
>> > Cheers,
>> > Tijmen
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110922/fb3eea0e/attachment.htm>


More information about the vtkusers mailing list