m2m_crossing_finder

Find crossing regions (ROIs) between Allen Mouse Brain Connectivity experiments. Experiments are found by search in the Allen Mouse Brain Connectivity API giving two or three User Data Space (UDS) voxel coordinates.

  • Generate projection density maps for each experiment. Maps are downloaded from the Allen Mouse Brain Connectivity API.

  • Generate a RGB projection density volume combining each experiments founded. (–red, –green, –blue). At least two colors (coordinates) are mandatory.

  • Generate a mask at crossing regions if projection density is superior to threshold (–threshold) for each experiment founded. Masks are download from Allen Mouse Brain Altas.

  • Generate a json file enumarating each crossing regions.

All files are stored in a same folder.

Important: Select the same resolution as your matrix We higly recommend to work with high resolution (starting from 50) in order to search experiments more precisely.

2 colors:

Injection coordinate search: (–injection)

>>> m2m_crossing_finder.py path/to/.mat path/to/ref.nii.gz
    resolution --red x y z --green x y z --injection --dir dir

Spatial search: (–spatial):

>>> m2m_crossing_finder.py path/to/.mat path/to/ref.nii.gz
    resolution --red x y z --green x y z --spatial --dir dir

3 colors:

>>> m2m_crossing_finder.py path/to/.mat path/to/ref.nii.gz
    resolution --red x y z --green x y z --blue x y z --injection --dir dir

usage: m2m_crossing_finder.py [-h] --red RED RED RED --green GREEN GREEN GREEN
                              [--blue BLUE BLUE BLUE]
                              (--injection | --spatial)
                              [--threshold THRESHOLD] [-d DIR] [-c] [-f]
                              file_mat reference {10,25,50,100}

Positional Arguments

file_mat

Path to transform matrix (.mat)

reference

Path to reference volume (.nii.gz)

res

Possible choices: 10, 25, 50, 100

Resolution (in micron) of the Allen files Please use the same resolution as the transformation matrix.

Named Arguments

--red

UDS voxels coordinates of first experiment. First experiment will be colored in red.

--green

UDS voxels coordinates of second experiment. Second experiment will be colored in green.

--blue

UDS voxels coordinates of third experiment. Third experiment will be colored in blue.

--injection

Use experiment_injection_coordinate_search to find experiments. https://allensdk.readthedocs.io/en/latest/allensdk.api.queries.mouse_connectivity_api.html

Default: False

--spatial

Use experiment_spatial_search to find experiments. https://allensdk.readthedocs.io/en/latest/allensdk.api.queries.mouse_connectivity_api.html

Default: False

--threshold

Combined projection density threshold for finding masks of crossing ROIs. Threshold is 0.10 by default. –threshold <value> will set threshold to value.

Default: 0.1

-d, --dir

Path of the ouptut file directory is . by default. Using –dir <dir> will change the output file’s directory or create a new one if does not exits.

Default: “.”

-c, --nocache

Update the Allen Mouse Brain Connectivity Cache

Default: False

-f

Force overwriting of the output files.

Default: False

Author : Mahdi