What is the method to draw Structure of Slicer Rt?

Hi, I am working with MR DICOM files and RT Structure.

I want to see DICOM and RT Structure in Python.
I’m trying to implement pydicom, not the Slicer module, but the value of Image Orientation Patient in MR data that I have is not (1,0,0,0,1,0), have (0.99, -0.04,0.01,0.043,0.99, -0.01) .

The following formula is used to convert RT Structure points from 3D to 2D.

As a result, the structure is off the target in Python as compared to the slicer as shown in the picture on the right.

I want to match a structure like the algorithm used by Slicer RT.
Thank you for your help.

DICOM RT structure set import/export is already implemented in SlicerRT extension.

No need to reimplement this in Python, since everything is already available in Python (the C++ classes are Python-wrapped). In fact, the DICOM import plugin infrastructure is implemented in Python.

If an RTSTRUCT importer that does all the sophisticated and robust processing as SlicerRT (preserves original contour points but interpolates between them smoothly, while supporting keyholes, branching, and provides smooth end-capping) was implemented in Python natively, it would be probably way too slow anyway.

Thank you for your reply.

In fact, what I want is a similar implementation using pydicom in python like Slicer RT.

So I wanted to know how to match the coordinates of the structure used in Slicer RT algorithm.

But if this is difficult, as you replied, I would like to use Slicer RT in python. Are there any pages for reference?

This topic should help: Does Slicer support the batch processing?. If you have any remaining questions then let us know.