"""Module containing property descriptors for brainglobe-atlasapi."""
from pathlib import Path
from typing import List, Tuple, TypeAlias
import numpy as np
import numpy.typing as npt
# Default remote: an "s3://bucket/prefix" with no trailing slash.
DEFAULT_REMOTE = "s3://brainglobe/atlas"
# Cache directory reserved for DEFAULT_REMOTE. Every other remote is
# cached under the last segment of its URL.
DEFAULT_REMOTE_KEY = "brainglobe-atlasapi"
ATLAS_ASSETS_REMOTE = "s3://allen-atlas-assets"
# Config label for ATLAS_ASSETS_REMOTE.
ATLAS_ASSETS_REMOTE_KEY = "allen-atlas-assets"
# Written at the top of each cache directory, holding the full remote
# it mirrors.
REMOTE_FILENAME = "remote.txt"
# Path templates on the BrainGlobe bucket only, for callers that never use
# another remote (atlas generation, last_versions.conf):
remote_url_s3 = DEFAULT_REMOTE + "/{}"
remote_url_s3_http = "https://brainglobe.s3.us-west-2.amazonaws.com/atlas/{}"
# Major version of atlases used by current brainglobe-atlasapi release:
ATLAS_MAJOR_V = 0
# Supported resolutions:
RESOLUTION = ["nm", "um", "mm"]
# Entries and types from this template will be used to check atlas info
# consistency. Please keep updated both this and the function when changing
# the structure.
# If the atlas is unpublished, specify "unpublished" in the citation.
METADATA_TEMPLATE = {
"name": "source_species_additional-info",
"citation": "Someone et al 2020, https://doi.org/somedoi",
"atlas_link": "http://www.example.com",
"species": "Gen species",
"symmetric": False,
"resolution": [1.0, 1.0, 1.0],
"orientation": "asr",
"shape": [100, 50, 100],
"version": "0.0",
"additional_references": [],
}
# Template for a structure dictionary:
STRUCTURE_TEMPLATE = {
"acronym": "root",
"id": 997,
"name": "root",
"structure_id_path": [997],
"rgb_triplet": [255, 255, 255],
}
# File and directory names for the atlas package:
METADATA_FILENAME = "metadata.json"
STRUCTURES_FILENAME = "structures.json"
REFERENCE_FILENAME = "reference.tiff"
ANNOTATION_FILENAME = "annotation.tiff"
HEMISPHERES_FILENAME = "hemispheres.tiff"
MESHES_DIRNAME = "meshes"
# V3 file names
V3_ATLAS_ROOTDIR = "atlases"
V3_ANNOTATION_ROOTDIR = "annotation-sets"
V3_COORDINATE_SPACE_ROOTDIR = "coordinate-spaces"
V3_TEMPLATE_ROOTDIR = "templates"
V3_TERMINOLOGY_ROOTDIR = "terminologies"
V3_TERMINOLOGY_NAME = "terminology.csv"
V3_MESHES_DIRECTORY = "annotations.precomputed/mesh"
V3_TEMPLATE_NAME = "template.ome.zarr"
V3_ANNOTATION_NAME = "annotations_compressed.ome.zarr"
V3_ANNOTATION_MASKS_NAME = "annotations.ome.zarr"
V3_ANNOTATION_MAP_NAME = "annotation_values"
V3_HEMISPHERES_NAME = "hemispheres.ome.zarr"
# Types for the atlas stacks:
REFERENCE_DTYPE = np.uint16
ANNOTATION_DTYPE = np.uint32
HEMISPHERES_DTYPE = np.uint8
ANNOTATION_MASKS_DTYPE = np.uint8
# Standard orientation origin: Anterior, Superior, Right
# (using brainglobe-space definition)
ATLAS_ORIENTATION = "asr"
# Type aliases
ValidComponentData: TypeAlias = (
str | Path | npt.NDArray | List[str | Path | npt.NDArray]
)
Resolution: TypeAlias = Tuple[int | float, int | float, int | float]
ResolutionList: TypeAlias = List[Resolution]