-
Notifications
You must be signed in to change notification settings - Fork 84
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
GENFI to BIDS converter #865
GENFI to BIDS converter #865
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MatthieuJoulot ! This is looking good ! 👍
I made a first pass with some suggestions and questions.
I haven't looked at the function complete_imaging_data
due to lack of time, but looking at how long it is, I feel like there could be some refactoring to be done.
I'll take a look at it during the next review round.
On a more general level, I think that there is a lot of duplication between the converters. Functions like write_bids
or convert_dicom_to_nifti
are almost identical (at least between UKB2BIDS and GENFI2BIDS) and currently not easy to reuse because they do multiple things (extract archives, build the dcm2niix command, run the command, perform some special case handling...).
This is clearly out of the scope of this PR, but something I think we should take a look at at some point.
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A batch of small suggestions.
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Gensollen <[email protected]>
Co-authored-by: Gensollen <[email protected]>
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MatthieuJoulot !
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Gensollen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple more things you can remove. Note also that there is currently a conflict.
Besides these, this LGTM.
clinica/iotools/converters/genfi_to_bids/genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Gensollen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with a minor suggestion concerning the gif
option flag. I had trouble understanding what it is used for.
```Text | ||
clinica convert genfi-to-bids [OPTIONS] DATASET_DIRECTORY CLINICAL_DATA_DIRECTORY BIDS_DIRECTORY | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't CLINICAL_DATA_DIRECTORY
an option here instead of a positional argument?
help="Path to the clinical data directory", | ||
) | ||
|
||
gif = click.option("-gif", is_flag=True, help="Add values from gif to session.tsv") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what gif
is doing. It's not explained in the docs and the help string is a bit too shy of details.
I would also avoid short option flags only. Modern CLI design tends to favor long option flags by default, and long + short option flags for popular use cases. Since this option maps to a boolean variable, I'd expect something along the lines of --with-gif
or --add-gif
maybe?
|
||
!!! example | ||
If the original subject ID is `0001`, the final BIDS ID will be `sub-GRN0001`. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps explain what the gif
option modifies here?
test/unittests/iotools/converters/genfi_to_bids/test_genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
test/unittests/iotools/converters/genfi_to_bids/test_genfi_to_bids_utils.py
Outdated
Show resolved
Hide resolved
All right, all green ! 🎉 |
Converter handling GENFI data and converting it to BIDS
Ongoing
ToDo
Getting GENFI
part to do