nipoppy.layout

Dataset layout.

Module Contents

class nipoppy.layout.DatasetLayout(dpath_root, fpath_config=None)

Bases: nipoppy.base.Base

File/directory structure for a specific dataset.

Parameters:
  • dpath_root (nipoppy.env.StrOrPathLike)

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

dpath_descriptions()

Return a list of directory paths and associated description strings.

Return type:

list[Tuple[pathlib.Path, str]]

dpaths()

Return a list of all required directory paths.

Return type:

list[pathlib.Path]

fpaths()

Return a list of all required file paths.

Return type:

list[pathlib.Path]

get_dpath_bids_db(pipeline_name, pipeline_version, participant_id=None, session_id=None)

Return the path to a pipeline’s BIDS database directory.

Parameters:
  • pipeline_name (str)

  • pipeline_version (str)

  • participant_id (Optional[str])

  • session_id (Optional[str])

Return type:

pathlib.Path

get_dpath_pipeline(pipeline_name, pipeline_version)

Return the path to a pipeline’s directory.

Parameters:
  • pipeline_name (str)

  • pipeline_version (str)

Return type:

pathlib.Path

get_dpath_pipeline_output(pipeline_name, pipeline_version)

Return the path to a pipeline’s output directory.

Note: This path is the same given a pipeline name and version (i.e. does not depend on participant or session).

Parameters:
  • pipeline_name (str)

  • pipeline_version (str)

Return type:

pathlib.Path

get_dpath_pipeline_work(pipeline_name, pipeline_version, participant_id=None, session_id=None)

Return the path to a pipeline’s working directory.

Parameters:
  • pipeline_name (str)

  • pipeline_version (str)

  • participant_id (Optional[str])

  • session_id (Optional[str])

Return type:

pathlib.Path

get_full_path(path)

Build a full path from a relative path.

Parameters:

path (nipoppy.env.StrOrPathLike)

Return type:

pathlib.Path

get_paths(directory=True, include_optional=False)

Return a list of all directory or file paths.

Return type:

list[pathlib.Path]

validate()

Validate that all the expected paths exist.

Return type:

bool

class nipoppy.layout.DpathInfo(/, **data)

Bases: PathInfo

Relative path and description for a directory.

Parameters:

data (Any)

class nipoppy.layout.FpathInfo(/, **data)

Bases: PathInfo

Relative path and description for a file.

Parameters:

data (Any)

class nipoppy.layout.LayoutConfig(/, **data)

Bases: pydantic.BaseModel

Relative paths for the dataset layout.

Parameters:

data (Any)

dpath_assessments: DpathInfo
dpath_bids: DpathInfo
dpath_bids_db: DpathInfo
dpath_bids_ignore_patterns: DpathInfo
dpath_containers: DpathInfo
dpath_demographics: DpathInfo
dpath_derivatives: DpathInfo
dpath_descriptors: DpathInfo
dpath_downloads: DpathInfo
dpath_invocations: DpathInfo
dpath_logs: DpathInfo
dpath_proc: DpathInfo
dpath_pybids: DpathInfo
dpath_raw_imaging: DpathInfo
dpath_releases: DpathInfo
dpath_scratch: DpathInfo
dpath_sourcedata: DpathInfo
dpath_tabular: DpathInfo
dpath_tracker_configs: DpathInfo
fpath_config: FpathInfo
fpath_doughnut: OptionalFpathInfo
fpath_imaging_bagel: OptionalFpathInfo
fpath_manifest: FpathInfo
model_config
get_path_info(path_label)

Return the PathInfo object associated with the given path label.

Parameters:

path_label (str)

Return type:

PathInfo

path_infos()

Return a list of all PathInfo objects defined in the layout.

Return type:

list[PathInfo]

path_labels()

Return a list of all path labels defined in the layout.

Return type:

list[str]

class nipoppy.layout.OptionalFpathInfo(/, **data)

Bases: FpathInfo

Relative path and description for a file that is optional.

Parameters:

data (Any)

class nipoppy.layout.PathInfo(/, **data)

Bases: pydantic.BaseModel

Relative path and description for a directory or file.

Parameters:

data (Any)

description: str | None
path: pathlib.Path
nipoppy.layout.DEFAULT_LAYOUT_INFO