Gist 5c36e7318dd5c85aa743
✓ Published0🌍 Public
Aakeshavan
Last edited Oct 11, 2014
Created on Oct 11, 2014
This visualization displays a 16-slice mosaic of brain MRI scans across three orthogonal planes (x, y, z), with yellow contour lines outlining anatomical labels from a segmentation. The code loads NIfTI brain images and masks via nibabel, masks background data with NumPy masked arrays, and uses nipy’s `plot_anat` and `contour_map` to render slices with matplotlib subplots. It computes bounding boxes from the affine transformation to select meaningful cut coordinates, then arranges the slices in 4×4 grids per plane. The function supports optional contouring and saving each mosaic as a PNG image.
AI-generated description