Skip to main content

GeneRalized Autocalibrating Partially Parallel Acquisitions.

Project description

Installation

pip install pygrappa

Usage

The function is called with undersampled k-space data and calibration data (usually a fully sampled portion of the center of k-space). The unsampled points in k-space should be exactly 0:

from pygrappa import grappa

sx, sy, ncoils = kspace.shape[:]
cx, cy, ncoils = calib.shape[:]
res = grappa(kspace, calib, kernel_size=(5, 5), coil_axis=-1)
sx, sy, ncoils = res.shape[:]

If calibration data is in the k-space data, simply extract it:

from pygrappa import grappa

sx, sy, ncoils = kspace.shape[:] # center 20 lines are ACS
ctr, pd = int(sy/2), 10
calib = kspace[:, ctr-pd:ctr+pad, :].copy()
res = grappa(kspace, calib, kernel_size=(5, 5), coil_axis=-1)
sx, sy, ncoils = res.shape[:]

Also see the examples module.

A very similar experimental GRAPPA implementation with the same interface can be called:

from pygrappa import cgrappa
res = cgrappa(kspace, calib, kernel_size=(5, 5), coil_axis=-1)

This function uses much of the same code as the Python grappa() implementation, but has certain parts written in C++ and all compiled using Cython. It runs about twice as fast but is considered experimental.

About

GRAPPA is a popular parallel imaging reconstruction algorithm. Unfortunately there aren’t a lot of easy to use Python implementations available, so I decided to release this simple one.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygrappa-0.3.7.tar.gz (142.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page