[vtkusers] Cut/Paste region of vtkImageData defined by a contour

David Gobbi david.gobbi at gmail.com
Wed Sep 17 14:29:29 EDT 2014


On Wed, Sep 17, 2014 at 12:01 PM, Najzero <adrian.gabriel at 4plus.de> wrote:
>
> Well, yes I am stuck at VTK 5.6 most likely ( thats why I started to patch
> some files by hand ) as the whole project used own classes for... everything
> ( rendermanager, windowmanger, widget... ).
> If any api changed ( and they did... like the good old SetInput() in some
> cases ) I will fall neck deep into [censored].

I strongly suggest that you upgrade to at least VTK 5.10, otherwise a lot of
advice that I give you will be useless.  VTK 5.6 was so long ago that I can't
even remember what features it does or doesn't have.


> I already had the Origin/Spacing/Extend inside my code and took them from
> the vktImageData ( hoping it was correct ).
> As you said, vtkPolyDataToImageStencil will not work for me as I dont have a
> closed surfce ( damn it, I thought so, as it got improved alot with later
> versions where I used it once ).. so I am afraid I have to ask.
>
> Can I form one closed surface by myself?
> vtkDelauny(3d?) and vtkSurfaceReconstructionFilter comming to mind - the old
> programmer was so nice to ensure some things about the "self genius
> programmed contour".

The what?  Anyway, no, neither delaunay or vtkSurfaceReconstructionFilter are
the right approach.  You can use vtkLinearExtrusionFilter to convert a contour
into a surface (though the surface won't be closed).

What you are attempting to do will be very messy with VTK 5.6.  Either upgrade
to a newer VTK, or at least backport vtkPolyDataToImageStencil and related
classes from VTK 5.10.

 - David


More information about the vtkusers mailing list