nipoppy.workflows.dicom_reorg.DicomReorgWorkflow

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

Workflow for organizing raw DICOM files.

Parameters:
apply_fname_mapping(fpath_source, participant_id, session_id)

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

Prepend a short hash of the path to avoid filename collisions across DICOM series, while ensuring short filenames in nested directory structures.

Parameters:
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