How to do cross section with free angle?

Slicer version: 4.10.2

How to use the slicer to do free-angle cross-section, not only the three anatomy planes?
How could I get the cross-section like the several cross-sections in blue planes?

Untitled
Thank you very much!

There are many options, for example:

  • Option A: Reformat module can be used to adjust angles of slice views using sliders
  • Option B: Show reslice widget in slice view and then adjust reslice plane in 3D views:

  • Option C: Use recent Slicer preview release, show slice intersections, and use Ctrl+Alt+Left-click-and-drag to rotate intersecting slice views around the slice intersection point.

Hi Andras,

Thank you very much for your help!

Could you please teach me which python package and API should I use to write python codes for getting multiple cross-sections automatically as desired?

I’m not sure what you mean. Would you like to show a number of slice views in a 3D view, rotated by different angles? What is the clinical application? Would you like to compute Cobb angle? Reslice the image along the spinal chord curve? …?

I would like to write codes in python, to get cross-sections just like the figure in my first post above.
I.e., for each vertebra, I would like to get four cross-sections.

Assume I assign an array of starting points for each vertebra along with four rotation angles, how can I write python codes to get cross-sections and save the images?

You can switch to a layout that has at least as many slice views as you need (e.g., “Four over four” built-in layout, or a custom layout that you specify), set the slice view positions/orientations by modifying the matrix returned by sliceNode.GetSliceToRAS(), and show the slice views in 3D. You can then switch to any layout, the slices will remain visible in 3D view.

There are lots of related examples in Slicer script repository.

Hi Iassoan,

I am able to manually control the reformat widget now. However, not accurate.

Could you please let me know what is the python function to program the position and angle of anatomy plane reformat widget?

Thank you very much!

As I wrote above, there are many examples of slice manipulations in the script repository, see for example, this.

1 Like

Hi Iassoan,

I found a existing module “Reformat”, which can do exactly what I want.
However, I was not able to find the source file in the Slicer installation folder.

I did a lot of search locally on the disk, and still cannot find the module find, even though I can run the module. :innocent:
It seems that the file of the link below is not in the installation folder. https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Reformat/qSlicerReformatModule.h

Could you please let me know where to find the souce file of module Reformat such that I can debug the module?

Thank you very much!

You can find all the source files in the same folder. It is a C++ module, which is compiled into a dynamically loadable library. The source files are not used at runtime and so they are not included in the install package.

Thank you for your help, Iassoan!
I figured out how to do it. :wink:

One last question, any link that demonstrated how to debug the C++ codes with Slicer API?

This topic should help. If you still have questions then let us know.

Hi,I also encountered the same problem, I also need to extract a certain angle of section. Can you tell me how you solved it?

Do these options work for you?

Since then we also added free slice rotation option by Ctrl/Cmd+Alt+Left-click-and-drag in slice views (around the slice intersection point, so you need to enable display of slice intersection in the toolbar, in the crosshair button’s drop-down menu).

You may also find “Valve view” module useful (provided by SlicerHeart extension), which allows rotating two orthogonal slice views around the plane normal of a third slice view.

If you want to reslice along a curve then you can use “Cross-section analysis” module (provided by SlicerVMTK extension).

You can find several examples for setting slice orientation from a Python script. If they don’t do what you want then let us know what you would like to achieve.


This is my image.The module "Extract Centerline " just only shows the mean diameter , and the module “Airway Inspector” just calculates one airway,but I want to calculate several pairs of inner radius and outer radius along the centerline.

The radius does not change much within a segment, so the mean value characterizes a branch quite well. But if you need more details then you can get the radius for each curve point from the output model node (stored in point data array).

What do you mean by inner and outer radius?

Is that? I will try it.
Inner and outer diameter are the output of the module “Airway Inspector” , represent the airway’s inner diameter and outer diameter which contains the thickness of the airway wall.

What do you mean by “the output model node (stored in point data array)”? I just find the ID and coordinates of every point in each curve.

How to create cross sectional view (dentistry)?

Hello Sir I have heard about you that you work with DICOM. I have a question. I have been stuck on this task for several months, but I am not understanding how to proceed. I work in dentistry, and I want to use the Python programming language to extract individual teeth from DICOM images, similar to what is shown in this gif. But sir, I am very distressed. I have tried creating sagittal, coronal, axial, and panoramic X-ray images, but I am unable to achieve this. I am not able to understand it. Please guide me. I am waiting for your response. Thank you.