Skip to content

Define global popups flag (as user input in GUI) to pass to all functions down the processing#116

Open
Barisevrenugur wants to merge 4 commits into
masterfrom
add-global-popup-flag
Open

Define global popups flag (as user input in GUI) to pass to all functions down the processing#116
Barisevrenugur wants to merge 4 commits into
masterfrom
add-global-popup-flag

Conversation

@Barisevrenugur

@Barisevrenugur Barisevrenugur commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

Description

the pop up flag job.subj.log.flags is set on the GUI and is independent of what functions are called down the processing. Currently, each time one needs to record an error to hmri_log along with a popup (as set on the GUI), the specific job.subj.log.flags needs to be passed to the function in some way every single time. We solve this problem by extracting this user input within hmri_run_create into a global variable and then using this global variable directly to record the error messages within the hmri_calc_R2s. We will be searching within the toolbox and using this method to implement all the error handling in the following format:

hmri_log(<error message>, <corresponding global popup flag as initialized in the associated hmri_run>)
error(<error message>)

observe that for instance these particular lines did not comply with the above, before the implementation here:

error('hmri:NoOptimToolbox', "The methods 'nlls_ols','nlls_wls1','nlls_wls2','nlls_wls3' require Optimization Toolbox: either this toolbox and/or its license is missing." + ...

error(['method ' method ' not recognised'])

Tests performed

The following shows the content of the hmri_log file during manual testing for the implemented errors:

...
(1) R1 map [s-1] (R1)
 - no Imperfect Spoiling Correction applied
 - B1+ bias correction using provided B1 map (pre_processed_B1)
 - no RF sensitivity bias correction

(2) A map (signal amplitude) [a.u.] (A)
 - no WM calibration
 - B1+ bias correction using provided B1 map (pre_processed_B1)
 - no RF sensitivity bias correction
 - R2* bias accounted for by TE=0 extrapolation (fullOLS option)

(3) MT saturation map [p.u.] (MTsat)
 - B1+ bias correction using provided B1 map (pre_processed_B1)
 - no RF sensitivity bias correction

(4) Classic MTR image [a.u.] - not currently saved in Results (MTR)

(5) R2* map [s-1] (R2s)
 - ESTATICS model (R2* map calculation)
 - B1+ bias correction does not apply
 - no RF sensitivity bias correction

	-------- R2* map calculation (basic exponential decay) --------

INFO: minimum number of echoes required for R2* map calculation is 4.
Number of PDw echoes available: 8

ERROR: The methods 'nlls_ols','nlls_wls1','nlls_wls2','nlls_wls3' require Optimization Toolbox: either this toolbox and/or its license is missing. Please use another method which does not need the Optimization Toolbox such as 'ols','wls1','wls2','wls3'. 

...
 - B1+ bias correction using provided B1 map (pre_processed_B1)
 - no RF sensitivity bias correction

(2) A map (signal amplitude) [a.u.] (A)
 - no WM calibration
 - B1+ bias correction using provided B1 map (pre_processed_B1)
 - no RF sensitivity bias correction
 - R2* bias accounted for by TE=0 extrapolation (fullOLS option)

(3) MT saturation map [p.u.] (MTsat)
 - B1+ bias correction using provided B1 map (pre_processed_B1)
 - no RF sensitivity bias correction

(4) Classic MTR image [a.u.] - not currently saved in Results (MTR)

(5) R2* map [s-1] (R2s)
 - ESTATICS model (R2* map calculation)
 - B1+ bias correction does not apply
 - no RF sensitivity bias correction

	-------- R2* map calculation (basic exponential decay) --------

INFO: minimum number of echoes required for R2* map calculation is 4.
Number of PDw echoes available: 8

 ERROR: method dontkonw not recognised

@Barisevrenugur Barisevrenugur added the enhancement New feature or request label Apr 17, 2025
@Barisevrenugur Barisevrenugur changed the title define global popups flag (as user input in GUI) to pass to all functions down the processing Define global popups flag (as user input in GUI) to pass to all functions down the processing May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant