Warning: This document is for the development version of smriprep. The main version is master.

smriprep.utils.misc module

Self-contained utilities to be used within Function nodes.

smriprep.utils.misc.apply_lut(in_dseg, lut, newpath=None)[source]

Map the input discrete segmentation to a new label set (lookup table, LUT).

smriprep.utils.misc.fs_isRunning(subjects_dir, subject_id, mtime_tol=86400, logger=None)[source]

Checks FreeSurfer subjects dir for presence of recon-all blocking IsRunning files, and optionally removes any based on the modification time.

Parameters:
  • subjects_dir (os.PathLike or None) – Existing FreeSurfer subjects directory

  • subject_id (str) – Subject label

  • mtime_tol (int) – Tolerance time (in seconds) between current time and last modification of recon-all.log

Returns:

subjects_dir

Return type:

os.PathLike or None