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

Add user configuration file /usr/preferences.json #435

Open
wants to merge 121 commits into
base: master
Choose a base branch
from

Conversation

agahkarakuzu
Copy link
Member

Description to be added.

agahkarakuzu and others added 10 commits March 2, 2021 14:21
- 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
@codecov
Copy link

codecov bot commented Mar 6, 2021

Codecov Report

Merging #435 (d1de772) into master (8b8fb39) will decrease coverage by 0.91%.
The diff coverage is 46.57%.

❗ Current head d1de772 differs from pull request most recent head 09c7807. Consider uploading reports for the commit 09c7807 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #435      +/-   ##
==========================================
- Coverage   47.40%   46.49%   -0.91%     
==========================================
  Files         260      272      +12     
  Lines        8647     9629     +982     
==========================================
+ Hits         4099     4477     +378     
- Misses       4548     5152     +604     
Flag Coverage Δ
matlab 46.49% <46.57%> (-0.13%) ⬇️
octave ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Common/AbstractModel.m 71.25% <ø> (+5.00%) ⬆️
src/Common/FitBIDS.m 0.00% <0.00%> (ø)
src/Common/FitResultsSave_BIDS.m 0.00% <0.00%> (ø)
src/Common/qMRLab_static_Models.m 0.00% <0.00%> (ø)
src/Common/saveUserPreferences.m 0.00% <0.00%> (ø)
src/Common/tools/versionChecker.m 0.00% <0.00%> (-62.17%) ⬇️
src/Common/units/validatePanelUnits.m 0.00% <0.00%> (ø)
...els_Functions/MP2RAGE/func/T1B1correctpackageTFL.m 84.74% <ø> (ø)
src/Common/getUserPreferences.m 32.50% <32.50%> (ø)
src/Models/T1_relaxometry/vfa_t1.m 41.00% <42.85%> (-34.45%) ⬇️
... and 27 more

... and 17 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b8fb39...09c7807. Read the comment docs.

@agahkarakuzu
Copy link
Member Author

agahkarakuzu commented Mar 6, 2021

Purpose is to totally isolate user choices from native implementation choices. Config files provided by usr/devs will deal with necessary conversions.

  • Replace qMRLab_static_models
  • Usr UnifyOutputUnits infrastructure is ready
  • Do the same for input params & for inputs with non-arbitrary units
  • BIDS mappings are done
  • Make changes operational at the usr GUI & Batch level
  • Batch generation and GUI panels should reflect user selections
  • When ready, switch unify on for Documentation
  • Turn off on unit tests. Test the core in the form they were originally written.

@agahkarakuzu agahkarakuzu added this to the Release 2.5.0 milestone Mar 6, 2021
@agahkarakuzu
Copy link
Member Author

agahkarakuzu commented Mar 9, 2021

Function table is not implemented in freaking Octave. Dataframe does not give similar functionality, so change table with something else.

@agahkarakuzu
Copy link
Member Author

agahkarakuzu commented Mar 9, 2021

@jvelazquez-reyes if you have time, maybe you can try having modelRegistry.m function the same way without using the table function. Should be pretty straightforward, just leaving it here if you can get that to it before I can. These are the relevant lines:

cur_lut = table(parent,xnames,suffix,isBIDS,folderBIDS,'VariableNames',{'Family','xname','suffixBIDS','isOfficialBIDS','folderBIDS'});

pre_out = table2struct(lut(idxs2,:));

cur_lut = table(parent,fieldnames(unitDefs.(fields{ii})),'VariableNames',{'Family','unit'});

If you can, please branch out from usrjson and implement on that branch.

@agahkarakuzu
Copy link
Member Author

agahkarakuzu commented Mar 13, 2021

The main functionality to change input/output map units and input protocol parameters is ready. Here's an example, inversion_recovery in its original implementation works with (ms), here both input prots and output map are in second.

image

More fantastic configs are easily possible. For example, input parameters are in (usec) and the output map is in hrs 😁

image

Dealing with all these unit mappings is actually much trickier than it looks without inducing overhead to the voxelwise models. Tests will fail for a while, because I still need to go through classdefs of all the models. Then we'll decide on the default unified input/output units across models. Unified parameters will be enabled for users and documentation generation (because they'll be in the qMRgenBatch outputs or in GUI panel), but will be disabled for the unit tests.

I know that a json of SI units exists out there, but there are reasons why I come up with a customized unit definition schema.

The documentation will make it clear which units are available and changing which unit parents (e.g. Time) changes which input/output/protocol entities. And that page will be automatically parsed.

@agahkarakuzu agahkarakuzu changed the title Allow users to define units Add user configuration file /usr/preferences.json Mar 13, 2021
- Move scaling functions from Abstract model to outside
- Wrap Prot scaling around the FitData and ParFitData
@agahkarakuzu
Copy link
Member Author

@mathieuboudreau
Copy link
Member

@agahkarakuzu if this PR is ready for review, can you assign me and @jvelazquez-reyes ?

If it isn't ready for review, can you detail what is missing? Maybe one of us can work towards resolving this PR in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants