Modify segment directly using Python

I’ve seen a lot of python scripts that use existing segment editor effects, but is there a way to directly access segment data and volume data from python to implement prototype segmentation algorithms? Or is that something that’s better done via C++?

I’m positive there are probably pointers to how to do this in the docs…

Thanks!

-Hollister

Contribution of new Segment Editor effects would be very welcome! You can implement Segment Editor effects either in C++ or Python. There is a template for Python-scripted segment editor effect in the Extension wizard and you can use all the current Segment Editor effects as examples of how to implement your own effect - see in Slicer core and in SegmentEditorExtraEffects extension.