We are trying to run AFQ in deployed (compiled via mcc) mode, and having some issue inside AFQ_SegmentFiberGroups.m. It's running which('mrDiffusion.m') that doesn't seem to work in compiled mode.
We basically made following patch to AFQ to make it work.
diff --git a/functions/AFQ_SegmentFiberGroups.m b/functions/AFQ_SegmentFiberGroups.m
index 1968a82..ccb6023 100644
--- a/functions/AFQ_SegmentFiberGroups.m
+++ b/functions/AFQ_SegmentFiberGroups.m
@@ -154,7 +154,9 @@ end
% Load fiber group - Can be filename or the data
if ischar(fg), fg = dtiLoadFiberGroup(fg); end
% Set the directory where templates can be found
-tdir = fullfile(fileparts(which('mrDiffusion.m')), 'templates');
+%tdir = fullfile(fileparts(which('mrDiffusion.m')), 'templates');
+%fix for compiling
+tdir = fullfile(pwd, 'templates');
% Initialize spm defualts for normalization
spm_get_defaults; global defaults;
% In my case it is not reading the estimate, just the .write, copied this values
I am wondering, this piece of code can be updated to something like.
if isdeployed
tdir = ...something that works in deployed mode..
else
tdir = fullfile(fileparts(which('mrDiffusion.m')), 'templates');
end
?
We are trying to run AFQ in deployed (compiled via mcc) mode, and having some issue inside AFQ_SegmentFiberGroups.m. It's running
which('mrDiffusion.m')that doesn't seem to work in compiled mode.We basically made following patch to AFQ to make it work.
I am wondering, this piece of code can be updated to something like.
?