From 3be9dc7df24b31718f7dbaf5fc7e94920930666e Mon Sep 17 00:00:00 2001 From: gustavopamplona Date: Wed, 18 Nov 2020 18:45:17 +0100 Subject: [PATCH] Fixed bugs with manual selection and irregular ROI definition --- Personode.m | 6 +++++- findPeaks.m | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Personode.m b/Personode.m index a4b89c6..4cf1868 100644 --- a/Personode.m +++ b/Personode.m @@ -1380,7 +1380,11 @@ function ICACompChoose_press(src, evt) [file,path] = uigetfile({ '*.nii', ['Select the ICA map (*.nii) for every subject to be included in the analysis']}, 'MultiSelect', 'on'); for i=1:P.NrSubj pathName(i)=cellstr(path); - P.fileName(i)=cellstr(file(i)); + if ~ischar(file) + P.fileName(i)=cellstr(file(i)); + else + P.fileName(i)=cellstr(file); + end end file=char(file(1)); else diff --git a/findPeaks.m b/findPeaks.m index 0d2bd69..6ff64cf 100644 --- a/findPeaks.m +++ b/findPeaks.m @@ -120,6 +120,11 @@ end end + [min_pos,min_pos_idx]=min(firstValue(firstValue>0)); + if min_pos_idx < n_vox + n_vox = min_pos_idx; + end + if peak_value(k)>=0.1 if sep == 1 im=m*(zica>=firstValue(round(n_vox)));