aslprep.utils.asl module

Functions for working with ASL data.

determine_multi_pld(metadata)[source]

Determine if a run is multi-delay or not.

Parameters:

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

Returns:

True if the data are multi-delay/TI. Fale if not.

Return type:

bool

estimate_labeling_efficiency(metadata)[source]

Estimate labeling efficiency based on the available metadata.

Parameters:

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

Returns:

labeleff – Labeling efficiency.

Return type:

float

Notes

If LabelingEfficiency is defined in the metadata, then this value will be used. Otherwise, efficiency will be estimated based on the ASL type and number of background suppression pulses (if any). PCASL and PASL values come from Alsop et al.[1]. The CASL value comes from Wang et al.[2]. The adjustment based on number of background suppression pulses is not described in any papers, as far as we know, but is apparently widely used.

References

get_bolus_duration(metadata: dict[str, Any], is_casl: bool) float[source]

Determine the appropriate bolus duration for BASIL.

For PASL data, the bolus cutoff delay is the first BolusCutOffDelayTime. For (P)CASL data, it is the labeling duration.

Parameters:
  • metadata (dict) – Dictionary of metadata associated with ASL file.

  • is_casl (bool) – True if the data are (P)CASL. False if the data are PASL.

Returns:

bolus – The bolus value.

Return type:

float

get_inflow_times(metadata: dict[str, Any], is_casl: bool) list[source]

Determine the appropriate inflow times for BASIL.

For PASL data, the inflow time (TI) is just the post-labeling delay (PLD). For (P)CASL data, TI is PLD plus the labeling duration.

Parameters:
  • metadata (dict) – Dictionary of metadata associated with ASL file.

  • is_casl (bool) – True if the data are (P)CASL. False if the data are PASL.

Returns:

1D array of PostLabelingDelay values.

Return type:

numpy.ndarray

pcasl_or_pasl(metadata)[source]

Determine if metadata indicates a PCASL or ASL scan.

reduce_metadata_lists(metadata, n_volumes, keep_idx)[source]

Reduce any volume-wise metadata fields to only contain values for selected volumes.

select_processing_target(aslcontext)[source]

Determine how to handle ASL and M0 data based on dataset configuration.