Maintenance Notice

Due to necessary scheduled maintenance, the JMIR Publications website will be unavailable from Wednesday, July 01, 2020 at 8:00 PM to 10:00 PM EST. We apologize in advance for any inconvenience this may cause you.

Who will be affected?

Currently submitted to: JMIR Medical Informatics

Date Submitted: Apr 29, 2026
Open Peer Review Period: May 13, 2026 - Jul 8, 2026
(currently open for review)

Warning: This is an author submission that is not peer-reviewed or edited. Preprints - unless they show as "accepted" - should not be relied on to guide clinical practice or health-related behavior and should not be reported in news media as established information.

An Open-Source Python MRI Viewer for Volumetric Brain Imaging Education in Radiology: Tutorial

  • Amy Avakian; 
  • Arman Mansourian

ABSTRACT

Background:

Background. Radiologists routinely interpret volumetric imaging studies in clinical picture archiving and communication systems (PACS), but few have direct experience with the raw data formats, programming libraries, and code-based tools that underlie the artificial intelligence (AI) systems they are increasingly asked to evaluate and deploy. Recent multi-institutional surveys demonstrate that radiology residents favor inclusion of formal AI and machine learning instruction in residency curricula and prefer hands-on learning over lectures alone, yet most existing curricula remain didactic. Open-source tools that lower the technical barrier to volumetric image manipulation are needed to support this shift toward applied informatics literacy.

Objective:

Objective. This tutorial describes the design, implementation, and educational application of a lightweight, browser-executable Python-based magnetic resonance imaging (MRI) viewer intended to introduce radiology trainees, medical students, and AI researchers to volumetric data structures and code-based image manipulation. The objective is to lower the technical and infrastructural barrier to imaging informatics literacy through a reproducible, open-source, openly licensed tool that requires no local software installation.

Methods:

Methods. The viewer was implemented in Python 3.13 using NiBabel for Neuroimaging Informatics Technology Initiative (NIfTI) parsing, NumPy for array manipulation, Plotly for interactive grayscale slice rendering, and scikit-image for marching cubes surface extraction. The tool comprises two modules: a scroll-based 2D slice viewer with axial, sagittal, and coronal navigation, and a 3D mesh viewer for volumetric surface visualization. The publicly available Stanford Artificial Intelligence in Medicine and Imaging (AIMI) Brain Metastasis dataset was used as the volumetric data source. The complete tool was deployed in a Google Colab cloud notebook to remove local installation requirements.

Results:

Results. The viewer loads NIfTI-formatted MRI volumes (256 × 256 × 150 voxels) and renders interactive multiplanar grayscale slices with mouse-scroll and button-based navigation, replicating the slice-traversal experience of clinical PACS without requiring DICOM infrastructure or proprietary software. The 3D mesh module uses an intensity-thresholded marching cubes isosurface to produce a rotatable volumetric rendering. The complete codebase, including the data loading workflow, viewer modules, and design rationale, is available as an interactive Colab notebook accessible through any modern web browser.

Conclusions:

Conclusions. This tutorial provides radiologists, trainees, and imaging researchers with a code-level entry point into volumetric data manipulation. By using openly licensed libraries and a publicly available dataset, the viewer supports reproducible educational deployment, prototyping for downstream AI workflows, and interdisciplinary collaboration between radiologists and developers. Limitations include the absence of DICOM workflow support, formal usability evaluation, and segmentation or registration capability.


 Citation

Please cite as:

Avakian A, Mansourian A

An Open-Source Python MRI Viewer for Volumetric Brain Imaging Education in Radiology: Tutorial

JMIR Preprints. 29/04/2026:99842

DOI: 10.2196/preprints.99842

URL: https://preprints.jmir.org/preprint/99842

Download PDF


Request queued. Please wait while the file is being generated. It may take some time.

© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.