volume_creation_module
- class ModelBasedAdapter(global_settings: Settings)[source]
Bases:
VolumeCreationAdapterBase
The model-based volume creator uses a set of rules how to generate structures to create a simulation volume. These structures are added to the dictionary and later combined by the algorithm:
# Initialise settings dictionaries simulation_settings = Settings() all_structures = Settings() structure = Settings() # Definition of en example structure. # The concrete structure parameters will change depending on the # structure type structure[Tags.PRIORITY] = 1 structure[Tags.STRUCTURE_START_MM] = [0, 0, 0] structure[Tags.STRUCTURE_END_MM] = [0, 0, 100] structure[Tags.MOLECULE_COMPOSITION] = TISSUE_LIBRARY.muscle() structure[Tags.CONSIDER_PARTIAL_VOLUME] = True structure[Tags.ADHERE_TO_DEFORMATION] = True structure[Tags.STRUCTURE_TYPE] = Tags.HORIZONTAL_LAYER_STRUCTURE all_structures["arbitrary_identifier"] = structure simulation_settings[Tags.STRUCTURES] = all_structures # ... # Define further simulation settings # ... simulate(simulation_settings)
- Parameters:
global_settings (Settings) – The SIMPA settings dictionary
- create_simulation_volume() dict [source]
This method creates an in silico representation of a tissue as described in the settings file that is given.
- Returns:
A dictionary containing optical and acoustic properties as well as other characteristics of the simulated volume such as oxygenation, and a segmentation mask. All of these are given as 3d numpy arrays.
- Return type:
- class SegmentationBasedAdapter(global_settings: Settings)[source]
Bases:
VolumeCreationAdapterBase
This volume creator expects a np.ndarray to be in the settings under the Tags.INPUT_SEGMENTATION_VOLUME tag and uses this array together with a SegmentationClass mapping which is a dict defined in the settings under Tags.SEGMENTATION_CLASS_MAPPING.
With this, an even greater utility is warranted.
- Parameters:
global_settings (Settings) – The SIMPA settings dictionary
- create_simulation_volume() dict [source]
This method creates an in silico representation of a tissue as described in the settings file that is given.
- Returns:
A dictionary containing optical and acoustic properties as well as other characteristics of the simulated volume such as oxygenation, and a segmentation mask. All of these are given as 3d numpy arrays.
- Return type:
- class VolumeCreationAdapterBase(global_settings: Settings)[source]
Bases:
SimulationModuleBase
Use this class to define your own volume creation adapter.
- Parameters:
global_settings (Settings) – The SIMPA settings dictionary
- abstract create_simulation_volume() dict [source]
This method creates an in silico representation of a tissue as described in the settings file that is given.
- Returns:
A dictionary containing optical and acoustic properties as well as other characteristics of the simulated volume such as oxygenation, and a segmentation mask. All of these are given as 3d numpy arrays.
- Return type: