Command Line Tools
Utility CLI tools for processing Cell Locator annotation files.
For information on extending cl-convert
, see the Converter API Documentation
Installation
$ pip install cell-locator-cli
Tools
cl-export
Export Cell Locator annotations to VTK model or labelmap.
usage: cl-export [-h] [-m MODEL_PATH] [-l LABELMAP_PATH] [-a ATLAS_PATH]
[--pir]
annotation
- annotation
Input Cell Locator annotation file (JSON).
- -h, --help
show this help message and exit
- -m <model_path>, --model <model_path>
Output path for annotation model. If not provided, model generation is skipped.
- -l <labelmap_path>, --labelmap <labelmap_path>
Output path for annotation labelmap. If not provided, labelmap generation is skipped. Requires –atlas for spacing information.
- -a <atlas_path>, --atlas <atlas_path>
Atlas volume or labelmap. Used to set spacing/direction on the output labelmap.
- --pir
If set, read the annotation in PIR format rather than RAS. This should only be necessary for old-style CCF annotations.
cl-convert
A tool used to upgrade annotation .json files through breaking changes to the file format. The converter can also downgrade file formats, but this is not as thoroughly tested.
usage: cl-convert [-h] {convert,versions,infer} ...
- -h, --help
show this help message and exit
cl-convert convert
usage: cl-convert convert [-h] -v VERSION [-t TARGET] [--no-indent] src dst
- src
Source JSON file. Use ‘-’ to read from stdin.
- dst
Destination JSON file. Use ‘-’ to write to stdout.
- -h, --help
show this help message and exit
- -v <version>, --version <version>
Source file version. Use ‘-v?’ to infer the version.
- -t <target>, --target <target>
Target file version. Defaults to the latest version.
- --no-indent
Do not indent output JSON.
cl-convert infer
usage: cl-convert infer [-h] src
- src
Source JSON file. Use ‘-’ to read from stdin.
- -h, --help
show this help message and exit
cl-convert versions
usage: cl-convert versions [-h] [target]
- target
Show versions matching this target. If empty, show all versions.
- -h, --help
show this help message and exit
Sample Usage
Export an MNI annotation to labelmap and model
$ cl-export \
mni-annotation.json \
-m mni-annotation.vtk \
-l mni-annotation.label.nrrd \
-a mni_annotation_contiguous.nrrd
$ f3d mni-annotation.vtk
$ f3d -v mni-annotation.label.nrrd
Export a CCF annotation to labelmap only
$ cl-export \
ccf-annotation.json \
-l ccf-annotation.label.nrrd \
-a ccf_annotation_25_contiguous.nrrd \
--pir
$ f3d ccf-annotation.vtk
$ f3d -v ccf-annotation.label.nrrd
Update an old annotation file
$ cl-convert convert -v'?' -t v0.2 older.json newer.json
Inferred version 'v0.0.0+2020.08.26'
$ cl-convert infer newer.json
v0.2.1+2022.03.04
Version Identifiers
- cl_convert.converters.match(target)
Find the most-recent versions matching the target.
Prefix with
d
to interpret as a date. Prefix withv
, or no prefix, to interpret as a literal version.Example Versions
v1.1
v1.1.
d2020.
1.1.0+2019.02.01
yes
yes
no
1.1.1+2020.02.07
yes
yes
yes
1.2.0+2020.05.01
no
no
yes
1.10.1+2021.03.01
yes
no
no
- Parameters:
target – String describing target versions.
- Returns:
Matching versions, in order of precedence (most-recent first)