Skip to content
New issue

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

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

Already on GitHub? # to your account

[imaging browser] add download buttons for BIDS JSON file (and NIfTI bval, bvec files for DWI) #8159

Conversation

cmadjar
Copy link
Collaborator

@cmadjar cmadjar commented Aug 25, 2022

Brief summary of changes

Currently, the image download button says 'Download MINC' which is wrong when the file attached is a NIfTI file or another image file format. Instead, the "Download MINC" has been rephrased to a more generic option "Download Image".

For DWI NIfTI files, users should also be able to download the BVAL and BVEC files that come with NIfTI DWI files. This PR adds a download button for each of those files when they are linked to the image file in the parameter_file table.

Similarly, for BIDS datasets, there are JSON files that comes with the image file that should be made available for download so this PR adds a download button to the imaging browser if a JSON file is linked to the NIfTI image file in the parameter_file table.

Testing instructions

Load a BIDS dataset with DWI data and other modalities into LORIS and check that the relevant buttons show in the frontend.

  • if don't want to run an entire pipeline, a quick hack would be to add a NIfTI file to the files table and add the following entries in the parameter_file table
    • one entry linked to the parameter_type Name check_bval_filename
    • one entry linked to the parameter_type Name check_bvec_filename
    • one entry linked to the parameter_type Name bids_json_file

The button should then be seen on the imaging browser. Make sure the paths are relative to the imagePath Config.

Link(s) to related issue(s)

@cmadjar cmadjar added the Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) label Aug 25, 2022
@driusan
Copy link
Collaborator

driusan commented Aug 26, 2022

can you send this to 24.1-release?

@cmadjar cmadjar changed the base branch from 24.0-release to 24.1-release September 20, 2022 12:45
@cmadjar cmadjar force-pushed the 2022-08-25_add_download_functionality_for_BIDS_files_if_present branch 2 times, most recently from 33f621c to 056ff74 Compare September 20, 2022 13:09
@cmadjar
Copy link
Collaborator Author

cmadjar commented Sep 20, 2022

@driusan rebase on 24.1-release done!

@cmadjar cmadjar force-pushed the 2022-08-25_add_download_functionality_for_BIDS_files_if_present branch from b8d8ee5 to 230caac Compare September 22, 2022 17:39
@nicolasbrossard nicolasbrossard added the Passed Manual Tests PR has undergone proper testing by at least one peer label Sep 26, 2022
@nicolasbrossard
Copy link
Contributor

I was able to successfully download BVEC, BVAL and JSON files with the new buttons. Approving.

break;
case 'json':
$FullPath = $imagePath . '/' . $File;
$MimeType = 'apllication/json';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is a typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should be fixed in the last commit

@cmadjar cmadjar force-pushed the 2022-08-25_add_download_functionality_for_BIDS_files_if_present branch from 47a627b to 10cc0fa Compare September 27, 2022 16:50
@driusan driusan merged commit c58b2f5 into aces:24.1-release Sep 27, 2022
@ridz1208 ridz1208 added this to the 24.1.0 milestone Nov 10, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) Passed Manual Tests PR has undergone proper testing by at least one peer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants