nipoppy.tabular.dicom_dir_map.DicomDirMap

class nipoppy.tabular.dicom_dir_map.DicomDirMap(*args, **kwargs)

A dataset’s DICOM directory mapping.

This mapping is used during DICOM reorganization and curation status file generation.

get_dicom_dir(participant_id, session_id)

Return the participant’s raw DICOM directory for a given session.

Parameters:
  • participant_id (str) – Participant ID, without the BIDS prefix

  • session_id (str) – Session, with the BIDS prefix

Return type:

str

classmethod load_or_generate(manifest, fpath_dicom_dir_map, participant_first, validate=True)

Load or generate a DicomDirMap instance.

Parameters:
  • manifest (nipoppy.tabular.manifest.Manifest) – Manifest for generating the mapping (not used if fpath_dicom_dir_map is not None).

  • fpath_dicom_dir_map (str | Path | None) – Path to a custom DICOM directory mapping file. If None, the DICOM directory mapping will be generated from the manifest.

  • participant_first (bool) – Whether the generated uses <PARTICIPANT>/<SESSION> order (True) or <SESSION>/<PARTICIPANT> (False). Not used if fpath_dicom_dir_map is not None

  • validate (bool, optional) – Whether to validate (through Pydantic) the created object, by default True

Return type:

nipoppy.tabular.dicom_dir_map.DicomDirMap

col_participant_dicom_dir = 'participant_dicom_dir'
col_participant_id = 'participant_id'
col_session_id = 'session_id'
index_cols
model

Model class associated with the tabular data.