aslprep.utils.cbf module

Functions for calculating CBF.

estimate_att_pcasl(deltam_arr, plds, lds, t1blood, t1tissue)[source]

Estimate arterial transit time using the weighted average method.

The weighted average method comes from Dai et al.[1].

Parameters:
  • deltam_arr (numpy.ndarray of shape (S, D)) – Delta-M array, averaged by PLD.

  • plds (numpy.ndarray of shape (S, D)) – Post-labeling delays. w in Dai 2012. In case of a 2D acquisition, PLDs may vary by slice, and thus the plds array will vary in the spatial dimension. For 3D acquisitions, or 2D acquisitions without slice timing info, plds will only vary along the second dimension.

  • lds (numpy.ndarray) – Labeling durations. tau in Dai 2012.

  • t1blood (float) – T1 relaxation rate for blood.

  • t1tissue (float) – T1 relaxation rate for tissue.

Returns:

att_arr – Arterial transit time array.

Return type:

numpy.ndarray

Notes

This function was originally written in MATLAB by Jianxun Qu and William Tackett. It was translated to Python by Taylor Salo. Taylor Salo modified the code to loop over voxels, in order to account for slice timing-shifted post-labeling delays.

Please see https://shorturl.at/wCO56 and https://shorturl.at/aKQU3 for the original MATLAB code.

The code could probably be improved by operating on arrays, rather than looping over voxels. It is also overkill for 3D acquisitions, where PLD doesn’t vary by voxel.

License

MIT License

Copyright (c) 2023 willtack

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

References

estimate_cbf_pcasl_multipld(deltam_arr, scaled_m0data, plds, tau, labeleff, t1blood, t1tissue, unit_conversion, partition_coefficient)[source]

Estimate CBF and ATT for multi-delay PCASL data.

Parameters:
  • deltam_arr (numpy.ndarray of shape (S, P)) – Control-label values for each voxel and PLDs. S = sample (i.e., voxel). P = Post-labeling delay (i.e., volume).

  • scaled_m0data (numpy.ndarray of shape (S,)) – The M0 volume, after scaling based on the M0-scale value.

  • plds (numpy.ndarray of shape (S, P)) – Post-labeling delays. One value for each volume in deltam_arr.

  • tau (numpy.ndarray of shape (P,) or (0,)) – Label duration. May be a single value or may vary across volumes/PLDs.

  • labeleff (float) – Estimated labeling efficiency.

  • t1blood (float) – The longitudinal relaxation time of blood in seconds.

  • t1tissue (float) – The longitudinal relaxation time of tissue in seconds.

  • unit_conversion (float) – The factor to convert CBF units from mL/g/s to mL/ (100 g)/min. 6000.

  • partition_coefficient (float) – The brain/blood partition coefficient in mL/g. Called lambda in the literature.

Returns:

  • att_arr (numpy.ndarray of shape (S,)) – Arterial transit time map.

  • cbf (numpy.ndarray of shape (S,)) – Estimated cerebrospinal fluid map, after estimating for each PLD and averaging across PLDs.

Notes

Delta-M values are first averaged over time for each unique post-labeling delay value.

Arterial transit time is estimated on a voxel-wise basis according to Dai et al.[1].

CBF is then calculated for each unique PLD value using the mean delta-M values and the estimated ATT.

CBF is then averaged over PLDs according to Juttukonda et al.[2], in which an unweighted average is calculated for each voxel across all PLDs in which PLD + tau > ATT.

References

estimate_t1(metadata)[source]

Estimate the relaxation rates of blood and gray matter based on magnetic field strength.

t1blood is set based on the scanner’s field strength, according to Zhang et al.[3], Alsop et al.[4]. If recommended values from these publications cannot be used (i.e., if the field strength isn’t 1.5T, 3T, 7T), then the formula from Zhang et al.[3] will be applied.

t1tissue is set based on the scanner’s field strength as well, according to Wright et al.[5]. At the moment, field strengths other than 1.5T, 3T, and 7T are not supported and will raise an exception.

Parameters:

metadata (dict) – Dictionary of metadata from the ASL file.

Returns:

  • t1blood (float) – Estimated relaxation rate of blood based on magnetic field strength.

  • t1tissue (float) – Estimated relaxation rate of gray matter based on magnetic field strength.

References