From 62823ac36335d4c0e90c24e4c94cda41a0d7005e Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 17:43:43 +0100 Subject: [PATCH 1/8] call ffxdir with a function in the subfun --- src/workflows/bidsConcatBetaTmaps.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index 36d59f97..8cfdbd11 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -74,6 +74,9 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps) + % get ffx directory + ffxDir = getFFXdir(subID, funcFWHM, opt); + % delete maps if deleteIndBeta From 909990317252cb4a196baca510db183285c44ce3 Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 17:54:33 +0100 Subject: [PATCH 2/8] add ffxDir into function argument instead --- src/workflows/bidsConcatBetaTmaps.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index 8cfdbd11..1d693499 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -65,17 +65,15 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) saveAndRunWorkflow(matlabbatch, 'concat_betaImg_tMaps', opt, subID); - removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps); + removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps,ffxDir); end end end -function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps) +function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps, ffxDir) - % get ffx directory - ffxDir = getFFXdir(subID, funcFWHM, opt); % delete maps if deleteIndBeta From f01d9c70ce0b38aba74ee6133895a9fa8da5bc21 Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 18:23:44 +0100 Subject: [PATCH 3/8] another parameter added to the subfun argument a bit crowded and ugly but works --- src/workflows/bidsConcatBetaTmaps.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index 1d693499..b4701c89 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -65,14 +65,17 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) saveAndRunWorkflow(matlabbatch, 'concat_betaImg_tMaps', opt, subID); - removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps,ffxDir); + removeBetaImgTmaps(beta_maps, t_maps, ... + deleteIndBeta, deleteIndTmaps,... + ffxDir, funcFWHM); end end end -function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps, ffxDir) +function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, ... + deleteIndTmaps, ffxDir, funcFWHM) % delete maps @@ -105,6 +108,7 @@ function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, deleteIndTmaps, ff end % delete mat files + ffxDir(end) delete(fullfile(ffxDir, ['4D_*', num2str(funcFWHM), '.mat'])); end From ab2f5a6e8339957dedcf057e6fb8ac8f74adcc68 Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 18:26:04 +0100 Subject: [PATCH 4/8] mh_style fix --- src/workflows/bidsConcatBetaTmaps.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index b4701c89..0a514ee8 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -66,8 +66,8 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) saveAndRunWorkflow(matlabbatch, 'concat_betaImg_tMaps', opt, subID); removeBetaImgTmaps(beta_maps, t_maps, ... - deleteIndBeta, deleteIndTmaps,... - ffxDir, funcFWHM); + deleteIndBeta, deleteIndTmaps, ... + ffxDir, funcFWHM); end end @@ -77,7 +77,6 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, ... deleteIndTmaps, ffxDir, funcFWHM) - % delete maps if deleteIndBeta @@ -108,7 +107,6 @@ function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, ... end % delete mat files - ffxDir(end) delete(fullfile(ffxDir, ['4D_*', num2str(funcFWHM), '.mat'])); end From 0e889d05b83907529b17e1798d11a387cfdf856d Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 19:12:23 +0100 Subject: [PATCH 5/8] let's clean the betas not the ones only used for 4D.nii but all of it. --- src/workflows/bidsConcatBetaTmaps.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index 0a514ee8..421f4af6 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -82,9 +82,7 @@ function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, ... % delete all individual beta maps fprintf('Deleting individual beta-maps ... '); - for iBeta = 1:length(beta_maps) - delete(beta_maps{iBeta}(1:end - 2)); - end + delete(fullfile(ffxDir, ['beta_*','.nii'])) fprintf('Done. \n\n\n '); end From e0718b2efbafbdc1db7ddf00d4bd5458530a26c1 Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 19:13:09 +0100 Subject: [PATCH 6/8] removal of deleting .mat file which does not exist in the pipeline atm. --- src/workflows/bidsConcatBetaTmaps.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index 421f4af6..c1e52a5b 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -104,7 +104,5 @@ function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, ... fprintf('Done. \n\n\n '); end - % delete mat files - delete(fullfile(ffxDir, ['4D_*', num2str(funcFWHM), '.mat'])); end From 4dcf530eb86e9e823721dfa827f5c508fef3e85a Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 19:16:38 +0100 Subject: [PATCH 7/8] cleaning --- src/workflows/bidsConcatBetaTmaps.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index c1e52a5b..a52339d3 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -65,17 +65,14 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps) saveAndRunWorkflow(matlabbatch, 'concat_betaImg_tMaps', opt, subID); - removeBetaImgTmaps(beta_maps, t_maps, ... - deleteIndBeta, deleteIndTmaps, ... - ffxDir, funcFWHM); + removeBetaImgTmaps(t_maps, deleteIndBeta, deleteIndTmaps, ffxDir); end end end -function removeBetaImgTmaps(beta_maps, t_maps, deleteIndBeta, ... - deleteIndTmaps, ffxDir, funcFWHM) +function removeBetaImgTmaps(t_maps, deleteIndBeta, deleteIndTmaps, ffxDir) % delete maps if deleteIndBeta From 21b8f713a53a353b0fbf07aa99f5824583d8a50f Mon Sep 17 00:00:00 2001 From: Ceren Date: Wed, 10 Feb 2021 19:17:52 +0100 Subject: [PATCH 8/8] mh_style fix --- src/workflows/bidsConcatBetaTmaps.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/workflows/bidsConcatBetaTmaps.m b/src/workflows/bidsConcatBetaTmaps.m index a52339d3..95324f42 100644 --- a/src/workflows/bidsConcatBetaTmaps.m +++ b/src/workflows/bidsConcatBetaTmaps.m @@ -79,7 +79,7 @@ function removeBetaImgTmaps(t_maps, deleteIndBeta, deleteIndTmaps, ffxDir) % delete all individual beta maps fprintf('Deleting individual beta-maps ... '); - delete(fullfile(ffxDir, ['beta_*','.nii'])) + delete(fullfile(ffxDir, ['beta_*', '.nii'])); fprintf('Done. \n\n\n '); end @@ -101,5 +101,4 @@ function removeBetaImgTmaps(t_maps, deleteIndBeta, deleteIndTmaps, ffxDir) fprintf('Done. \n\n\n '); end - end