Command line interface¶
Besides the main zea API documentation, zea also provides a command line interface (CLI).
File reading and visualization¶
zea¶
Load and process ultrasound data based on a configuration file.
usage: zea [-h] [-c CONFIG] [-t {view}] [--skip_validate_file]
- -h, --help¶
show this help message and exit
- -c <config>, --config <config>¶
path to the config file.
- -t {view}, --task {view}¶
Which task to run. Currently only ‘view’ is supported.
- --skip_validate_file¶
Skip zea file integrity checks. Use with caution.
Convert datasets¶
python -m zea.data.convert¶
Convert raw data to a zea dataset.
usage: python -m zea.data.convert [-h]
{echonet,echonetlvh,camus,cetus,picmus,verasonics}
...
- -h, --help¶
show this help message and exit
python -m zea.data.convert camus¶
usage: python -m zea.data.convert camus [-h] [--download]
[--no_hyperthreading]
src dst
- src¶
Source folder path, should contain either manually downloaded dataset or will be target location for automated download with the –download flag
- dst¶
Destination folder path
- -h, --help¶
show this help message and exit
- --download¶
Download the CAMUS dataset from the server, will be saved to the –src path
- --no_hyperthreading¶
Disable hyperthreading for multiprocessing
python -m zea.data.convert cetus¶
usage: python -m zea.data.convert cetus [-h] [--download]
[--no_hyperthreading] [--upload]
src dst
- src¶
Source folder path, should contain either manually downloaded dataset or will be target location for automated download with the –download flag
- dst¶
Destination folder path
- -h, --help¶
show this help message and exit
- --download¶
Download the CETUS dataset from the server, will be saved to the –src path
- --no_hyperthreading¶
Disable hyperthreading for multiprocessing
- --upload¶
Upload the converted dataset to HuggingFace Hub (zeahub/cetus-miccai-2014)
python -m zea.data.convert echonet¶
usage: python -m zea.data.convert echonet [-h] [--split_path SPLIT_PATH]
[--no_hyperthreading]
src dst
- src¶
Source folder path
- dst¶
Destination folder path
- -h, --help¶
show this help message and exit
- --split_path <split_path>¶
Path to the split.yaml file containing the dataset split if a split should be copied
- --no_hyperthreading¶
Disable hyperthreading for multiprocessing
python -m zea.data.convert echonetlvh¶
usage: python -m zea.data.convert echonetlvh [-h] [--no_rejection]
[--rejection_path REJECTION_PATH]
[--batch BATCH]
[--convert_measurements]
[--convert_images]
[--max_files MAX_FILES] [--force]
src dst
- src¶
Source folder path
- dst¶
Destination folder path
- -h, --help¶
show this help message and exit
- --no_rejection¶
Do not reject sequences in manual_rejections.txt
- --rejection_path <rejection_path>¶
Path to custom rejection txt file (defaults to manual_rejections.txt)
- --batch <batch>¶
Specify which BatchX directory to process, e.g. –batch=Batch2
- --convert_measurements¶
Only convert measurements CSV file
- --convert_images¶
Only convert image files
- --max_files <max_files>¶
Maximum number of files to process (for testing)
- --force¶
Force recomputation even if parameters already exist
python -m zea.data.convert picmus¶
usage: python -m zea.data.convert picmus [-h] src dst
- src¶
Source folder path
- dst¶
Destination folder path
- -h, --help¶
show this help message and exit
python -m zea.data.convert verasonics¶
usage: python -m zea.data.convert verasonics [-h]
[--frames FRAMES [FRAMES ...]]
[--allow_accumulate]
[--device DEVICE]
[--no_compression]
src dst
- src¶
Source folder path
- dst¶
Destination folder path
- -h, --help¶
show this help message and exit
- --frames <frames>¶
The frames to add to the file. This can be a list of integers, a range of integers (e.g. 4-8), or ‘all’. Defaults to ‘all’, unless specified in a convert.yaml file.
- --allow_accumulate¶
Sometimes, some transmits are already accumulated on the Verasonics system (e.g. harmonic imaging through pulse inversion). In this case, the mode in the Receive structure is set to 1 (accumulate). If this flag is set, such files will be processed. Otherwise, an error is raised when such a mode is detected.
- --device <device>¶
Device to use for conversion (e.g., ‘cpu’ or ‘gpu:0’).
- --no_compression¶
Disable compression when saving the zea dataset. By default, compression is enabled, which reduces disk space at the cost of increased conversion time.
Data copying¶
python -m zea.data¶
Copy a zea.Folder to a new location.
usage: python -m zea.data [-h] [--mode {a,w,r+,x}] src dst key
- src¶
Source folder path
- dst¶
Destination folder path
- key¶
Key to access in the hdf5 files
- -h, --help¶
show this help message and exit
- --mode {a,w,r+,x}¶
Mode in which to open the destination files (default: ‘a’)
Data file manipulation¶
python -m zea.data.file_operations¶
Manipulate zea data files.
usage: python -m zea.data.file_operations [-h]
{sum,compound_frames,compound_transmits,resave,extract}
...
- -h, --help¶
show this help message and exit
python -m zea.data.file_operations compound_frames¶
usage: python -m zea.data.file_operations compound_frames [-h] [--overwrite]
input_path
output_path
- input_path¶
Input HDF5 file.
- output_path¶
Output HDF5 file.
- -h, --help¶
show this help message and exit
- --overwrite¶
Overwrite existing output file.
python -m zea.data.file_operations compound_transmits¶
usage: python -m zea.data.file_operations compound_transmits
[-h] [--overwrite] input_path output_path
- input_path¶
Input HDF5 file.
- output_path¶
Output HDF5 file.
- -h, --help¶
show this help message and exit
- --overwrite¶
Overwrite existing output file.
python -m zea.data.file_operations extract¶
usage: python -m zea.data.file_operations extract [-h]
[--transmits TRANSMITS [TRANSMITS ...]]
[--frames FRAMES [FRAMES ...]]
[--overwrite]
input_path output_path
- input_path¶
Input HDF5 file.
- output_path¶
Output HDF5 file.
- -h, --help¶
show this help message and exit
- --transmits <transmits>¶
Target transmits. Can be a list of integers or ranges (e.g. 0-3 7).
- --frames <frames>¶
Target frames. Can be a list of integers or ranges (e.g. 0-3 7).
- --overwrite¶
Overwrite existing output file.
python -m zea.data.file_operations resave¶
usage: python -m zea.data.file_operations resave [-h] [--overwrite]
input_path output_path
- input_path¶
Input HDF5 file.
- output_path¶
Output HDF5 file.
- -h, --help¶
show this help message and exit
- --overwrite¶
Overwrite existing output file.
python -m zea.data.file_operations sum¶
usage: python -m zea.data.file_operations sum [-h] [--overwrite]
input_paths [input_paths ...]
output_path
- input_paths¶
Paths to the input files.
- output_path¶
Output HDF5 file.
- -h, --help¶
show this help message and exit
- --overwrite¶
Overwrite existing output file.