nipoppy.tabular.doughnut

Class for the doughnut file.

Module Contents

class nipoppy.tabular.doughnut.Doughnut(*args, session_ids=None, visit_ids=None, **kwargs)

Bases: nipoppy.tabular.manifest.Manifest

A dataset’s doughnut, for tracking DICOM-to-BIDS conversion status.

col_in_bids = 'in_bids'
col_in_raw_imaging = 'in_raw_imaging'
col_in_sourcedata = 'in_sourcedata'
col_participant_dicom_dir = 'participant_dicom_dir'
index_cols
model
status_cols
get_bidsified_participants_sessions(participant_id=None, session_id=None)

Get participants and sessions with BIDS data.

Parameters:
  • participant_id (Optional[str])

  • session_id (Optional[str])

get_downloaded_participants_sessions(participant_id=None, session_id=None)

Get participants and sessions with downloaded data.

Parameters:
  • participant_id (Optional[str])

  • session_id (Optional[str])

get_organized_participants_sessions(participant_id=None, session_id=None)

Get participants and sessions with organized data.

Parameters:
  • participant_id (Optional[str])

  • session_id (Optional[str])

get_status(participant_id, session_id, col)

Get one of the statuses for an existing record.

Parameters:
  • participant_id (str)

  • session_id (str)

  • col (str)

Return type:

bool

set_status(participant_id, session_id, col, status)

Set one of the statuses for an existing record.

Parameters:
Return type:

typing_extensions.Self

class nipoppy.tabular.doughnut.DoughnutModel(/, **data)

Bases: nipoppy.tabular.manifest.ManifestModel

An internally- or user-generated file to keep track of the BIDS conversion process.

Should contain exactly the same data as the manifest, with some additional columns.

Note: This class is called “model” to be consistent with Pydantic nomenclature, but it can be thought of as a schema for each row in the doughnut file.

Parameters:

data (Any)

in_bids: bool
in_raw_imaging: bool
in_sourcedata: bool
participant_dicom_dir: str
nipoppy.tabular.doughnut.generate_doughnut(manifest, dicom_dir_map, dpath_downloaded=None, dpath_organized=None, dpath_bidsified=None, empty=False, logger=None)

Generate a doughnut object.

Parameters:
Return type:

Doughnut

nipoppy.tabular.doughnut.update_doughnut(doughnut, manifest, dicom_dir_map, dpath_downloaded=None, dpath_organized=None, dpath_bidsified=None, empty=False, logger=None)

Update an existing doughnut file.

Parameters:
Return type:

Doughnut