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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

NicolasGensollen
Copy link
Member

@NicolasGensollen NicolasGensollen commented Mar 7, 2025

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.

@NicolasGensollen NicolasGensollen self-assigned this Mar 7, 2025
@NicolasGensollen NicolasGensollen force-pushed the clean-iotools-converters branch from 3e9c9b7 to d711d5b Compare March 10, 2025 08:57
@NicolasGensollen NicolasGensollen marked this pull request as ready for review March 10, 2025 12:36
@NicolasGensollen
Copy link
Member Author

Alright, looks like all tests are passing again.
@AliceJoubert sorry again for the large PR.
Let me know what you think when you have some time to make a review. Again, I've made some choices but we can discuss them if you feel there are better alternatives.

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