[vtkusers] Reslice an image with a stencil using a dataset.

David Gobbi david.gobbi at gmail.com
Thu Feb 17 14:51:06 EST 2011


Hi Vincent,

If I understand your question, there are probably two ways to achieve this.

You can use vtkImplicitDataSet to convert your data into an implicit
function, and then use vtkImplicitFunctionToImageStencil.  The latter
has a SetThreshold() method, anything below the threshold will be
considered to be background.

Or, you can use vtkContourFilter to generate a contour surface (as a
vtkPolyData) from your data.  Then, the vtkPolyDataToImageStencil
filter can generate a stencil.

The stencil-generation classes have a SetInformationInput() method
that you must use to provide an image that has the dimensions of the
stencil that you want to create.

 - David

On Thu, Feb 17, 2011 at 12:43 PM, vlibertiaux <vlibertiaux at gmail.com> wrote:
>
> Hello everyone,
>
> I am new to vtk and I have to work on an existing project.
> I would like to create a function that clips an imagedata according to a
> dataset (a volume representing a hexaedral finite element).
>
> The code can be found at http://codepad.org/DZXg4sxd
>
> I am pretty sure I have to transform the "world" coordinates of the clipping
> volume into image coordinates;
> I have been looking for a member function of the vtkdataset class but found
> nothing till now.
>
> I really need to use a background value to exclude the value that are inside
> the bouding box enclosing the finite element but are not within it.
>
> Could you please provide me any help with this problem ?
>
> Thank you very much,
>
> Vincent
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Reslice-an-image-with-a-stencil-using-a-dataset-tp3390074p3390074.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>



More information about the vtkusers mailing list