Skip to content

Commit

Permalink
rework CAPS dataset_description.json
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGensollen committed Aug 6, 2024
1 parent 70d1a56 commit 2bf9fe8
Show file tree
Hide file tree
Showing 4 changed files with 650 additions and 95 deletions.
14 changes: 12 additions & 2 deletions clinica/pipelines/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,12 @@ def __init__(
try:
check_caps_folder(self._caps_directory)
except ClinicaCAPSError as e:
desc = build_caps_dataset_description(self._name, self._caps_directory)
desc = build_caps_dataset_description(
self._caps_directory,
self._caps_directory,
self._name,
f"subjects/*/*/{self._name}",
)
raise ClinicaCAPSError(
f"{e}\nYou might want to create a 'dataset_description.json' "
f"file with the following content:\n{desc}"
Expand All @@ -482,7 +487,12 @@ def __init__(
or len([f for f in self._caps_directory.iterdir()]) == 0
):
self._caps_directory.mkdir(parents=True, exist_ok=True)
write_caps_dataset_description(self._name, self._caps_directory)
write_caps_dataset_description(
self._bids_directory,
self._caps_directory,
self._name,
f"subjects/*/*/{self._name}",
)
check_caps_folder(self._caps_directory)
self._compute_subjects_and_sessions()
self._init_nodes()
Expand Down
Loading

0 comments on commit 2bf9fe8

Please sign in to comment.