function runROIImageMaskMode(args)

subjects = args.subjects;
mask     = ['^' cell2mat(args.mask) '.*\.img$'];
    
nSubjects = size(subjects);
sessionlist = 1:3;


for s = 1:nSubjects
    subjectStruct{s}.dir = fullfile(args.basedir,cell2mat(subjects(s)));
    subjectStruct{s}.name = cell2mat(subjects(s));
    subjectStruct{s}.roiFile = ui_selectRoiImage(...
        sprintf('Select ROI Files for %s',subjectStruct{s}.name),...
        fullfile(subjectStruct{s}.dir,'results','roi'));
end



for s = 1:nSubjects
    % load image data
   
    disp('fetching volume definitions, please wait');
    subjectStruct{s}.volumes = spm_vol(getImageFileList(subjectStruct{s}.dir,sessionlist,mask));

    disp('computing volume values, please wait');
    subjectStruct{s}.rawData = calculateRoiImageData(subjectStruct{s}.volumes,subjectStruct{s}.roiFile);
    % calculate psth
          
end

assignin('base','subjectStruct',subjectStruct);

end