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

[BUG] In adni-to-bids, empty sessions files are not cleaned up #1189

Open
AliceJoubert opened this issue May 22, 2024 · 4 comments
Open

[BUG] In adni-to-bids, empty sessions files are not cleaned up #1189

AliceJoubert opened this issue May 22, 2024 · 4 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@AliceJoubert
Copy link
Contributor

While working on PR #1188 I noticed that even if all images of a session are deleted for a modality the folder specific for the modality is still kept. As an example, for the ADNI subject 002_S_1261 :

(clinicaEnv) alice.joubert@ICM-COLLI-MP013 testing % tree
.
├── README
├── conversion_info
│   └── v0
│       └── fmap_paths.tsv
├── dataset_description.json
├── participants.tsv
├── sub-ADNI002S1261
│   ├── ses-M096
│   │   ├── fmap
│   │   └── sub-ADNI002S1261_ses-M096_scans.tsv
│   ├── ses-M120
│   │   ├── fmap
│   │   │   ├── sub-ADNI002S1261_ses-M120_fmap_e1.json
│   │   │   ├── sub-ADNI002S1261_ses-M120_fmap_e1.nii.gz
│   │   │   ├── sub-ADNI002S1261_ses-M120_fmap_e2.json
│   │   │   ├── sub-ADNI002S1261_ses-M120_fmap_e2.nii.gz
│   │   │   ├── sub-ADNI002S1261_ses-M120_fmap_e2_ph.json
│   │   │   └── sub-ADNI002S1261_ses-M120_fmap_e2_ph.nii.gz
│   │   └── sub-ADNI002S1261_ses-M120_scans.tsv
    └── sub-ADNI002S1261_sessions.tsv

The files got deleted for session M096 but the fmap directory was kept. This might be something we want to clean up.

@AliceJoubert AliceJoubert added bug Something isn't working enhancement New feature or request labels May 22, 2024
@AliceJoubert AliceJoubert self-assigned this May 22, 2024
@NicolasGensollen NicolasGensollen added this to the v0.9.0 milestone May 22, 2024
@NicolasGensollen
Copy link
Member

Thanks for opening this @AliceJoubert !

I agree that we should cleanup those empty folders. Here you show an example at the modality level, but I suppose the problem could also happen at the session, or subject level.
However, we would need to make sure that the different files have consistent metadata after removal.

Ideally, this should be a generic function taking a BIDS dataset as input and doing the necessary cleaning steps. We could then have this function called at the end of each converter to post-process the generated BIDS dataset.

Copy link

This issue is considered stale because it has not received further activity for the last 14 days. You may remove the inactive label or add a comment, otherwise it will be closed after the next 14 days.

@github-actions github-actions bot added the inactive Issue or request has gone stale label Aug 21, 2024
@NicolasGensollen NicolasGensollen removed the inactive Issue or request has gone stale label Aug 21, 2024
@NicolasGensollen
Copy link
Member

@AliceJoubert is this something that you are planning to work on in the coming days / weeks or should we move it to the 0.10.0 milestone ? (no problem to do that if we have more urgent things do do)

@AliceJoubert
Copy link
Contributor Author

@NicolasGensollen Definitely not in the incoming days ! I want to finish the documentation first I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants