|
| 1 | +# Understanding SIMPA |
| 2 | + |
| 3 | +## Understanding Tags |
| 4 | + |
| 5 | +### What are Tags? |
| 6 | + |
| 7 | +In SIMPA, Tags are identifiers used to specify and categorize various settings and components within the simulation. |
| 8 | +They act as keys in the configuration dictionaries, enabling a clear and organized way to define simulation parameters. |
| 9 | +Tags ensure that the configuration is modular, readable, and easy to manage. |
| 10 | + |
| 11 | +### Purpose of Tags |
| 12 | + |
| 13 | +- **Organization**: Tags help in structuring the configuration settings systematically. |
| 14 | +- **Flexibility**: They allow users to easily modify and extend configurations. |
| 15 | +- **Reusability**: Tags facilitate the reuse of settings across different simulations. |
| 16 | + |
| 17 | +### How Tags Work |
| 18 | + |
| 19 | +Tags are used to identify different components and their settings within the configuration dictionaries. Each component |
| 20 | +has a predefined set of tags associated with it. These tags are used to specify the parameters and properties of the |
| 21 | +components. |
| 22 | + |
| 23 | +### What Tags are Available? |
| 24 | + |
| 25 | +The list of Tags available in SIMPA is very extensive (see [simpa.utils](simpa.utils.rst) for full list), due to the |
| 26 | +level of customisation available to the user. To get to grips with the more commonly used Tags, we highly recommend |
| 27 | +consulting the [examples](simpa_examples.rst). |
| 28 | + |
| 29 | +## Concept of Settings |
| 30 | + |
| 31 | +Settings in SIMPA are configurations that control the behavior of the simulation. They are used to specify parameters |
| 32 | +and options for both the overall simulation and individual components of the simulation pipeline. Proper configuration |
| 33 | +of these settings is crucial for accurate and efficient simulations. This documentation provides a foundational |
| 34 | +understanding of these settings, allowing users to customize their simulations effectively. For more detailed |
| 35 | +information on specific settings and components, users are encouraged to refer to the source code and additional |
| 36 | +documentation provided within the SIMPA repository. |
| 37 | + |
| 38 | +### Global Settings |
| 39 | + |
| 40 | +Global settings apply to the entire simulation and include parameters that are relevant across multiple components. |
| 41 | +These settings typically encompass general simulation properties such as physical constants and overarching simulation |
| 42 | +parameters. |
| 43 | + |
| 44 | +#### Example of Global Settings |
| 45 | + |
| 46 | +- `Tags.SPACING_MM`: The voxel spacing in the simulation. |
| 47 | +- `Tags.GPU`: Whether there is a GPU available to perform the computation. |
| 48 | +- `Tags.WAVELENGTHS`: The wavelengths that will later be simulated. |
| 49 | + |
| 50 | +### Component Settings |
| 51 | + |
| 52 | +Component settings are specific to individual components within the simulation pipeline. Each component can have its own |
| 53 | +set of settings that determine how it behaves. These settings allow for fine-grained control over the simulation |
| 54 | +process, enabling customization and optimization for specific experimental conditions. |
| 55 | + |
| 56 | +#### Difference Between Global and Component Settings |
| 57 | + |
| 58 | +- **Scope**: |
| 59 | + - Global settings affect the entire simulation framework. |
| 60 | + - Component settings only influence the behavior of their respective components. |
| 61 | + |
| 62 | +- **Usage**: |
| 63 | + - Global settings are defined once and applied universally. |
| 64 | + - Component settings are defined for each component individually, allowing for component-specific customization. |
| 65 | + |
| 66 | +#### Implementation |
| 67 | +For a given simulation, the overall simulation settings will first be created from the global settings. Then, each |
| 68 | +components setting will be added. Overall, a dictionary instance will be created with all of the global settings as well |
| 69 | +as the components settings as sub-dictionaries. |
| 70 | + |
| 71 | +## Available Component Settings |
| 72 | + |
| 73 | +The following list describes the available component settings for various components in the SIMPA framework. Each component may have a unique set of settings that control its behavior. |
| 74 | + |
| 75 | +### 1. Volume Creation |
| 76 | + |
| 77 | +Settings for the volume creation component, which defines the method used to create the simulation volume; and therefore |
| 78 | +ultimately decides the properties of the simulation volume. It is added to the simulation settings using: |
| 79 | +[set_volume_creator_settings](../../simpa/utils/settings.py). |
| 80 | + |
| 81 | +#### Examples of Volume Creation Settings |
| 82 | +- `Tags.STRUCTURES`: When using the model based volume creation adapter, sets the structures to be fill the volume. |
| 83 | +- `Tags.INPUT_SEGMENTATION_VOLUME`: When using the segmentation based volume creation adapter, the segmentation mapping |
| 84 | +will be specified under this tag. |
| 85 | + |
| 86 | +### 2. Acoustic Model |
| 87 | + |
| 88 | +Settings for the acoustic forward model component, which simulates the propagation of acoustic waves. It is added to the |
| 89 | +simulation settings using: [set_acoustic_settings](../../simpa/utils/settings.py). |
| 90 | + |
| 91 | +#### Examples of Acoustic Settings |
| 92 | +- `Tags.KWAVE_PROPERTY_ALPHA_POWER`: The exponent in the exponential acoustic attenuation law of k-Wave. |
| 93 | +- `Tags.RECORDMOVIE`: If true, a movie of the k-Wave simulation will be recorded. |
| 94 | + |
| 95 | +### 3. Optical Model |
| 96 | + |
| 97 | +Settings for the optical model component, which simulates the propagation of light through the medium. It is added to |
| 98 | +the simulation settings using: [set_optical_settings](../../simpa/utils/settings.py). |
| 99 | + |
| 100 | +#### Examples of Optical Settings |
| 101 | +- `Tags.OPTICAL_MODEL_NUMBER_PHOTONS`: The number of photons used in the optical simulation. |
| 102 | +- `Tags.LASER_PULSE_ENERGY_IN_MILLIJOULE`: The laser pulse energy used in the optical simulation. |
| 103 | + |
| 104 | +### 4. Reconstruction model |
| 105 | + |
| 106 | +Settings for the reconstruction model, which reconstructs the image from the simulated signals. It is added to the |
| 107 | +simulation settings using: [set_reconstruction_settings](../../simpa/utils/settings.py). |
| 108 | + |
| 109 | +#### Examples of Reconstruction Settings |
| 110 | + |
| 111 | +- `Tags.RECONSTRUCTION_BMODE_AFTER_RECONSTRUCTION`: Specifies whether an envelope detection should be performed after |
| 112 | +reconstruction. |
| 113 | +- `Tags.RECONSTRUCTION_PERFORM_BANDPASS_FILTERING`: Whether bandpass filtering should be applied or not. |
0 commit comments