function voxelList = parseVoxelList(model) voxelList = []; %,; txt = get(model.txtVoxelDef,'String'); map = model.subjectMap; SubjectID = getSubjectIDString(model); % assignin('base','txt',txt); rows = size(txt,1); for i = 1:rows if all(isspace(txt(i,:))) continue; end line = txt(i,:); roi = parseROIName(line); roimod = parseModifier(line); voxelList = [voxelList; getCoordinate(map,SubjectID,roi)+eval(roimod)]; end % voxelList = [... % getCoordinate(map,SubjectID,'SPL l')+[0,0,0];... % getCoordinate(map,SubjectID,'SPL l')+[1,0,0];... % getCoordinate(map,SubjectID,'SPL l')+[-1,0,0];... % getCoordinate(map,SubjectID,'SPL l')+[0,1,0];... % getCoordinate(map,SubjectID,'SPL l')+[0,-1,0];... % getCoordinate(map,SubjectID,'SPL l')+[0,0,1];... % getCoordinate(map,SubjectID,'SPL l')+[0,0,-1];... % getCoordinate(map,SubjectID,'SPL r')+[0,0,0];... % getCoordinate(map,SubjectID,'SPL r')+[1,0,0];... % getCoordinate(map,SubjectID,'SPL r')+[-1,0,0];... % getCoordinate(map,SubjectID,'SPL r')+[0,1,0];... % getCoordinate(map,SubjectID,'SPL r')+[0,-1,0];... % getCoordinate(map,SubjectID,'SPL r')+[0,0,1];... % getCoordinate(map,SubjectID,'SPL r')+[0,0,-1];... % getCoordinate(map,SubjectID,'M1 r')+[0,0,0];... % getCoordinate(map,SubjectID,'M1 l')+[0,0,0];... % ]; end function roi = parseROIName(line) c = 1; roi = ''; while line(c)~=',' roi = [roi line(c)]; c = c+1; end roi = strtrunc(roi); end function roimod = parseModifier(line) c = 1; while line(c)~=',' % skip roi c=c+1; end c=c+1; % skip ',' roimod=''; while line(c) ~= ';' roimod = [roimod line(c)]; c = c+1; end end