
Template 6 ALH Documentation
Considerations for all commands
- t6alh organizes images in to folders with names like
001
where each folder corresponds to a confocal acquisition, such as a czi scene - Most commands have optional arguments for a variable number folder names. Or an –image-folders-file argument which is the path to a file with this information
- Global option
--verbose
can be used to get more output. egt6alh --verbose get-paths
- Global option
--database
can be used to use a custom database location. egt6alh --database ~/t6alh.db get-paths
Align commands
These commands are used to align your images to the template image
init-and-segment
Run the below commands to initialize a database and segment the neuropil
Usage: t6alh init-and-segment [OPTIONS] [RAW_FILES]...
Takes a list of microscopy files and initializes the db
making a cache of all of the images, also segments the
image.
t6alh init-and-segment /storage/1.czi /storage/2.czi --root-dir ~/t6alh-cache --neuropil-chan 1 --fasii-chan 2
Options:
-r, --root-dir DIRECTORY the path where data is
cached
-n, --neuropil-chan INTEGER Channel labeling the
neuropil (1 indexed)
-f, --fasii-chan INTEGER Channel labeling the FasII
tracts (1 indexed)
-e, --eve-chan INTEGER Channel labeling even
skipped (1 indexed)
-s, --new-scale FLOAT the output scale in um.
Default is 1. Negative
numbers are interpreted as
no new scale
-o, --opening-size FLOAT the size for which smaller
objects will be removed.
Default 1um
-g, --gamma FLOAT gamma correction for the
image. default: 2
--help Show this message and exit.
init
Initialize the database caching raw files
Usage: t6alh init [OPTIONS] [RAW_FILES]...
Takes a list of microscopy files and initializes a
sqlite db making a cache of all channels of all images
in files like `001/chan1`
t6alh init /storage/1.czi /storage/2.czi --root-dir ~/t6alh-cache --neuropil-chan 1 --fasii-chan 2
Options:
-r, --root-dir DIRECTORY the path where data is
cached
-n, --neuropil-chan INTEGER Channel labeling the
neuropil (1 indexed)
-f, --fasii-chan INTEGER Channel labeling the FasII
tracts (1 indexed)
-e, --eve-chan INTEGER Channel labeling even
skipped (1 indexed)
--help Show this message and exit.
add-more-raw
Add more raw files to existing database
Usage: t6alh add-more-raw [OPTIONS] [RAW_FILES]...
Takes a list of microscopy files to add to the db. Uses
similar arguments to t6alh init
t6alh init /storage/1.czi /storage/2.czi --neuropil-chan 1 --fasii-chan 2
Options:
-n, --neuropil-chan INTEGER Channel labeling the
neuropil (1 indexed)
-f, --fasii-chan INTEGER Channel labeling the FasII
tracts (1 indexed)
-e, --eve-chan INTEGER Channel labeling even
skipped (1 indexed)
--help Show this message and exit.
segment-neuropil
Finds which pixels are neuropil
Usage: t6alh segment-neuropil [OPTIONS] [IMAGE_FOLDERS]...
Segments the neuropil labeling each pixel as 0 for not
neuropil and 1 for neuropil on a scaled down copy of the
image creates the file `neuropil-mask.nrrd`
t6alh segment_neuropil 001 002 --opening-size 2
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
-s, --new-scale FLOAT the output scale in um.
Default is 1. Negative
numbers are interpreted
as no new scale
-o, --opening-size FLOAT the size for which
smaller objects will be
removed. Default 2um
-g, --gamma FLOAT gamma correction for the
image. Default: 1
--help Show this message and
exit.
make-landmarks
Select brain, SEZ, and neuropil tip
Usage: t6alh make-landmarks [OPTIONS] [IMAGE_FOLDERS]...
Uses a image slicer to find landmarks on all segmented
images. Creates a `.landmarks` file. Requires `$DISPLAY`
to be set
t6alh make_landmarks 001 002
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
--help Show this message and
exit.
align
These commands are responsible for aligning the image first based on its neuropil mask, then based on its FasII stain<>
Usage: t6alh align [OPTIONS] [IMAGE_FOLDERS]...
Does a multi step alignment
t6alh align 001 002 -c 1 -c 2 -c 3 -c 4
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
-c, --channel INTEGER Channel can be allowed.
Multiple are supported
'-c 1 -c 2'
--help Show this message and
exit.
select-neuropil-fasii
Find the FasII image that is within the neuropil
Usage: t6alh select-neuropil-fasii [OPTIONS]
[IMAGE_FOLDERS]...
Creates an image where all of the pixels in the FasII
channel outside of `neuropil_mask.nrrd` are set to 0.
Saves this image as `neuropil_fasii.nrrd`
t6alh select-neuropil-fasii 001 002
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
--help Show this message and
exit.
landmark-register
Does a rigid registration using landmarks
Usage: t6alh landmark-register [OPTIONS]
[IMAGE_FOLDERS]...
uses `fit_affine_xform_landmarks` to register to the
template, creates a `landmark.xform` file describing the
transformation
t6alh landmark_register 001 002
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
--help Show this message and
exit.
mask-register
Aligns the image to the neuropil mask template
Usage: t6alh mask-register [OPTIONS] [IMAGE_FOLDERS]...
Uses `regiser` and `warp` to fit the registration from
each image to the mask template, creating
`affine_mask.xform` and `warp_mask.xform`, then uses
`reformatx` to reformat the fasII tracts creating
`mask_warped_fasii.nrrd`
t6alh mask-register 001 002
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
--help Show this message and
exit.
fasii-align
Aligns the image to the fasii template
Usage: t6alh fasii-align [OPTIONS] [IMAGE_FOLDERS]...
Aligns the image to the FasII template using `warp`
between the template and the mask-aligned image creating
'warp.xform', then registers each of the specified
channels to the complete warp making files following the
pattern `reformated_chanN.nrrd`
t6alh fasii-align 001 001 -c 1 -c 2 -c 3
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
-c, --channel INTEGER Channel can be allowed.
Multiple are supported
'-c 1 -c 2'
--help Show this message and
exit.
Template creation commands
These commands are necessary to make a template image. They depend on some Align commands being run.
landmark-align
Align based on landmarks
Usage: t6alh template landmark-align [OPTIONS]
[IMAGE_FOLDERS]...
Takes landmarks from `t6alh make-landmarks` to align
each image using `fit_affine_xform_landmarks` then
aligns the mask using `reformatx` to get
`landmark_reformat.nrrd`
t6alh template landmark-align 001 002 --target-grid 80,451,200:0.5,0.50,0.5
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
-l, --landmark-path FILE Landmarks for the
template image.
Reasonable default to
center a Drosophila VNC
-t, --target-grid TEXT target-grid parameter
passed to
reformatx.Reasonable
default to center a
Drosophila VNC: 80,451,20
0:0.5000,0.5000,0.5000
--help Show this message and
exit.
make-mask-template
Aligns and warps together landmark aligned neuropil masks into a template
Usage: t6alh template make-mask-template
[OPTIONS] [IMAGE_FOLDERS]...
Uses `iterative_shape_averaging` to align and warp
together `landmark_reformat.nrrd` to create
`template/mask_template.nrrd`
t6alh template make-mask-template 001 002 003 004
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
--help Show this message and
exit.
fasii-template
Aligns and warps together
Usage: t6alh template fasii-template [OPTIONS]
[IMAGE_FOLDERS]...
Uses a iterative process to warp and
`mask_warped_fasii.nrrd` images created by `t6alh mask-
register` into a final template. Creates the file
`template/fasii_template.nrrd`. Caches intermediate
results, since this command takes a long time to run
t6alh template fasii-template 001 002 005
Options:
-f, --image-folders-file FILE A text file with all of
the folder names. An
alternative to [IMAGE-
FOLDERS]
--help Show this message and
exit.
Miscellaneous commands
These commands are not necessary to make or align to a template, but they still may be helpful
get-paths
Informs user about file locations
Usage: t6alh get-paths [OPTIONS]
prints relevant paths as a json file
t6alh get-paths
Options:
--help Show this message and exit.
clean
Resets database to which images exist on disk
Usage: t6alh clean [OPTIONS]
removes all files from database which are no longer on
the disk
t6alh clean
Options:
--help Show this message and exit.
view
View the image
Usage: t6alh view [OPTIONS] [IMAGES]...
Displays the image (or a low resolution version of the
image) on a slicer. $DISPLAY must be set
t6alh view -s 0.1 image.nrrd
Options:
-g FLOAT Gamma correction. Default=1
-s FLOAT scale ratio. 0.5 means half as many pixels in
each axis
--help Show this message and exit.