Browse code

first eventually working study switch functionality

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@198 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on29/07/2009 15:51:21
Showing1 changed files
... ...
@@ -1,9 +1,9 @@
1
-function ui_createStudy()
2
-    frameWidth=450;
3
-    frameHeight=450;
1
+function ui_createStudy(menu,uimodel)
2
+    frameWidth=300;
3
+    frameHeight=200;
4 4
     
5
-    frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
6
-    movegui(frame,'west'); % get this thing visible on smaller displays.
5
+    frame = figure('Visible','on','Position',[0,0,frameWidth,frameHeight]);
6
+    movegui(frame,'center'); % get this thing visible on smaller displays.
7 7
     set(frame,'Name','Create Study');
8 8
     set(frame,'NumberTitle','off');
9 9
     set(frame,'MenuBar','none');
... ...
@@ -13,4 +13,54 @@ function ui_createStudy()
13 13
     set(frame,'Color','y');
14 14
 
15 15
     
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);
16 66
 end
17 67
\ No newline at end of file
Browse code

spm2 compatibility, start change study

git-svn-id: https://svn.discofish.de/MATLAB/spmtoolbox/SVMCrossVal@195 83ab2cfd-5345-466c-8aeb-2b2739fb922d

Christoph Budziszewski authored on22/05/2009 11:16:41
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,16 @@
1
+function ui_createStudy()
2
+    frameWidth=450;
3
+    frameHeight=450;
4
+    
5
+    frame = figure('Visible','off','Position',[0,0,frameWidth,frameHeight]);
6
+    movegui(frame,'west'); % get this thing visible on smaller displays.
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
+    
16
+end
0 17
\ No newline at end of file