CLI
dacapo
Command-line interface for the DACAPO application.
- Args:
log_level (str): The desired log level for the application.
- Examples:
To train a model, run:
` dacapo train --run-name my_run `
To validate a model, run:
` dacapo validate --run-name my_run --iteration 100 `
To apply a model, run:
` dacapo apply --run-name my_run --input-container /path/to/input --input-dataset my_dataset --output-path /path/to/output `
To predict with a model, run:
` dacapo predict --run-name my_run --iteration 100 --input-container /path/to/input --input-dataset my_dataset --output-path /path/to/output `
To run a blockwise operation, run:
` dacapo run-blockwise --input-container /path/to/input --input-dataset my_dataset --output-container /path/to/output --output-dataset my_output --worker-file /path/to/worker.py --total-roi [0:100,0:100,0:100] --read-roi-size [10,10,10] --write-roi-size [10,10,10] --num-workers 16 `
To segment blockwise, run:
` dacapo segment-blockwise --input-container /path/to/input --input-dataset my_dataset --output-container /path/to/output --output-dataset my_output --segment-function-file /path/to/segment_function.py --total-roi [0:100,0:100,0:100] --read-roi-size [10,10,10] --write-roi-size [10,10,10] --num-workers 16 `
dacapo [OPTIONS] COMMAND [ARGS]...
Options
- --log-level <log_level>
- Options:
DEBUG | INFO | WARNING | ERROR | CRITICAL
apply
Apply a trained run to an input dataset.
- Args:
run_name (str): The name of the run to apply. input_container (Path | str): The path to the input container. input_dataset (str): The name of the input dataset. output_path (Path | str): The path to the output directory. validation_dataset (Dataset | str, optional): The name of the validation dataset. Defaults to None. criterion (str, optional): The criterion to use for applying the run. Defaults to “voi”. iteration (int, optional): The iteration of the model to use for prediction. Defaults to None. parameters (PostProcessorParameters | str, optional): The parameters for the post-processor. Defaults to None. roi (Roi | str, optional): The roi to predict on. Passed in as [lower:upper, lower:upper, … ]. Defaults to None. num_workers (int, optional): The number of workers to use for prediction. Defaults to 30. output_dtype (np.dtype | str, optional): The output data type. Defaults to “uint8”. overwrite (bool, optional): Whether to overwrite existing output files. Defaults to True.
- Raises:
ValueError: If the run_name is not valid.
- Examples:
To apply a trained run to an input dataset, run:
` dacapo apply --run-name my_run --input-container /path/to/input --input-dataset my_dataset --output-path /path/to/output `
dacapo apply [OPTIONS]
Options
- -r, --run-name <run_name>
Required The name of the run to apply.
- -ic, --input_container <input_container>
Required The path to the input container.
- -id, --input_dataset <input_dataset>
Required The name of the input dataset.
- -op, --output_path <output_path>
Required The path to the output directory.
- -vd, --validation_dataset <validation_dataset>
The name of the validation dataset.
- -c, --criterion <criterion>
The criterion to use for applying the run.
- -i, --iteration <iteration>
The iteration of the model to use for prediction.
- -p, --parameters <parameters>
The parameters for the post-processor.
- -roi, --roi <roi>
The roi to predict on. Passed in as [lower:upper, lower:upper, … ]
- -w, --num_workers <num_workers>
The number of workers to use for prediction.
- -dt, --output_dtype <output_dtype>
The output data type.
- -ow, --overwrite
Whether to overwrite existing output files.
config
dacapo config [OPTIONS]
predict
Apply a trained model to predict on a dataset.
- Args:
run_name (str): The name of the run to apply. iteration (int): The training iteration of the model to use for prediction. input_container (Path | str): The path to the input container. input_dataset (str): The name of the input dataset. output_path (Path | str): The path to the output directory. output_roi (Optional[str | Roi], optional): The roi to predict on. Passed in as [lower:upper, lower:upper, … ]. Defaults to None. num_workers (int, optional): The number of workers to use for prediction. Defaults to 30. output_dtype (np.dtype | str, optional): The output data type. Defaults to np.uint8. overwrite (bool, optional): Whether to overwrite existing output files. Defaults to True.
- Raises:
ValueError: If the run_name is not valid.
- Examples:
To predict with a model, run:
` dacapo predict --run-name my_run --iteration 100 --input-container /path/to/input --input-dataset my_dataset --output-path /path/to/output `
dacapo predict [OPTIONS]
Options
- -r, --run-name <run_name>
Required The name of the run to apply.
- -i, --iteration <iteration>
Required The training iteration of the model to use for prediction.
- -ic, --input_container <input_container>
Required The path to the input container.
- -id, --input_dataset <input_dataset>
Required The name of the input dataset.
- -op, --output_path <output_path>
Required The path to the output directory.
- -roi, --output_roi <output_roi>
The roi to predict on. Passed in as [lower:upper, lower:upper, … ]
- -w, --num_workers <num_workers>
The number of workers to use for prediction.
- -dt, --output_dtype <output_dtype>
The output data type.
- -ow, --overwrite
Whether to overwrite existing output files.
run-blockwise
Run blockwise processing on a dataset.
- Args:
input_container: The path to the input container. input_dataset: The name of the input dataset. output_container: The path to the output container. output_dataset: The name of the output dataset. worker_file: The path to the worker file. total_roi: The total roi to be processed. Format is [start:end, start:end, … ] in voxels. Defaults to the roi of the input dataset. Do not use spaces in CLI argument. read_roi_size: The size of the roi to be read for each block, in the format of [z,y,x] in voxels. write_roi_size: The size of the roi to be written for each block, in the format of [z,y,x] in voxels. num_workers: The number of workers to use. max_retries: The maximum number of retries. timeout: The timeout in seconds. overwrite: Whether to overwrite existing output files. channels_out: The number of output channels. output_dtype: The output data type.
- Raises:
ValueError: If the run_name is not valid.
- Examples:
To run a blockwise operation, run:
` dacapo run-blockwise --input-container /path/to/input --input-dataset my_dataset --output-container /path/to/output --output-dataset my_output --worker-file /path/to/worker.py --total-roi [0:100,0:100,0:100] --read-roi-size [10,10,10] --write-roi-size [10,10,10] --num-workers 16 `
dacapo run-blockwise [OPTIONS]
Options
- -ic, --input_container <input_container>
Required The path to the input container.
- -id, --input_dataset <input_dataset>
Required The name of the input dataset.
- -oc, --output_container <output_container>
Required The path to the output container.
- -od, --output_dataset <output_dataset>
Required The name of the output dataset.
- -w, --worker_file <worker_file>
Required The path to the worker file.
- -tr, --total_roi <total_roi>
Required The total roi to be processed. Format is [start:end, start:end, … ] in voxels. Defaults to the roi of the input dataset. Do not use spaces in CLI argument.
- -rr, --read_roi_size <read_roi_size>
Required The size of the roi to be read for each block, in the format of [z,y,x] in voxels.
- -wr, --write_roi_size <write_roi_size>
Required The size of the roi to be written for each block, in the format of [z,y,x] in voxels.
- -nw, --num_workers <num_workers>
The number of workers to use.
- -mr, --max_retries <max_retries>
The maximum number of retries.
- -t, --timeout <timeout>
The timeout in seconds.
- -ow, --overwrite
Whether to overwrite existing output files.
- -co, -channels_out <co>
The number of output channels.
- -dt, --output_dtype <output_dtype>
The output data type.
segment-blockwise
Segment the input dataset blockwise using a segment function file.
- Args:
input_container (str): The path to the input container. input_dataset (str): The name of the input dataset. output_container (str): The path to the output container. output_dataset (str): The name of the output dataset. segment_function_file (str): The path to the segment function file. total_roi (str): The total roi to be processed. Format is [start:end,start:end,…] in voxels. Defaults to the roi of the input dataset. Do not use spaces in CLI argument. read_roi_size (str): The size of the roi to be read for each block, in the format of [z,y,x] in voxels. write_roi_size (str): The size of the roi to be written for each block, in the format of [z,y,x] in voxels. context (str, optional): The context to be used, in the format of [z,y,x] in voxels. Defaults to the difference between the read and write rois. num_workers (int, optional): The number of workers to use. Defaults to 16. max_retries (int, optional): The maximum number of retries. Defaults to 2. timeout (int, optional): The timeout in seconds. Defaults to None. overwrite (bool, optional): Whether to overwrite existing output files. Defaults to True. channels_out (int, optional): The number of output channels. Defaults to None.
- Raises:
ValueError: If the run_name is not valid.
- Examples:
To segment blockwise, run:
` dacapo segment-blockwise --input-container /path/to/input --input-dataset my_dataset --output-container /path/to/output --output-dataset my_output --segment-function-file /path/to/segment_function.py --total-roi [0:100,0:100,0:100] --read-roi-size [10,10,10] --write-roi-size [10,10,10] --num-workers 16 `
dacapo segment-blockwise [OPTIONS]
Options
- -ic, --input_container <input_container>
Required The path to the input container.
- -id, --input_dataset <input_dataset>
Required The name of the input dataset.
- -oc, --output_container <output_container>
Required The path to the output container.
- -od, --output_dataset <output_dataset>
Required The name of the output dataset.
- -sf, --segment_function_file <segment_function_file>
Required The path to the segment function file.
- -tr, --total_roi <total_roi>
The total roi to be processed. Format is [start:end,start:end,…] in voxels. Defaults to the roi of the input dataset. Do not use spaces in CLI argument.
- -rr, --read_roi_size <read_roi_size>
Required The size of the roi to be read for each block, in the format of [z,y,x] in voxels.
- -wr, --write_roi_size <write_roi_size>
Required The size of the roi to be written for each block, in the format of [z,y,x] in voxels.
- -c, --context <context>
The context to be used, in the format of [z,y,x] in voxels. Defaults to the difference between the read and write rois.
- -nw, --num_workers <num_workers>
The number of workers to use.
- -mr, --max_retries <max_retries>
The maximum number of retries.
- -t, --timeout <timeout>
The timeout in seconds.
- -ow, --overwrite
Whether to overwrite existing output files.
- -co, --channels_out <channels_out>
The number of output channels.
train
Train a model with the specified run name.
- Args:
run_name (str): The name of the run to train. no_validation (bool): Flag to disable validation after training.
dacapo train [OPTIONS]
Options
- -r, --run-name <run_name>
Required The NAME of the run to train.
- --no-validation
Disable validation after training.
validate
dacapo validate [OPTIONS]
Options
- -r, --run-name <run_name>
Required The name of the run to validate.
- -i, --iteration <iteration>
Required The iteration at which to validate the run.
- -w, --num_workers <num_workers>
- -dt, --output_dtype <output_dtype>
- -ow, --overwrite