Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add Olfactory bulb #19

Merged
merged 9 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "olfactory_bulb",
"query": "MOB",
"attribute": "acronym",
"with_descendants": true

},
"layers": {
"names": ["MOBgl", "MOBopl", "MOBmi", "MOBipl", "MOBgr"],
"queries": ["MOBgl", "MOBopl", "MOBmi", "MOBipl", "MOBgr"],
"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"`{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,
)
Loading