Skip to content
Snippets Groups Projects
Commit e43fb26f authored by Laura Nervo's avatar Laura Nervo
Browse files

gtSetAnalysisDir : fixing bug with replacing '_' with '/'


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent 208dd265
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,11 @@ if any(cellfun(@(x) strcmp(x,'_data_visitor'),strcell))
% regular id11 visitor experiment
ind = find(cellfun(@(x) strcmp(x,'_data_visitor'),strcell));
if any(cellfun(@(x) strcmp(x,'id11'),strcell))
ind = [ind, find(cellfun(@(x) strcmp(x,'id11'),strcell))];
ind1 = find(cellfun(@(x) strcmp(x,'id11'),strcell));
elseif any(cellfun(@(x) ~isempty(strfind(x,'id')),strcell))
ind = [ind, find(cellfun(@(x) ~isempty(strfind(x,'id')),strcell))];
ind1 = find(cellfun(@(x) ~isempty(strfind(x,'id')),strcell));
end
ind = ind : ind1;
ind2 = find(cellfun(@(x) ~isempty(strfind(x,'DCT_Analysis')),strcell));
ind3 = find(cellfun(@(x) ~isempty(strfind(x,gtGetLastDirName(inputdir))),strcell));
elseif any(cellfun(@(x) ~isempty(strfind(x,'graintracking')),strcell))
......@@ -32,20 +33,28 @@ else
end
if isempty(dir)
dir = strrep(strcell{ind},'_',filesep());
if ~isempty(ind)
strcell{ind(1)} = strrep(strcell{ind(1)},'_',filesep());
dir = arrayfun(@(num) [strcell{num} filesep], ind, 'UniformOutput', false);
dir = [dir{:}];
end
tmp=dir;
if ~isempty(ind2)
ind = ind : ind2;
elseif ~isempty(ind3)
if ind3 ~= length(strcell)
tmp=fullfile(tmp,'DCT_Analysis');
ind = [];
else
for ii=ind(end)+1:length(strcell)-1;
tmp=fullfile(tmp,strcell{ii});
end
tmp=fullfile(tmp,'DCT_Analysis');
end
tmp = fullfile(tmp,strcell{ind3});
else
tmp=fullfile(tmp,'DCT_Analysis');
end
if ~isempty(ind3)
ind = [ind, ind3];
else
tmp=fullfile(tmp,gtGetLastDirName(inputdir));
end
for ii=ind(2):ind(end)
tmp = fullfile(tmp,strcell{ii});
tmp = fullfile(tmp,gtGetLastDirName(inputdir));
end
dir=tmp;
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment