cmind.pipeline.cmind_T1map_fit

Functions

T1fit_err(p, y, x[, TR, absflag]) Return error in the T1 data fit
T1recovery_func(p, t[, TR, absflag]) Generate a T1 recovery curve corresponding to the parameters in p
cmind_T1map_fit(output_dir, T1concat_file, ...) Fit T1 values to multi TI T1EST data
cmind.pipeline.cmind_T1map_fit.T1fit_err(p, y, x, TR=None, absflag=True)[source]

Return error in the T1 data fit

Parameters:

p : list or tuple

fitted parameters (M0, T1, alpha)

y : ndarray

true data

x : ndarray

array of TI values

absflag : bool

True if fitting absolute magnitude T1 recovery data

Returns:

fit_error : ndarray

error between the data, y, and the fitted T1 recovery curve

cmind.pipeline.cmind_T1map_fit.T1recovery_func(p, t, TR=None, absflag=True)[source]

Generate a T1 recovery curve corresponding to the parameters in p

Parameters:

p : list or tuple

fitted parameters (M0, T1, alpha)

t : ndarray

array of TI values

TR : float, optional

repetition time, TR (seconds)

absflag : bool, optional

True if fitting absolute magnitude T1 recovery data

Returns:

y : ndarray

T1 recovery curve corresponding to the parameters in p

cmind.pipeline.cmind_T1map_fit.cmind_T1map_fit(output_dir, T1concat_file, TIvals_file, mask_file=None, auto_discard=True, nmax_discards=3, show_plots=False, generate_figures=True, ForceUpdate=False, verbose=False, logger=None)[source]

Fit T1 values to multi TI T1EST data

Parameters:

output_dir : str

directory in which to store the output

T1concat_file : str

file containing the 4D concatenated T1EST files (from cmind_T1map_preprocess.py)

TIvals_file : str

text file listing the TI times corresponding to the images in T1concat_file

mask_file : str, optional

logical ndarray of location over which to perform the fit

auto_discard : bool, optional

if True, first fit a small subset of voxels and detect any TI points that are outliers

nmax_discards : int, optional

maximum number of outliers that will be allowed to be discarded via auto_discard.

show_plots : bool, optional

if False, suppress onscreen display of the plotted results

generate_figures : bool, optional

if true, generate additional summary images

ForceUpdate : bool, optional

if True, rerun and overwrite any previously existing results

verbose : bool, optional

print additional output (to terminal and log)

logger : logging.Logger or str, optional

logging.Logger object (or string of a filename to log to)

Returns:

T1_map_fname : str

filename of the T1 map image

I0_map_fname : str

filename of the I0 map (M0) image

T1_NRMSE_map_fname : str

filename of the normalized root mean squared error of the fits image

Notes

Performs T1 fits

../_images/IRC04H_06M008_P_1_T1_map_0pt5_to_3.png

T1 map

../_images/IRC04H_06M008_P_1_T1_NRMSE_map_0_to_0pt1.png

Normalized Root Mean Square Error (NRMSE) image