Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Rework architecture specific to BIDS and CAPS dataset #1453

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

NicolasGensollen
Copy link
Member

Closes #1448

Following #1443, this PR continues the re-organization of the code relative to iotools and converters. More precisely, it targets the code handling BIDS and CAPS datasets which is scattered across the code base (some in clinica.converters, some in clinica.iotools, some in clinica.utils...).

The base idea of this PR is to regroup all this code in a separate module called clinica.datasets (name can change if needed). This module has all the logic related to BIDS and CAPS datasets (validation, queries, writing, parsing...).
The logic specific to BIDS datasets is in the clinica.datasets.bids submodule while the logic specific to CAPS is in clinica.dataset.caps. Logic handling both is in clinica.datasets.

Going through these pieces of code, it seems we have a lot of small functions doing more or less the same things, and sometimes in ways that we don't need anymore. An example is the functions trying to guess whether a folder is a BIDS or CAPS dataset by doing some heuristic checks. Since the introduction of the MANDATORY dataset_description.json file for both types of datasets, we don't need to guess anymore, we have the information written in the metadata, so we "just" need to parse it.

This is still ongoing work, lots of tests are broken at the moment...

@NicolasGensollen NicolasGensollen self-assigned this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve architecture of clinica.iotools and clinica.converters
1 participant