Observed since 21 Oct, 11:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
MRI utilities library for aind teams.
MRI utilities library for aind teams.
pip install aind-mri-utils
For development, clone the repository and run:
git clone https://github.com/AllenNeuralDynamics/aind-mri-utils
cd aind-mri-utils
uv sync
# Arc angle conversions for probe positioning systems
from aind_mri_utils.arc_angles import vector_to_arc_angles, arc_angles_to_vector
probe_vector = [0.0, 0.5, -0.866] # 30° from vertical
arc_angles = vector_to_arc_angles(probe_vector) # → (30.0, 0.0)
# Reticle calibration from measurement data
from aind_mri_utils.reticle_calibrations import fit_rotation_params_from_parallax
calibration_file = "path/to/parallax_measurements.xlsx"
rotation_params = fit_rotation_params_from_parallax(calibration_file)
# Chemical shift correction for MRI images
from aind_mri_utils.chemical_shift import compute_chemical_shift
import SimpleITK as sitk
mri_image = sitk.ReadImage("brain_scan.nii")
shift_vector = compute_chemical_shift(mri_image, ppm=3.5, mag_freq=599.0)
# 3D geometric measurements
from aind_mri_utils.measurement import find_circle, dist_point_to_line
circle_center, radius = find_circle(measurement_points)
distance = dist_point_to_line(point, line_start, line_end)
# Medical image I/O
from aind_mri_utils.file_io import read_dicom, write_nii
dicom_volume = read_dicom("dicom_folder/")
write_nii(processed_volume, "output.nii")
Please test your changes using the full linting and testing suite:
./scripts/run_linters_and_checks.sh -c
Or run individual commands:
uv run --frozen ruff format # Code formatting
uv run --frozen ruff check # Linting
uv run --frozen mypy # Type checking
uv run --frozen interrogate -v src # Documentation coverage
uv run --frozen codespell --check-filenames # Spell checking
uv run --frozen pytest --cov aind_mri_utils # Tests with coverage
For internal members, please create a branch. For external members, please fork the repository and open a pull request from the fork. We use Angular style commit messages, roughly:
<type>(<scope>): <short summary>
where scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:
This project is licensed under the MIT License - see the LICENSE file for details.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.13.1 | 1 Jul 2026 | 10 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 11:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:13b13d8977ad022ac36cf73d89d796d7fa454c5627d6bb954f0639b918a36240