Skip to content

Ebrains Sibra Atlas Tool & DICOM Prepocessor #3

Open
tamara-kostova wants to merge 8 commits into
mainfrom
ebrains-sibra-tool
Open

Ebrains Sibra Atlas Tool & DICOM Prepocessor #3
tamara-kostova wants to merge 8 commits into
mainfrom
ebrains-sibra-tool

Conversation

@tamara-kostova

@tamara-kostova tamara-kostova commented Apr 29, 2026

Copy link
Copy Markdown
Owner
  • agents/sibra_tool.py - SiibraAtlasTool wrapping siibra-python (Julich-Brain v2.9). Takes the SAM3 binary mask centroid, converts pixel coordinates to MNI152 mm (via NIfTI affine → DICOM header → pixel fallback), and queries the EBRAINS probabilistic atlas to assign the lesion to a named cytoarchitectonic region (e.g. "Frontal-I (GapMap) left") with probability scores.
  • agents/dicom_tool.py - DICOMPreprocessor that accepts a single .dcm slice or a full series directory, normalises pixel arrays to PNG (ready for CNN/MedGemma), selects the representative mid-slice from multi-slice series, and extracts DICOM header metadata (ImagePositionPatient, PixelSpacing, etc.) injected into NeuroimagingState.
  • Pipeline wiring - atlas_enrichment node added to graph between sam3_segment and biomedclip. Result (assigned_region, hemisphere, mni_coords, assignment_scores) is forwarded to MedGemma's report prompt and
    serialised in FHIR output. NeuroimagingState extended with atlas_enrichment, dicom_metadata, and dicom_path fields.
  • utils/convert_h5.py - BraTS2020 h5-to-PNG+NIfTI converter. Stacks per-slice h5 files into a 3D volume with the known BraTS MNI152 affine, auto-selects the slice with most tumour content.
  • tests/test_atlas_enrichment.py - Standalone test for the atlas node; supports PNG-only, PNG+NIfTI, PNG+DICOM inputs and --output flag to save result JSON.

@tamara-kostova tamara-kostova changed the title Ebrains Sibra Atlas Tool Ebrains Sibra Atlas Tool & DICOM Prepocessor Apr 29, 2026
@tamara-kostova tamara-kostova marked this pull request as ready for review April 29, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant