Implementation

Several means of driving Anatomist in python scripts exist :

Behind a general interface, this api provides 2 implementations, one for each method of communication with Anatomist.

The implementation that uses the python bindings is called direct implementation and is in the module anatomist.direct.api. The implementation that uses socket communication is called socket implementation and is in the module anatomist.socket.api. By default, the implementation used when you import anatomist.api is the direct implementation.

Another specific implementation for Brainvisa also exists : brainvisa.anatomist module. It enables to use brainvisa database informations on loaded objects to automatically load associated referentials and transformations. It uses the same api, so it is possible to switch from one implementation to the other.

By default, brainvisa module uses the socket implementation. This way, Brainvisa and Anatomist applications live in separated processes. So potential errors in Anatomist does not crash Brainvisa. Moreover, Anatomist and BrainVISA doesn't share the same Qt event loop (graphical interface), so BrainVISA GUI is not blocked during Anatomist windows loading.

See the python documentation of the python Anatomist API : sphinx doc.

More information about this API and examples available here.