aslprep.utils.misc module

Miscellaneous utilities.

check_deps(workflow)[source]

Make sure dependencies are present in this system.

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_n_volumes(fname)[source]

Get the number of volumes in a niimg file.

get_tis(metadata: dict[str, Any]) list[source]

Determine inversion times from metadata.

Parameters:

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

Returns:

List of PostLabelingDelay values.

Return type:

list

pcasl_or_pasl(metadata)[source]

Determine if metadata indicates a PCASL or ASL scan.

readjson(jsonfile)[source]

Read a JSON file into memory.

select_target(subject_id, space)[source]

Get the target subject ID, given a source subject ID and a target space.