spm2 compatibility, start c...
Christoph Budziszewski authored 14 years ago
|
7) set(frame,'Name','Create Study');
8) set(frame,'NumberTitle','off');
9) set(frame,'MenuBar','none');
10) % set(frame,'Color',get(0,'defaultUicontrolBackgroundColor'));
11) set(frame,'Resize','on');
12) set(frame,'Units','normalized');
13) set(frame,'Color','y');
14)
15)
|
first eventually working st...
Christoph Budziszewski authored 14 years ago
|
16) study= struct();
17) % name
18) namelabel = createLabel(frame,[0 0.6 1 0.1],'Identifier for new study (the name):');
19) study.name = createTextField(frame,[0 0.5 1 .1],'');
20) % base-dir
21) dirlabel = createLabel(frame,[0 0.4 1 0.1],'Full path to the directory containing the data:');
22) study.basedir = createTextField(frame,[0 0.3 1 .1],'');
23)
24) %fertig-button
25) btnSwitchPreprocessing = uicontrol(frame,'Style','pushbutton',...
26) 'String','create',...
27) 'Units','normalized','Position',[0.0 0.0 1 0.1]);
28) set(btnSwitchPreprocessing,'Callback',{@cbCreateStudy,study,frame,uimodel,menu});
29) set(btnSwitchPreprocessing,'Enable','on');
30)
31) end
32)
33) function uimodel = cbCreateStudy(src,evnt,study,window,uimodel,menu)
34) % global SVMCROSSVAL_STUDYDIR;
35) disp('Creating new Study');
36) if strcmp(get(study.name,'String'),'') || strcmp(get(study.basedir,'String'),'')
37) error('spm_SVMCrossVal:createStudy','please provide Name and Path');
38) end
39) studyID = get(study.name,'String');
40) baseDir = get(study.basedir,'String');
41)
42) set(uimodel.txtBaseDir,'String',baseDir);
43) set(uimodel.txtStudyID,'String',studyID);
44)
45) StudyArgs.subjectSelectString = listDirNames(baseDir);
46) StudyArgs.subjectSelectValue = 1;
47) set(uimodel.subjectSelector,'String',StudyArgs.subjectSelectString);
48) set(uimodel.subjectSelector,'UserData',StudyArgs.subjectSelectString);
49) set(uimodel.subjectSelector,'Value',StudyArgs.subjectSelectValue);
50)
51) StudyArgs.imageTypeSelectionString = imageMaskNames(fullfile(baseDir,cell2mat(StudyArgs.subjectSelectString(StudyArgs.subjectSelectValue))));
52) StudyArgs.imageTypeSelectionValue = 1;
53) set(uimodel.imageTypeSelection, 'String' ,StudyArgs.imageTypeSelectionString);
54) set(uimodel.imageTypeSelection, 'UserData',StudyArgs.imageTypeSelectionString);
55) set(uimodel.imageTypeSelection, 'Value' ,StudyArgs.imageTypeSelectionValue);
56)
57) % des =
58) % tr = des.xsDes.Interscan_interval(1:end-3);
59) StudyArgs.trlabel = '2';
60) set(uimodel.labelTR, 'String',sprintf(StudyArgs.trlabel));
61)
62) studyfile = [studyID '.mat'];
63) saveStudy(studyID,uimodel);
64) addStudyToMenu(menu,studyfile,uimodel);
65) close(window);
|