Skip to content

Commit

Permalink
Feat: Add olfactory bulb
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Feb 1, 2024
1 parent 40a4184 commit 49f302e
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
15 changes: 15 additions & 0 deletions atlas_placement_hints/app/metadata/olfactory_bulb_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"region": {
"name": "Main olfactory bulb",
"query": "MOB",
"attribute": "acronym",
"with_descendants": true

},
"layers": {
"names": ["MOBgl", "MOBgr", "MOBipl", "MOBmi", "MOBopl"],
"queries": ["MOBgl", "MOBgr", "MOBipl", "MOBmi", "MOBopl"],
"attribute": "acronym",
"with_descendants": false
}
}
57 changes: 57 additions & 0 deletions atlas_placement_hints/app/placement_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,60 @@ def thalamus(
output_dir,
has_hemispheres=True,
)


@app.command()
@verbose_option
@common_atlas_options
@click.option(
"--metadata-path",
type=EXISTING_FILE_PATH,
required=False,
help=(
"(Optional) Path to the metadata json file. Defaults to "
f"`{str(METADATA_REL_PATH / 'olfactory_bulb_metadata.json')}`"
),
default=str(METADATA_PATH / "olfactory_bulb_metadata.json"),
)
@click.option(
"--direction-vectors-path",
type=EXISTING_FILE_PATH,
required=True,
help=("Path to the olfactory bulb direction vectors file, e.g., `direction_vectors.nrrd`."),
)
@click.option(
"--output-dir",
required=True,
help="path of the directory to write. It will be created if it doesn't exist.",
)
@log_args(L)
def olfactory_bulb(
verbose, annotation_path, hierarchy_path, metadata_path, direction_vectors_path, output_dir
):
"""Generate and save the placement hints of the mouse olfactory bulb.
Placement hints are saved under the names sepecified in
`app/metadata/olfactory_bulb_metadata.json`.
Default to:
\b
- `[PH]y.nrrd`
- `[PH]MOBgl.nrrd`, `[PH]MOBgr.nrrd`, `[PH]MOBipl.nrrd`, `[PH]MOBmi.nrrd`, `[PH]MOBopl.nrrd`,
A report together with an nrrd volume on problematic distance computations are generated
in `output_dir` under the names:
\b
- `distance_report.json`
- `<olfactory_bulb>_problematic_voxel_mask.nrrd` (mask of the voxels for which the computed
placement hints cannot be trusted). <olfactory_bulb> is the region name specified in
olfactory_bulb_metadata.json. Defaults to "olfactory_bulb".
The annotation file can contain the olfactory_bulb or a superset.
For the algorithm to work properly, some space should separate the boundary
of the olfactory_bulb from the boundary of its enclosing array.
"""
set_verbose(L, verbose)

atlas = _create_layered_atlas(annotation_path, hierarchy_path, metadata_path)
_placement_hints(
atlas,
direction_vectors_path,
output_dir,
has_hemispheres=True,
)

0 comments on commit 49f302e

Please sign in to comment.