Skip to content

Commit

Permalink
Merge pull request #64 from kschan0214/dev1.2.2.4
Browse files Browse the repository at this point in the history
Dev1.2.2.4
  • Loading branch information
kschan0214 authored Apr 3, 2023
2 parents efde35b + 303e9e9 commit 9083249
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 8 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion gui_func/callback/config/get_num_as_string.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 23 additions & 3 deletions gui_func/callback/config/get_set_bfr_vsharp.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion gui_func/callback/config/get_set_qsm_fansi.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 14 additions & 1 deletion sepia.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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');
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sepia_universal_variables.m
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down

0 comments on commit 9083249

Please sign in to comment.