zea.load_file¶

zea.load_file(path, data_type='raw_data', indices=None, scan_kwargs=None)[source]¶

Loads a zea data files (h5py file).

Returns the data together with a parameters object containing the parameters of the acquisition. Probe information is available via parameters.to_probe_dict() or File.probe.

Additionally, it can load a specific subset of frames / transmits.

The indices parameter can be used to load a subset of the data. This can be

  • 'all' or None to load all data

  • an int to load a single frame

  • a List[int] to load specific frames

  • a Tuple[Union[list, slice, int], ...] to index multiple axes (i.e. frames and transmits). Note that

    indexing with lists of indices for multiple axes is not supported. In that case, try to define one of the axes with a slice for optimal performance. Alternatively, slice the data after loading.

For more information on the indexing options, see indexing on ndarrays and fancy indexing in h5py.

Parameters:
  • path (str, pathlike) – The path to the hdf5 file.

  • data_type (str, optional) – The type of data to load. Defaults to ‘raw_data’. Other options are ‘aligned_data’, ‘beamformed_data’, ‘envelope_data’, ‘image’ and ‘image_sc’.

  • indices (Union[Tuple[Union[list, slice, int], ...], List[int], int, None]) – The indices to load. Defaults to None in which case all frames are loaded.

  • scan_kwargs (dict) – Additional keyword arguments to pass to File.load_parameters(). These will override the parameters from the file if they are present. Defaults to None.

Returns:

The raw data of shape (n_frames, n_tx, n_ax, n_el, n_ch). (Parameters): A parameters object containing the parameters of the acquisition.

Return type:

Tuple[ndarray, Parameters]