openlifu.xdc.util.load_transducer_from_file

openlifu.xdc.util.load_transducer_from_file(transducer_filepath: str | PathLike, convert_array: bool = True) Transducer | TransducerArray[source]

Load a Transducer or TransducerArray from file, depending on the “type” field in the file. Note: the transducer object includes the relative path to the affiliated transducer model data. get_transducer_absolute_filepaths, should be used to obtain the absolute data filepaths based on the Database directory path. :param transducer_filepath: path to the transducer json file :param convert_array: When enabled, if a TransducerArray is encountered then it is converted to a Transducer.

Returns: a Transducer if the json file defines a Transducer, or if the json file defines a TransducerArray and convert_array is enabled.

Otherwise a TransducerArray.