Note
Go to the end to download the full example code.
3D DCE-MRI in the liver#
Fit a linear 2-compartment model to a 3D DCE dataset.
Note: this is a large real-world dataset, and the computation may
take several hours. In order to test this with a smaller dataset,
you can use the DCE_small
dataset.
Setup#
import os
import time
import shutil
import numpy as np
import mdreg
# We use zarray data in this example
data = mdreg.fetch_zarr('DCE')
# Variables used in this script
tacq = data.attrs['time']
aif = data.attrs['aif']
spacing = data.attrs['spacing']
t0, t1 = 100, 150
# Path for output
results_path = os.path.join(os.getcwd(), 'tmp')
# Check the data
anim = mdreg.plot.animation(
data[:, :, :, t0:t1],
title='DCE Data',
vmin=0,
vmax=0.9*np.max(data[...,0]),
)