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

Adding the image_type to the mri_protocol when identifying for imaging protocol #4448

Merged
merged 1 commit into from
Apr 15, 2019

Conversation

cmadjar
Copy link
Collaborator

@cmadjar cmadjar commented Apr 4, 2019

Brief summary of changes

This PR contains the SQL patches to run to add the image_type check in the mri_protocol and mri_protocol_violated_scans.

This image_type header field is a key variable as this is the only MINC header that allows to differentiate between a fieldmap phase difference from a fieldmap magnitude file which have different purposes when it comes to analyses and the insertion pipeline should be able to recognize one from the other. This is also the case for MP2RAGE modalities and other modern imaging modalities, hence the need to add that field in the mri_protocol table.

Example:

  • image_type for fieldmap phase difference image: ORIGINAL\\PRIMARY\\P\\ND (P for phase)
  • image_type for fieldmap magnitude image: ORIGINAL\\PRIMARY\\M\\ND (M for magnitude)

Note that because of the multiple \ in that field, in order to insert the correct value, each \ needs to be escaped. Example:
INSERT INTO mri_protocol SET image_type='ORIGINAL\\\\PRIMARY\\\\P\\\\ND', ...

This PR is linked to the following LORIS-MRI PR: aces/Loris-MRI#416

This resolves issue...

  • no issue reported but this script was particularly useful when inserting more modern imaging modalities into LORIS so making it available to the community :)

To test this change...

  • test that the SQL patch runs properly

@cmadjar cmadjar added Add to Release Notes PR change should be highlighted in Release notes (important security, features and bugfixes) Caveat for Existing Projects PR contains changes that might impact the code or accepted practices of current active projects SQL PR contains SQL modifications such as schema changes and new SQL scripts Document at Release PR adds or changes a feature such that the wiki (or other documentation) must be updated [branch] minor labels Apr 4, 2019
@christinerogers
Copy link
Contributor

Suggest PR title change similar to: "Adding the image_type to the mri_protocol when identifying for imaging protocol"

-- in the mri_protocol and mri_protocol_violated_scans tables

ALTER TABLE mri_protocol
ADD COLUMN `image_type` varchar(255) default NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

@cmadjar Is this image_type attributes to have limited number on possible values?
Will all the possibles values be like the 2 examples you put in the descriptions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is hard to say. The fieldmap is only one example but the values separated by the // can vary a lot between the different acquisitions.

Copy link
Contributor

@PapillonMcGill PapillonMcGill Apr 15, 2019

Choose a reason for hiding this comment

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

I don't like to add multiple varchar(255), specially when possible values range is limited. We might ran into problem due to extremely long row length.

I would have preferred a lookup table. Specially if the possible values are following a pattern with limited range.
I do understand that it might create more complication to let auto addition of possible values and/or forecast all possibilities.

I will thus (reluctantly) approve anyway.

@driusan driusan changed the base branch from minor to 20.3-release April 5, 2019 14:51
@driusan driusan changed the base branch from 20.3-release to minor April 5, 2019 14:52
@cmadjar cmadjar changed the title Added the patch and modified the default schema Adding the image_type to the mri_protocol when identifying for imaging protocol Apr 9, 2019
@driusan driusan merged commit ee8d0ab into aces:minor Apr 15, 2019
@ridz1208 ridz1208 added this to the 20.4.0 milestone Apr 30, 2019
nicolasbrossard pushed a commit to nicolasbrossard/Loris that referenced this pull request Jun 26, 2019
…#4448)

This contains the SQL patches to run to add the image_type check in the mri_protocol and mri_protocol_violated_scans.

This image_type header field is a key variable as this is the only MINC header that allows to differentiate between a fieldmap phase difference from a fieldmap magnitude file which have different purposes when it comes to analyses and the insertion pipeline should be able to recognize one from the other. This is also the case for MP2RAGE modalities and other modern imaging modalities, hence the need to add that field in the mri_protocol table.

Example:

    image_type for fieldmap phase difference image: ORIGINAL\\PRIMARY\\P\\ND (P for phase)
    image_type for fieldmap magnitude image: ORIGINAL\\PRIMARY\\M\\ND (M for magnitude)

Note that because of the multiple \ in that field, in order to insert the correct value, each \ needs to be escaped. Example:
INSERT INTO mri_protocol SET image_type='ORIGINAL\\\\PRIMARY\\\\P\\\\ND', ...

See also LORIS MRI PR: aces/Loris-MRI#416
@ridz1208 ridz1208 modified the milestones: 20.4.0, 21.1.0 Jul 22, 2019
@ridz1208 ridz1208 modified the milestones: 21.1.0, 22.0.0 Nov 1, 2019
@cmadjar cmadjar deleted the add_image_type_to_mri_protocol branch September 24, 2021 19:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Add to Release Notes PR change should be highlighted in Release notes (important security, features and bugfixes) Caveat for Existing Projects PR contains changes that might impact the code or accepted practices of current active projects Document at Release PR adds or changes a feature such that the wiki (or other documentation) must be updated SQL PR contains SQL modifications such as schema changes and new SQL scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants