C++ & python extention method

Operating system: window 10
Slicer version: 5.2.1

Hi, slicer users !
I’ve asked a similar question before, but I don’t quite understand it.
(Can I create c++ extensions via DLLs? - #2 by RafaelPalomar)
To be honest, I don’t quite understand, so I’m looking for help again.

  • What i want
    I want to perform a specific inference process through my AI model with the mesh data loaded into the slicer. I’m trying to get this behavior to work within slicer.

  • Challenge

  1. The AI inference process is implemented in Python, but the code to generate the input datasets used by this model consists of C++.

  2. The process I was thinking of was as follows.

    load mesh data in slicer → make appropriate input dataset (via c++) → Ai inference (via python)

  • Want to know
    The above work is being done through the VS community, and I wonder if this process is possible in Slicer as well.

====================================
The previous question told me to use the CLI and lodable module, but I’m not sure how to apply this to my task.

I know roughly how to extend a module composed of python, so can you elaborate a bit on how to make a module composed of c++ work in slicer?

The original purpose was to modularize the dataset generation code and inference code at once, but I don’t understand how to modularize c++ and python at the same time. Can you show me just one example case?

Referring to the previous thread, several options were presented depending on the use case. Pleas provide more details about how you intend to use the resulting code. For example, if you want it to be a cross-platform Slicer extension you should follow that pattern. If you just want to experiment on your machine you might be able to do something simpler.