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

Dataset module for v2 #685

Merged

Conversation

camillebrianceau
Copy link
Collaborator

@camillebrianceau camillebrianceau commented Nov 28, 2024

In this PR, I refactored the dataset module with the following changes:

  • I kept the API/dataset_test.py in the PR to provide an example of how the dataset is used.
  • There is now a single CapsDataset for all extraction modes.
    Future implementations in ClinicaDL will introduce:
    • ConcatDataset
    • PairedDataset
    • UnPairedDataset
      These will inherit from CapsDataset.
  • Preprocessing is now represented as an object (using pydantic). This object describes:
    • The preprocessing steps performed using Clinica.
    • The image type being used.
  • Readers are the objects responsible for reading data from CAPS or BIDS. These will eventually be replaced by ClinicaIO once its development is complete.

The extraction process has been moved to the Transforms module. Each extraction type (ROI, Image, Slice, and Patch) is now represented as an object and behaves like a transform.

I added unit tests. However, tests for Transforms and Preprocessing are not included, as these components are expected to change in the coming weeks.

@camillebrianceau camillebrianceau marked this pull request as ready for review December 4, 2024 12:47
@thibaultdvx
Copy link
Collaborator

The extraction process has been moved to the Transforms module. Each extraction type (ROI, Image, Slice, and Mask) is now represented as an object and behaves like a transform.

You meant Patch, didn't you?

Copy link
Collaborator

@thibaultdvx thibaultdvx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks @camillebrianceau!!

from .reader import Reader


class CapsMultiReader:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, why did you feel the need to create this reader? Is it temporary?

Because I thought that we would handle multi-cohort with multiple CapsDataset, concatenated with ConcatDataset. And it seems to me that each CapsDataset could have its own CapsReader.

Tell me if I'm not clear enough!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I didn't explain but it was just a first draft. Then we put the CapsReader in the CapsDataset so it is not useful anymore but since we’re not entirely sure about our change, I prefer not to delete it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, LGTM!

@camillebrianceau camillebrianceau merged commit c28d4d5 into aramis-lab:clinicadl_v2 Dec 5, 2024
10 checks passed
@camillebrianceau camillebrianceau deleted the cb_dataset_module branch December 5, 2024 16:57
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.

2 participants