-
Notifications
You must be signed in to change notification settings - Fork 58
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
BIDS features - MATLAB 2022 internship #484
base: master
Are you sure you want to change the base?
Conversation
- A json file describing input/output data and protocol units with reference to the example implementation and example dataset. - When a new model added, this file must be updated. - To be added to the documentation
- Show unit in GUI
- Move scaling functions from Abstract model to outside - Wrap Prot scaling around the FitData and ParFitData
- BIDS specification mappings for anat, dwi, fmap - BIDS to qMRLab input rules - qMRLab to BIDS output rules - qMRLab model registry - Unit specifications - README explaining the convention
- Add unit selection - Improve parallel fit options - Add README
- Directory navigation was needed.
- Add model specific notes and refs inc BIDS - Refactor BinderHub badge insert - Update references
- Add unit I/O management for all models - Set checkAnterior version 2,5,0 to account for OriginalProtEnabled and setUserProtUnits - Edit panel texts to avoid unit description duplication, wherever applicable.
- FITBIDS uses all /dev configs in relation to the new model registry to map a BIDS formatted data into a qMRLab process. Emits env var ISBIDS. - getUserPreferences reads /usr configs and determines whether choices will be overridden for BIDS (env var ISBIDS) - modelRegistry infers the mapping rules based on set preferences - Add helper functions
- To store app data regarding unit scaling
- Add gitignore rule not to exclude - Save outputs in BIDS formats and units
- Scale input/outputs maps as necessary without affecting how the original model accepts input data and
- Use helper functions - Add scaling function
- Improve documentation template - Make static model to read list from model registry - Output display units
- Accounted by the new model registry
- Fix misc issues
Codecov Report
@@ Coverage Diff @@
## master #484 +/- ##
==========================================
- Coverage 47.40% 46.50% -0.91%
==========================================
Files 260 272 +12
Lines 8648 9631 +983
==========================================
+ Hits 4100 4479 +379
- Misses 4548 5152 +604
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 17 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Tagging @vijayiyer05 from the MATLAB team! |
@@ -28,7 +28,7 @@ RUN echo ${TAG}; \ | |||
mkdir $HOME/work; \ | |||
cd $HOME/work; \ | |||
git clone --recurse-submodules -b ${TAG} --single-branch --depth 1 https://github.com/qMRLab/qMRLab.git;\ | |||
chmod -R 777 $HOME/work/qMRLab; \ | |||
chmod -R 777 cd $HOME/work/qMRLab; \ |
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.
This cd
seems out of place within a chmod
command, I'm making a note to manually test the Dockerfile in case this needs to be fixed.
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 noticed this one too, but I did not want to push changes for it not to break a book elsewhere that maybe using the latest
tag. Thanks!
@@ -24,6 +24,12 @@ | |||
"% |-------------- sub-01_TB1map.nii.gz", | |||
"% |-------------- sub-01_TB1map.json", | |||
"% ", | |||
"% <https://osf.io/rt642/download Download> our example |TB1DAM| BIDS dataset and process:", |
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.
BIDS demo documentation, making a note to myself to test this manually.
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.
Seems like it gets repeated for each model, so also making a note to check that this automated approach at generating the BIDS documentation is general enough for all models that it's generated for.
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.
The notes field is model specific to add BIDS-specific content and citation strings to the reference articles:
Handled by the following
qMRLab/src/Common/qMRgenBatch.m
Lines 196 to 221 in af5c37f
% Generate model specific commands ====================== END | |
for ii =1:length(notesJson.notes) | |
if strcmp(Model.ModelName,notesJson.notes{ii}.model) | |
if isfield(notesJson.notes{ii},'note') | |
noteTexts.notes = cellstr(notesJson.notes{ii}.note'); | |
else | |
noteTexts.notes = noNotes; | |
end | |
if isfield(notesJson.notes{ii},'citation') | |
noteTexts.citation =cellstr(['% ' notesJson.notes{ii}.citation]); | |
else | |
noteTexts.citation = noCitation; | |
end | |
break; | |
else | |
noteTexts.notes = noNotes; | |
noteTexts.citation = noCitation; | |
end | |
end | |
% Replace jokers ====================== START |
@@ -0,0 +1,112 @@ | |||
{ |
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.
Note: qMRLab BIDS files currently in a temporary dev/
directory, which will need to be renamed (and possible moved) prior to merging.
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.
The dev/
directory was not meant to be temporary, but we can rename it to config
if you think that it makes more sense.
@@ -0,0 +1,226 @@ | |||
# ⚠️ Warning |
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.
BIDS documentation for the developers. Need to check if this should be moved to our wiki and/or ReadTheDocs before the PR is merged.
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 think this should be ho into the wiki page, we better keep RTD cleaner for users.
The test suite is failing, but doesn't appear to be related to the BIDS feature (it's during the MTsat batch example run). Note to self to check/resolve this, and see if some non-BIDS related code was touched in this branch that would have also raised this error. |
Code coverage is failing also, likely due to the BIDS code being in |
@@ -107,34 +104,39 @@ | |||
|
|||
B1params = obj.options.B1correctionfactor; | |||
|
|||
[FitResult.MTSAT, R1] = MTSAT_exec(data, MTparams, PDparams, T1params, B1params); | |||
FitResult.T1 = 1./R1; | |||
[MTSAT, R1, R1cor, MTsatcor] = MTSAT_exec(data, MTparams, PDparams, T1params, B1params); |
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.
The test suite currently fails due to the change on this line. Two extra outputs were set (R1cor and MTsatcor), but the function that's being called never defined these extra outputs and still only outputs 2 values:
function [MTsat, R1] = MTSAT_exec(data, MTParams, PDParams, T1Params, B1Params) |
Despite an attempt at a workaround below on lines 119 and 123, the ~isempty
call never get set since the code errors here.
It's not clear to me what exactly the two extra variables are expected to be (I could imagine that MTsatcor would maybe be with B1 correction from the code, but not sure about R1cor), I'll instead just add some placeholder "empty" variables that get outputted, and we can touch on this during the full review later on.
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.
Handled in dc2f259, but will need to revisit and/or check with Agah later what the intended behaviour was while this was being developped.
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 remember Juan was working on this, the expected variables should be un-corrected (B1) maps. Most likely defaults were not matching what the test was expecting with some variable matching. Thanks for the fix, a more thorough solution to follow.
Opening this PR for Agah while he's away on intership in Stanford - I'm going to do a review of the current changes and what appears to be left to do.