Skip to content

mathworks/MRI-Reconstruction-in-MATLAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MRI Volume

MRI Reconstruction in MATLAB

Open in MATLAB Online View MRI-Reconstruction-in-MATLAB on File Exchange

Overview

Welcome to the MRI Reconstruction in MATLAB® repository! This project showcases three effective examples of MRI reconstruction algorithms using raw k-space brain image data [1] as input. Each example is designed to leverage GPU capabilities for rapid prototyping and easy deployment in production. Additionally, these examples support CI/CD integration for automated testing and verification, and can be incorporated into an IEC 62304 -compliant medical software development workflow*.

Features

1. IFFT-Based Algorithm

  • Description: This algorithm uses the Inverse Fast Fourier Transform (IFFT) to reconstruct MRI images from full k-space data, providing a baseline for comparison with more sophisticated methods.

2. Wavelet-Based Algorithm (Compressed Sensing)

  • Description: Utilizing wavelet transforms, this algorithm implements a compressed sensing approach using under-sampled k-space data to enhance image reconstruction speed without compromising the quality.

3. Deep Learning-Based Algorithm (U_Net)

Description: Employing a U_Net architecture, this algorithm uses a deep learning technique with under-sampled k-space data to showcase a modern approach for MRI reconstruction.

Highlights

Rapid Prototyping and Deployment

• GPU-Enabled: Optimized for GPU acceleration for fast prototyping as well as automatic CUDA code generation for deployment.

• Ease of Use: Designed for straightforward experimentation with easy-to-use apps for visualization and testing.

Automated Testing and Verification

• CI/CD Integration: Enabled for use in continuous integration and continuous deployment pipelines for automated testing and verification*.

• IEC 62304 Certification: The algorithms can be incorporated into a IEC 62304 -compliant medical software development workflow*.

*. Requires additional products

Getting Started

Prerequisites

You will need MATLAB release R2025a or newer and the following MathWorks Products to run these examples.

Parallel Computing Toolbox

MATLAB Coder

GPU Coder

Medical Imaging Toolbox

Deep Learning Toolbox

Image Processing Toolbox

Wavelet Toolbox

Computer Vision Toolbox

Installation

  1. Clone the repository: git clone https://github.com/mathworks/MRI-Reconstruction-in-MATLAB.git
  2. Navigate to the project directory:cd MRI-Reconstruction-in-MATLAB
  3. Open MATLAB and add the project directory to the path: addpath(genpath('path_to_project_directory'))

Usage

  1. Navigate to the MRI_Project/scripts folder. There are two folders available for different intentions:

  2. Testing Different MRI Reconstruction Examples: Check the folder: 01_Example_Scripts

  3. Run the startup.m file first. It will download the dataset from support files and create the necessary folder structure to run the MRI reconstruction examples.

   Run the desired algorithm script:

   • Exp1_IFFT_MRI.mlx for IFFT-based reconstruction.

   • Exp2_CS_MRI.mlx for wavelet-based reconstruction.

   • Exp3_DL_MRI.mlx for deep learning-based reconstruction.

  1. Running MRI Reconstruction Examples on GPU and Generating CUDA Code:       Check the folder: 02_GPU_Support_Scripts

Run the demoScript.mlx, which provides options to run all three examples on GPU or CPU. Furthermore, the script allows to automatically generate CUDA code of all three examples.

Reference

[1] Lyu, M., Mei, L., Huang, S. et al. M4Raw: A multi-contrast, multi-repetition, multi-channel MRI k-space dataset for low-field MRI research. Sci Data 10, 264 (2023). https://doi.org/10.1038/s41597-023-02181-4

License

The license is available in license.txt file in this GitHub repository.

Copyright 2025 The MathWorks, Inc.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages