nipoppy.workflows.DicomReorgWorkflow

class nipoppy.workflows.DicomReorgWorkflow(dpath_root, copy_files=False, check_dicoms=False, fpath_layout=None, verbose=False, dry_run=False)

Workflow for organizing raw DICOM files.

Parameters:
  • dpath_root (nipoppy.env.StrOrPathLike)

  • copy_files (bool)

  • check_dicoms (bool)

  • fpath_layout (Optional[nipoppy.env.StrOrPathLike])

  • verbose (bool)

  • dry_run (bool)

apply_fname_mapping(fpath_source, participant_id, session_id)

Apply a mapping from the original (full) file path to destination file name.

This method does not change the file name by default, but it can be overridden if the file names need to be changed during reorganization (e.g. for easier BIDS conversion).

Parameters:
  • fpath_source (nipoppy.env.StrOrPathLike)

  • participant_id (str)

  • session_id (str)

Return type:

str

get_fpaths_to_reorg(participant_id, session_id)

Get file paths to reorganize for a single participant and session.

Parameters:
  • participant_id (str)

  • session_id (str)

Return type:

list[pathlib.Path]

get_participants_sessions_to_run()

Return participant-session pairs to reorganize.

run_cleanup()

Clean up after main DICOM reorg part is run.

Specifically: - Write updated curation status file - Log a summary message

run_main()

Reorganize all downloaded DICOM files.

run_setup()

Update the curation status table in case it is not up-to-date.

run_single(participant_id, session_id)

Reorganize downloaded DICOM files for a single participant and session.

Parameters:
  • participant_id (str)

  • session_id (str)

check_dicoms = False
copy_files = False
n_success = 0
n_total = 0