job_finished.m
Functionality This function is used to interact with JobAllocator. At the end of a certain job, the thread can use this function to signal to JobAllocator that the task has been accomplished.
Note
Due to a problem with the API, this method is currently implemented by writing an empty file, whose name is the signal to be sent to JobAllocator (JobAllocator then scans for these files.)
| Input |
| res_path: | (string) Directory where the message files to Job Allocator are written |
| thread_id: | (string) ID of the current thread |
|
main.m
Functionality Main function of the ultrasound simulation routine (built mainly on top
of the FieldII US simulation program). When using this program in a distributed
setting, make sure you are using it in compiled mode, as it requires no MATLAB
licence.
This function takes in some configuration flags which setup the running mode of
the simulator. Mainly, they determine whether to run in data generation
mode, or scatterer generation mode. In the former, random pairs of
{scatter-map; b-mode image} are generated. In the latter, bmode images
are simulated for predefined scatterers. After configuring the simulator,
it enters an infinite loop where it requests simulation tasks from JobAllocator,
then runs them.
| Input |
| thread_id: | (string) ID of the current thread. This can be passed as the first command line argument when running in compiled mode |
|
make_ellipsoids.m
Functionality
This function takes a regular 3D grid of points, and assigns them amplitudes. It does this by creating randomly-sized and rotated ellipsoids in that 3D space. The distance from the center of these ellipsoids describes a random spatial gradient. This spatial gradient is then used to assign amplitudes to the points in space.
| Input |
| opts: | Options structure for this simulation. |
| x_size: | Lateral size of the phantom |
| y_size: | Elevation size of the phantom |
| z_size: | Axial size of the phantom |
| z_start: | Distance of the phantom from the transducer |
| x_g: | Vector of x_coordinates of the points of the input grid |
| y_g: | Vector of y_coordinates of the points of the input grid |
| z_g: | Vector of z_coordinates of the points of the input grid |
|
| Output |
:multiplicative_amplitude : Vector of amplitudes assigned to the points of the input 3D grid |
make_image.m
Functionality
This function takes a number of RF lines, places them together, and performs some additional processing to extract a B-mode image, or an RF-image, and saves them.
| Input |
| opts: | Options structure for this simulation |
| probe_angle: | Angle in radians of US beam incidence |
| y_slice: | Depth of the current slice when simulating a 3D volume |
| render_bmode: | Flag: if true, renders a bmode image, else renders RF image |
|
optsInit.m
Functionality
This function is where all the simulation settings, probe parameters, files, directories, and various other options for the FieldII simulator, and the phantom generation procedure are set.
| Input |
| name: | (String). Name of the current experiment. An experiment is defined as all the different simulation settings of one particular phantom. |
| sim2d: | Flag. If true, indicates the program is a 2D simulation (not 3D) |
| override_angles: |
| | Flag. If true, indicates that the simulation angle is given in experiment name |
|
| Output |
| opts: | Options structure for this simulation |
|
request_job_new.m
Functionality
This function sends a request to JobAllocator for a new simulation job. It parses the answer from JobAllocator to extract the details about the simulation job to be run, and stores this configuration in a struct called job.
| Input |
:res_path : (string) Directory where the message files to Job Allocator are written
:thread_id: (string) ID of the current thread |
| Output |
| job: | job struct containg a description of the allocated simulation job. |
|
sim_img.m
Functionality
This function takes a 3D scatter map, and rotates or translates it to simulate the positioning of the US probe relative to the scatter map. It then launches the simulation of the RF line specified by JobAllocator.
| Input |
| opts: | Options structure for this simulation |
| probe_angle: | Angle in radians of US beam incidence |
| rf_line: | The number of the RF-line to be simulated |
| y_slice: | Depth of the current slice when simulating a 3D volume |
| amplitudes: | Vector of amplitudes of the scatterers in the scatter map |
| x: | Vector of x-coordinates of the scatterers |
| y: | Vector of y-coordinated of the scatterers |
| z: | Vector of z_coordinated of the scatterers |
|
simulation_routine.m
Functionality
This function reads the type of task which has been allocated (t1, t2, or t3), and acts accordingly.
| t1: | Generation of tissue phantoms |
| t2: | Simulation of US interaction with tissue phantoms (scatter maps) |
| t3: | US b-mode image creation from the simulated data |
| Input |
| simulate: | Flag. Used to decide whether to simulate images or not. Used in debugging to see the result of scatter map generation without simulating its interaction with US |
| fast_run: | Flag. Used in debugging for running the US simulation quickly |
| evaluation_mode: |
| | Flag. If true, means the program is in evaluation mode, else in dataset generation mode. |
| sim2d: | Flag. If true, indicates the program is a 2D simulation (not 3D) |
| new_scatmap: | Flag. If true, indicates that a new random scatter-map can be generated. |
| render_images: | Flag. If true, indicates whether to render the images or not. |
| job: | job struct containg a description of the allocated simulation job. |
| override_angles: |
| | Flag. If true, indicates that the simulation angle is given in experiment name |
| generate_incl: | Flag. This is a special mode. When set to true, the program generates a scatter map of a circular inclusion |
| generate_from_ct: |
| | Flag. Whether to use CT images, or the method of random ellipsoids for scatter map generation. |
|