Rotating a implicit function called vtkCylinder

Hello everyone,
I am new to VTK and this forum. I just wanted to know if there is a solution to rotate an implicit function called vtkCylinder by 90 degrees. I would like to add the clip functionality in ModelClip extension and set it to the vtkCylinder implicit function. With vtkCylinderSource.h I have read that it is possible by translating the center and rotating by 90 degrees and translating back. Is there similar solution to achieve it?

You can transform nodes by applying a transformation node as shown here:

If you want to use this from a Python script then check out these examples: https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms#Examples

Thank you for your reply! But what I am trying to rotate the implicit function with header name vtkCylinder.h by 90 degrees. I already have assigned the center and the radius of the cylinder but I am editing a loadable module. I would like to clip a stl data in two parts around the center with this cylinder function. But I would have to rotate the cylinder by 90 degrees to get the clipping functionality right.

You can change orientation of a vtkCylinder implicit function by calling its SetAxis method.

Hey Andras,
Thank you very much! I did as you suggested and now it works. I would like to ask one more thing. I have clipped the stl data successfully. But now I am trying to rotate those clipped parts(one of them would be fine). It’d be really nice if you could give me some suggestions regarding it.

You can apply transform to the segmentation node. If you want to rotate individual segments but not others, then you can:

  • move the segments to a new segmentation node
  • apply a transform to the new segmentation node
  • move the segments back to the original segmentation node

Thank you will try and let you know!

A post was merged into an existing topic: Cannot find rectangle segmentation option