diff --git a/README.md b/README.md index a996ca6..c8edb05 100755 --- a/README.md +++ b/README.md @@ -41,7 +41,10 @@ If you have a more general question regarding the usage of SEPIA and/or other QS For full update log, please visit https://sepia-documentation.readthedocs.io/en/latest/getting_started/Release-note.html. -### 1.2.2.3 (current master) +### 1.2.2.4 (current master) +* Fix bug when importing SEPIA pipeline configuration files (sepia_config.m) to the GUI for using VSHARP and FANSI + +### 1.2.2.3 (current efde35b) * Fix bug when using BIDS compatible directory input where magnitude images did not utilise the rescale slope and intercept to obtain the true values for R2* mapping ### 1.2.2.2 (current e53fd99) diff --git a/gui_func/callback/config/get_num_as_string.m b/gui_func/callback/config/get_num_as_string.m index 3f011f6..ef1150e 100644 --- a/gui_func/callback/config/get_num_as_string.m +++ b/gui_func/callback/config/get_num_as_string.m @@ -43,7 +43,8 @@ indicatorE_idx = regexp(A,end_indicator); % get all characters between the indicators - str = A(indicatorS_idx(find(indicatorS_idx > str_end_idx, 1 ))+1:indicatorE_idx(find(indicatorE_idx > str_end_idx, 1 ))-1); + % 20230329 KC: fixed bug when the value/string is separated by white space + str = A(indicatorS_idx(find(indicatorS_idx > str_end_idx, 1 ))+1:indicatorE_idx(find(indicatorE_idx > indicatorS_idx(find(indicatorS_idx > str_end_idx, 1 ))+1, 1 ))-1); % remove all white space for scalar quantity if isScalarString diff --git a/gui_func/callback/config/get_set_bfr_vsharp.m b/gui_func/callback/config/get_set_bfr_vsharp.m index 95df010..66030e3 100644 --- a/gui_func/callback/config/get_set_bfr_vsharp.m +++ b/gui_func/callback/config/get_set_bfr_vsharp.m @@ -37,12 +37,32 @@ function get_set_bfr_vsharp(h,mode,input) % max radius pattern_curr = str_pattern{1}; val = get_num_as_string(config_txt, pattern_curr, '[', ':'); + if isempty(val) + % in case of machine generated config file + val = get_num_as_string(config_txt, pattern_curr, '[', '\s'); + end set_non_nan_value(action_handle{1},'String',val) % min radius - val = get_num_as_string(config_txt, pattern_curr, ':', ']'); - idx = regexp(val,':'); - val = val(idx+1:end); + % 20230329: bug fix for sepiaIO auto-generated pipeline configuration file + try + val = get_num_as_string(config_txt, pattern_curr, ':', ']'); + idx = regexp(val,':'); + val = val(idx+1:end); + catch + idx_open = regexp(config_txt,'['); + idx_close = regexp(config_txt,']'); + idx_pattern = regexp(config_txt,pattern_curr); + + idx_first = find(idx_open>idx_pattern); + idx_last = find(idx_close>idx_pattern); + + val_text = config_txt(idx_open(idx_first):idx_close(idx_last)); + val_num = str2num(val_text); + + val = min(val_num); + end + set_non_nan_value(action_handle{2},'String',val) end \ No newline at end of file diff --git a/gui_func/callback/config/get_set_qsm_fansi.m b/gui_func/callback/config/get_set_qsm_fansi.m index 5f00cc3..f90ea4c 100644 --- a/gui_func/callback/config/get_set_qsm_fansi.m +++ b/gui_func/callback/config/get_set_qsm_fansi.m @@ -131,7 +131,7 @@ function get_set_qsm_fansi(h,mode,input) % trigger popup callback to switch method panel feval(action_handle{k}.Callback{1},action_handle{k},[],{action_handle{k+1},action_handle{k+2}},1); - for k = 10:11 + for k = 11:12 pattern_curr = str_pattern{k}; val = get_num_as_string(config_txt, pattern_curr, '=', ';'); set_non_nan_value(action_handle{k},'String',val); diff --git a/sepia.m b/sepia.m index 0798291..b3864c7 100644 --- a/sepia.m +++ b/sepia.m @@ -44,6 +44,7 @@ % Date modified: 27 Jan 2020 (v0.8.1) % Date modified: 12 June 2021 (v1.0) % Date modified: 3 August 2022 (v1.1) +% Date modified: 3 April 2023 (v1.2.2.4) % function sepia @@ -370,7 +371,7 @@ function PushbuttonStart_Callback(source,eventdata) function PushbuttonLoadConfig_Callback(source,eventdata) -global h +global h tooltip fieldString % only read m file [config_filename,pathDir] = uigetfile({'*.m'},'Select a SEPIA config file'); @@ -382,6 +383,18 @@ function PushbuttonLoadConfig_Callback(source,eventdata) tab = h.StepsPanel.dataIO.Parent.Title; +% Tab specific strings and tooltips +tooltip.input_dir{1} = 'Directory contains phase (*ph*.nii*), magnitude (*mag*.nii) & header (*header*.mat) (& mask, *mask*nii*) files'; +tooltip.input_dir{2} = 'Directory contains the total field map (*fieldmap*.nii*) and SEPIA header (*header*.mat)'; +tooltip.input_dir{3} = 'Directory contains the local field map (*localfield*.nii*) (depending on QSM algorithm, additional file(s) may also be needed, e.g. *mag*.nii* and *weights*.nii*)'; + +fieldString.inputData1{1}= 'or Phase:'; +fieldString.inputData1{2}= 'or Fieldmap:'; +fieldString.inputData1{3}= 'or Local field:'; + +fieldString.inputData3{1}= ' Weights:'; +fieldString.inputData3{2}= ' Noise SD:'; + switch tab % QSM one-stop station tab diff --git a/sepia_universal_variables.m b/sepia_universal_variables.m index 0db5746..315e452 100755 --- a/sepia_universal_variables.m +++ b/sepia_universal_variables.m @@ -14,7 +14,7 @@ % DO NOT change the order of the entities, add a new one at the end instead % %% Version -SEPIA_version = 'v1.2.2.3'; +SEPIA_version = 'v1.2.2.4'; %% PATH SEPIA_HOME = fileparts(mfilename('fullpath'));