function [] = saveInterim()
%SAVEINTERIM Saves the current state of ARTOA4 to the file specified by dialog.
%   

global artoaWorkspace artoaDataInput artoaDataOutput;

%% Get required variables
folder = artoa.data.getMember(artoaDataInput, {'ini', 'directory', 'interim'}, pwd());
filter = artoa.data.getMember(artoaDataInput, {'ini', 'filemask', 'interim'}, '*.itm');

%% Ask for filename
[filename, pathname] = uiputfile(fullfile(folder, filter));

filepath = fullfile(pathname, filename);

save(filepath, 'artoaWorkspace', 'artoaDataInput', 'artoaDataOutput');
return
if isfile(filepath)
    save(filepath, 'artoaWorkspace', 'artoaDataInput', 'artoaDataOutput');
else
    warning([mfilename ': Save interim file failed because the selected file is not a file!']);
end


end