Skip to main content

parseDataDirectory.m


% This function is part of the NMSM Pipeline, see file for full license.
%
% This function takes a parsed settings tree (xml2struct) and finds the
% <input_directory> element or deduces the correct input directory
%
% (struct) -> (string)
% returns the input directory for the given settings tree


function dataDirectory = parseDataDirectory(tree)
dataDirectoryElement = getFieldByNameOrError(tree, 'data_directory');
dataDirectory = dataDirectoryElement.Text;
if isempty(dataDirectory)
dataDirectory = pwd;
end
end