adapters

This package contains implementations of custom adapters that enable the conversion of certain commonly used photoacoustic data formats into the IPASC format.

You can use these as a reference when attempting to define your own adapters.

class NrrdFileConverter(nrrd_file_path)[source]

Bases: BaseAdapter

This converter assumes a linear transducer with 128 elements and an element pitch of 0.3mm. It assumes that the NRRD file metadata contains a ‘sizes’, ‘type’ and ‘space directions’ field.

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

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:

dict

set_metadata_value(metadatum: MetaDatum) object[source]

This method must be implemented to yield appropriate data for all MetaDatum elements in the MetadataTags class.

You are given a certain meta datum nd have to return the appropriate information.

Parameters:

metadatum (MetaDatum) – The MetaDatum for which to return the correct data.

Returns:

The data corresponding to the given MetaDatum

Return type:

object