Christoph Budziszewski
first eventually working study switch functionality
Christoph Budziszewski commited 9e39a52 at 2009-07-29 15:51:21
ui_createStudy.m
function ui_createStudy(menu,uimodel)
frameWidth=300;
frameHeight=200;
frame = figure('Visible','on','Position',[0,0,frameWidth,frameHeight]);
movegui(frame,'center'); % get this thing visible on smaller displays.
set(frame,'Name','Create Study');
set(frame,'NumberTitle','off');
set(frame,'MenuBar','none');
% set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
set(frame,'Resize','on');
set(frame,'Units','normalized');
set(frame,'Color','y');
study= struct();
% name
namelabel = createLabel(frame,[0 0.6 1 0.1],'Identifier for new study (the name):');
study.name = createTextField(frame,[0 0.5 1 .1],'');
% base-dir
dirlabel = createLabel(frame,[0 0.4 1 0.1],'Full path to the directory containing the data:');
study.basedir = createTextField(frame,[0 0.3 1 .1],'');
%fertig-button
btnSwitchPreprocessing = uicontrol(frame,'Style','pushbutton',...
'String','create',...
'Units','normalized','Position',[0.0 0.0 1 0.1]);
set(btnSwitchPreprocessing,'Callback',{@cbCreateStudy,study,frame,uimodel,menu});
set(btnSwitchPreprocessing,'Enable','on');
end
function uimodel = cbCreateStudy(src,evnt,study,window,uimodel,menu)
% global SVMCROSSVAL_STUDYDIR;
disp('Creating new Study');
if strcmp(get(study.name,'String'),'') || strcmp(get(study.basedir,'String'),'')
error('spm_SVMCrossVal:createStudy','please provide Name and Path');
end
studyID = get(study.name,'String');
baseDir = get(study.basedir,'String');
set(uimodel.txtBaseDir,'String',baseDir);
set(uimodel.txtStudyID,'String',studyID);
StudyArgs.subjectSelectString = listDirNames(baseDir);
StudyArgs.subjectSelectValue = 1;
set(uimodel.subjectSelector,'String',StudyArgs.subjectSelectString);
set(uimodel.subjectSelector,'UserData',StudyArgs.subjectSelectString);
set(uimodel.subjectSelector,'Value',StudyArgs.subjectSelectValue);
StudyArgs.imageTypeSelectionString = imageMaskNames(fullfile(baseDir,cell2mat(StudyArgs.subjectSelectString(StudyArgs.subjectSelectValue))));
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX