camitk.ComponentExtension¶
- class camitk.ComponentExtension¶
This class describes what is a generic Component extension. To add a ComponentExtension to CamiTK core, write a new class that inherits from this class.
There are two types of component extension: the classical one manages (mime type) file extension, the other one manages all files in a given directory (e.g. Dicom images). For the latter you have to redefine hasDataDirectory().
The following methods HAVE to be redefined in your subclass: - getName
getDescription - getFileExtensions - open
The following methods can be redefined: - save: saving from a Component to one of the managed format - hasDataDirectory: for directory type extension
- __init__(self: camitk.ComponentExtension) None¶
protected constructor, note never directly instantiate a ComponentExtension, use loadExtension(…) instead!
Methods
__init__(self)protected constructor, note never directly instantiate a ComponentExtension, use loadExtension(...) instead!
getDescription(self)get the plugin description
getFileExtensions(self)get the list of managed extensions (each file with an extension in the list can be loaded by this Component)
getName(self)@name ComponentExtension plugin interface methods @{ get the plugin name
hasDataDirectory(self)return true if this component manages directory instead of individual files (e.g. Dicom series are stored in directories, not files).
open(self, arg0)get a new instance from data stored in a file (this is the most important method to redefine in your subclass)
save(self, arg0)save a given Component (does not have to be top-level) into one of the currently managed format (check the component QFileInfo(component->getFileName()).completeSuffix().