api
- class BaseAdapter[source]
Bases:
ABC
The purpose of the BaseAdapter class is to provide the framework to convert from any given input data type into the IPASC format. It can be used as a basis for extension for a custom Adapter.
To achieve this, one needs to inherit from BaseAdapter and implement the abstract methods:
class CustomAdapter(BaseAdapter): def __init__(): # TODO do all of the loading etc here # Then call the __init__ of the BaseAdapter super(CustomAdapter, self).__init__() # TODO Add custom parameters after calling BaseAdapter.__init__ def generate_binary_data(self): # TODO def generate_device_meta_data(self): # TODO def set_metadata_value(self, metadatum: MetaDatum): # TODO
- add_custom_meta_datum_field(key: str, value: object)[source]
This method can be used to add a metadata field that is not reflected in the standard list of metadata of the IPASC format. Must be called after the __init__ method of the BaseAdapter was called. The custom meta data are stored in the AcquisitionMetadata dictionary.
- abstract generate_binary_data() ndarray [source]
The binary data is the raw time series data. It is internally stored as an N-dimensional numpy array. The binary data must be formatted the following way:
[detectors, samples, wavelengths, measurements]
- Returns:
A numpy array containing the binary data
- Return type:
np.ndarray
- abstract generate_device_meta_data() dict [source]
Must be implemented to define a digital twin of the photoacoustic imaging device. This method can be implemented using the DeviceMetaDataCreator.
- Returns:
A dictionary containing all key-value pair necessary to describe a digital twin of a photoacoustic device.
- Return type: