Command-line interface

check

Implementation of CLI check command.

treem.commands.check.check(args)[source]

Checks morphology reconstruction for structural consistency.

usage: swc check [-h] [-q] [-o <str>] file

positional arguments:
  file        input morphology file (swc)

optional arguments:
  -h, --help  show this help message and exit
  -q          disable output
  -o <str>    save output to file (json)

prints out error codes and IDs of error nodes; returns the number of errors

convert

Implementation of CLI convert command.

treem.commands.convert.convert(args)[source]

Converts input data to compliant SWC format.

usage: swc convert [-h] [-p <int> [<int> ...]] [-o <str>] [-q] file

positional arguments:
  file                  input morphology file (swc)

optional arguments:
  -h, --help            show this help message and exit
  -p <int> [<int> ...]  point type {1,2,3,4} [all]
  -o <str>              converted morphology file (swc) [inp.swc]
  -q                    disable output

find

Implementation of CLI find command.

treem.commands.find.find(args)[source]

Locates single nodes in morphology reconstruction.

usage: swc find [-h] [-p <int> [<int> ...]] [-e <int> [<int> ...]]
                [-b <int> [<int> ...]] [-g <int> [<int> ...]] [-s]
                [-d <float>] [-l <float>] [-z <float>] [--comp <str>]
                [-c <float>] [--bottom-up] [--sec]
                file

positional arguments:
  file                  input morphology file (swc)

optional arguments:
  -h, --help            show this help message and exit
  -p <int> [<int> ...]  point type {1,2,3,4} [any]
  -e <int> [<int> ...]  branch order
  -b <int> [<int> ...]  branch breadth
  -g <int> [<int> ...]  node degree
  -s                    stem branches (same as: -e 1 --sec -p 2 3 4)
  -d <float>            diameter threshold, um
  -l <float>            segment length threshold, um
  -z <float>            z-jump threshold, um
  --comp <str>          comparison condition for threshold {lt,eq,gt} [gt]
  -c <float>            cut plane thickness, um (z axis)
  --bottom-up           slice surface down (z axis)
  --sec                 section start ids only

prints out point ids

measure

Implementation of CLI measure command.

treem.commands.measure.get_morphometry(reconstruction, args)[source]

Computes morphometric features of a reconstruction.

treem.commands.measure.measure(args)[source]

Computes morphometric features of multiple reconstructions.

usage: swc measure [-h] [-p <int> [<int> ...]] [-o <str>] file [file ...]

positional arguments:
  file                  input morphology file (swc)

optional arguments:
  -h, --help            show this help message and exit
  -p <int> [<int> ...]  point type {1,2,3,4} [all]
  -o <str>              output morphometric file (json)

modify

Implementation of CLI modify command.

treem.commands.modify.modify(args)[source]

Modifies selected parts of morphology reconstruction.

usage: swc modify [-h] [-p <int> [<int> ...]] [-e <int> [<int> ...]]
                  [-b <int> [<int> ...]] [-i <int> [<int> ...]]
                  [-s <float> <float> <float>] [-r <float>] [-t <float>]
                  [-m <int>] [-j <float>] [--sec] [-w <float>] [-u] [-a]
                  [--seed <int>] [-o <str>]
                  file

positional arguments:
  file                  input morphology file (swc)

optional arguments:
  -h, --help            show this help message and exit
  -p <int> [<int> ...]  point type {2,3,4} [all]
  -e <int> [<int> ...]  branch order
  -b <int> [<int> ...]  branch breadth
  -i <int> [<int> ...]  input ids
  -s <float> <float> <float>
                        scaling factors (x,y,z axes)
  -r <float>            radius scaling factor
  -t <float>            stretching strength, rel.
  -m <int>              smoothing strength, iter.
  -j <float>            random coordinate jitter, um (max)
  --sec                 apply jitter per section
  -w <float>            random branch twisting, deg. (max)
  -u                    prune branches
  -a                    swap branches
  --seed <int>          random seed
  -o <str>              output morphology file (swc) [mod.swc]

render

usage: swc [-h] {check,view,find,modify,repair,measure,convert} ...
swc: error: invalid choice: 'render' (choose from 'check', 'view', 'find', 'modify', 'repair', 'measure', 'convert')

repair

Implementation of CLI repair command.

treem.commands.repair.repair(args)[source]

Corrects morphology reconstruction at the given nodes.

usage: swc repair [-h] [-n] [-t <float> <float> <float>]
                  [-a <float> <float> <float>] [-k <float>] [-kxy <float>]
                  [--bottom-up] [--seed <int>] [-c <int> [<int> ...]]
                  [--force-repair] [-d <int> [<int> ...]] [--diam <str>]
                  [--pool <str> [<str> ...]] [-l <int> [<int> ...]]
                  [-z <int> [<int> ...]] [--zjump <str>] [-r <float>]
                  [-o <str>] [-v]
                  file

positional arguments:
  file                  input morphology file (swc)

optional arguments:
  -h, --help            show this help message and exit
  -n                    center root
  -t <float> <float> <float>
                        translate morphology, um (x,y,z)
  -a <float> <float> <float>
                        rotate morphology, deg. (x,y,z axes)
  -k <float>            shrinkage correction factor (z axis)
  -kxy <float>          shrinkage correction factor (x,y plane)
  --bottom-up           slice surface down (z axis)
  --seed <int>          random seed
  -c <int> [<int> ...]  cut points ids
  --force-repair        repair cuts using branches of any order
  -d <int> [<int> ...]  set diameter in points ids
  --diam <str>          correction mode {joint,sec,order,breadth} [joint]
  --pool <str> [<str> ...]
                        reference reconstructions for repair
  -l <int> [<int> ...]  delete nodes in points ids
  -z <int> [<int> ...]  z-jump points ids
  --zjump <str>         correction mode {align,split,tilt,join} [align]
  -r <float>            sampling resolution, um
  -o <str>              output morphology file (swc) [rep.swc]
  -v                    verbose output

view

Implementation of CLI view command.

treem.commands.view.view(args)[source]

Display neuron morphology structure.

usage: swc view [-h] [-p <int> [<int> ...]] [-b <int> [<int> ...]]
                [-s <int> [<int> ...]] [-m <int> [<int> ...]] [--show-id]
                [-t <str>] [--no-axes] [--scale <float>] [-c <str>]
                [--shadow-color <str>] [--shadow-width <float>]
                [-a <float> <float>] [-d <float>] [-j <str>] [-o <str>]
                file [file ...]

positional arguments:
  file                  input morphology file (swc)

optional arguments:
  -h, --help            show this help message and exit
  -p <int> [<int> ...]  point type {1,2,3,4} [all]
  -b <int> [<int> ...]  branch start id
  -s <int> [<int> ...]  section start id
  -m <int> [<int> ...]  marker point id
  --show-id             show id labels
  -t <str>              set figure title
  --no-axes             disable axes
  --scale <float>       show scale bars, um
  -c <str>              color mode {neurites,cells,shadow} [neurites]
  --shadow-color <str>  shadow color [lightgray]
  --shadow-width <float>
                        shadow width [3.0]
  -a <float> <float>    initial rotation angles, deg. (elevation, azimuth)
  -d <float>            initial distance to object, rel. [10.0]
  -j <str>              projection {xy,xz,yz}
  -o <str>              save image to file