Hi community,
I am trying to develop a new module from my research work, in that “Reformat” module is essential. I want to have some features (offset, rotation, etc) into my existing module. I am developing in Python but “Reformat” is in C/C++. Is there any way I can access some features from “Reformat” without coding the entire function?
So you want to run c++ code in python, right?
I haven’t used it myself but I’ve heard pybind11 is pretty useful.
Oh cool! I’ll check it out once.
Thanks
I don’t recommend using libraries and mechanisms that are not already part of Slicer. You’ll need to change basic Slicer cmake and other files, and will end up with something that is very hard to maintain, or you will spend a year or more making it part of Slicer.
The best way would be to create a reusable widget from the part of the module that you want to use from Python and add that widget like any other. There are many examples, e.g. here.