Pipeline

Operations and Pipelines for ultrasound data processing.

This module contains two important classes, Operation and Pipeline, which are used to process ultrasound data. A pipeline is a sequence of operations that are applied to the data in a specific order.

Stand-alone manual usage

Operations can be run on their own:

Examples

data = np.random.randn(2000, 128, 1)
# static arguments are passed in the constructor
envelope_detect = EnvelopeDetect(axis=-1)
# other parameters can be passed here along with the data
envelope_data = envelope_detect(data=data)

Using a pipeline

You can initialize with a default pipeline or create your own custom pipeline.

pipeline = Pipeline.from_default()

operations = [
    EnvelopeDetect(),
    Normalize(),
    LogCompress(),
]
pipeline_custom = Pipeline(operations)

One can also load a pipeline from a config or yaml/json file:

json_string = '{"operations": ["identity"]}'
pipeline = Pipeline.from_json(json_string)

yaml_file = "pipeline.yaml"
pipeline = Pipeline.from_yaml(yaml_file)

Example of a yaml file:

pipeline:
  operations:
    - name: demodulate
    - name: "patched_grid"
      params:
        operations:
          - name: tof_correction
            params:
              apply_phase_rotation: true
          - name: pfield_weighting
          - name: delay_and_sum
        num_patches: 100
    - name: envelope_detect
    - name: normalize
    - name: log_compress