⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reho_gui.m

📁 While resting-state fMRI is drawing more and more attention, there has not been a software for its d
💻 M
📖 第 1 页 / 共 4 页
字号:
			theMaskFile =handles.Cfg.MaskFile;
			rest_DivideMeanWithinMask(theOrigReHoMap, theMeanReHoMap, theMaskFile);
			msgbox(sprintf('ReHo brain "%s.{hdr/img}" \ndivide its mean within mask successfully.\t\n\nSave to "%s.{hdr/img}"\n' , ... 
					theOrigReHoMap, theMeanReHoMap), ...				
					'Divide mean within mask successfully' ,'help');
	    end    
	catch
		rest_misc( 'DisplayLastException');
	end
	set(hObject,'Enable','on', 'BackgroundColor', theOldColor);
	drawnow;
% manually band pass filter	
function btnBandPass_Callback(hObject, eventdata, handles)
	theOldColor=get(hObject,'BackgroundColor');		
	set(hObject,'Enable','off', 'BackgroundColor', 'red');
	drawnow;
	try
	    %Band pass filter
		if strcmpi(handles.Filter.UseFilter, 'Yes')
			BandPass(hObject, handles);
			msgbox('Ideal Band Pass filter Over.',...
					'Filter successfully' ,'help');
		else
			errordlg(sprintf('You didn''t select option "Band Pass". \n\nPlease slect first.'));
		end
		UpdateDisplay(handles);		
	catch
		rest_misc( 'DisplayLastException');
	end	
	rest_waitbar;
	set(hObject,'Enable','on', 'BackgroundColor', theOldColor);
	drawnow;
    
%%Create GUI

%%Create Frames/Lines
function InitFrames(hObject,handles);
	offsetY =80; %dawnsong, 20070504, add for the divide by the mask mean, the Y of Edit "OutPut Diectory"
	% for Matlab 6.5 compatible, draw a panel
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+151 433 1]);
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+241 433 1]);
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[90 offsetY+152 1 90]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+152 1 233]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[435 offsetY+152 1 233]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+385 433 1]);	
	uicontrol(handles.figRehoMain,'Style','Text','Position',[152 offsetY+380 140 14],...
		'String','Input Parameters');
	uicontrol(handles.figRehoMain,'Style','Text','Position',[8 offsetY+238 40 14],...
		'String','Cluster');	
	uicontrol(handles.figRehoMain,'Style','Text','Position',[208 offsetY+238 40 14],...
		'String','Mask');	
	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+94 433 1]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY-8 433 1]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY-8 1 102]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[435 offsetY-8 1 102]);	
	uicontrol(handles.figRehoMain,'Style','Text','Position',[152 offsetY+88 160 14],...
		'String','Output Parameters (ReHo map)');
		
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+400 433 1]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[435 offsetY+400 1 50]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+400 1 50]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+450 433 1]);	
	uicontrol(handles.figRehoMain,'Style','Text','Position',[142 offsetY+445 180 14],...
		'String','Option: Ideal Band Pass Filter');
	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+465 433 1]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[435 offsetY+465 1 50]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+465 1 50]);	
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY+515 433 1]);	
	uicontrol(handles.figRehoMain,'Style','Text','Position',[142 offsetY+505 180 14],...
		'String','Option: Remove Linear Trend');
	
	
	%20070506, Add manual operation button groups like SPM
	uicontrol(handles.figRehoMain, 'Style','Frame','Position',[2 offsetY-25 433 1]);	
	uicontrol(handles.figRehoMain,'Style','Text','Position',[152 offsetY-30 140 14],...
		'String','Manual Operations');
	

function InitControlProperties(hObject, handles)
	%for Linux compatible 20070507 dawnsong
	% --- FIGURE -------------------------------------
	set(handles.figRehoMain,...
		'Units', 'pixels', ...
		'Position', [10 5 440 600], ...
		'Name', 'reho_gui', ...
		'MenuBar', 'none', ...
		'NumberTitle', 'off', ...		
		'Color', get(0,'DefaultUicontrolBackgroundColor'));

	% --- STATIC TEXTS -------------------------------------
	set(handles.text2,	...
		'Style', 'text', ...
		'Units', 'pixels', ...
		'Position', [16 186 91 40], ...
		'FontSize', 24, ...
		'FontWeight', 'bold', ...
		'String', 'ReHo');

	set(handles.text4,	...
		'Style', 'text', ...
		'Units', 'pixels', ...
		'Position', [8 109 80 21], ...
		'String', 'Directory:');

	set(handles.txtInputDir,	...
		'Style', 'text', ...
		'Units', 'pixels', ...
		'Position', [7 336 80 21], ...
		'String', 'Data Directory:');

	set(handles.text5,	...
		'Style', 'text', ...
		'Units', 'pixels', ...
		'Position', [9 140 80 21], ...
		'String', 'Prefix:');

	set(handles.txtResultFilename,	...
		'Style', 'text', ...
		'Units', 'pixels', ...
		'Position', [227 148 200 16], ...
		'HorizontalAlignment','left'         , ...
		'String', 'Result: Prefix_DirectoryName.{hdr/img}');

	set(handles.text7,	...
		'Style', 'text', ...
		'Units', 'pixels', ...
		'Position', [144 476 25 51], ...
		'FontSize', 28, ...		
		'String', '~');

	set(handles.text8,	...
		'Style', 'text', ...
		'Units', 'pixels', ...
		'Position', [230 491 45 16], ...
		'String', 'TR: (s)');

	% --- PUSHBUTTONS -------------------------------------
	set(handles.btnSelectOutputDir,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [396 107 30 25], ...
		'FontSize', 18, ...
		'String', '...');

	set(handles.btnSelectDataDir,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [396 334 30 25], ...
		'FontSize', 18, ...
		'String', '...', ...
		'CData', zeros(1,0));

	set(handles.btnSelectMask,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [396 240 30 25], ...
		'FontSize', 18, ...
		'String', '...', ...
		'Enable', 'off', ...
		'CData', zeros(1,0));

	set(handles.btnComputeReho,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [316 186 110 33], ...
		'FontSize', 12, ...
		'FontWeight', 'bold', ...
		'String', 'Do all');

	
	set(handles.btnDetrend , ...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [337 553 90 25], ...
		'FontSize', 10, ...
		'Enable', 'off', ...   %Update filter and detrend button's state according to Option: detrend/Filter 20070820
		'String', 'Detrend');
	set(handles.btnBandPass , ...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [337 490 90 25], ...
		'FontSize', 10, ...
		'Enable', 'off', ...  %Update filter and detrend button's state according to Option: detrend/Filter 20070820
		'String', 'Filter');
	set(handles.btnHelp,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [10 10 90 33], ...
		'FontSize', 10, ...
		'String', 'Help');	
	set(handles.btnDivideMean,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [110 10 90 33], ...
		'FontSize', 10, ...
		'String', 'Divide Mean');
	set(handles.btnSliceViewer,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [210 10 90 33], ...
		'FontSize', 10, ...
		'String', 'Slice Viewer');	
	set(handles.btnWaveGraph,	...
		'Style', 'pushbutton', ...
		'Units', 'pixels', ...
		'Position', [314 10 110 33], ...
		'FontSize', 10, ...
		'String', 'Power Spectrum');
		
		
	% --- RADIO BUTTONS -------------------------------------
	set(handles.rbtn7voxels,	...
		'Style', 'radiobutton', ...
		'Units', 'pixels', ...
		'Position', [10 298 70 16], ...
		'String', '7 voxels');

	set(handles.rbtn19voxels,	...
		'Style', 'radiobutton', ...
		'Units', 'pixels', ...
		'Position', [10 273 70 16], ...
		'String', '19 voxels');

	set(handles.rbtn27voxels,	...
		'Style', 'radiobutton', ...
		'Units', 'pixels', ...
		'Position', [10 248 70 16], ...
		'String', '27 voxels');

	set(handles.rbtnDefaultMask,	...
		'Style', 'radiobutton', ...
		'Units', 'pixels', ...
		'Position', [110 297 158 16], ...
		'String', 'Default mask');

	set(handles.rbtnUserMask,	...
		'Style', 'radiobutton', ...
		'Units', 'pixels', ...
		'Position', [110 271 148 16], ...
		'String', 'User''s defined mask');

	set(handles.rbtnNullMask,	...
		'Style', 'radiobutton', ...
		'Units', 'pixels', ...
		'Position', [277 298 82 16], ...
		'String', 'No mask');

	% --- CHECKBOXES -------------------------------------
	set(handles.ckboxFilter, ...
		'Style', 'checkbox', ...
		'Units', 'pixels', ...
		'Position', [14 491 80 22], ...
		'String', 'Band (Hz)');
	set(handles.ckboxRetrend, ...		
		'Style', 'checkbox', ...
		'Units', 'pixels', ...
		'Visible', 'off', ...
		'Position', [366 490 60 22], ...
		'String', 'Retrend');
	set(handles.ckboxDivideMean,	...
		'Style', 'checkbox', ...
		'Units', 'pixels', ...
		'Position', [12 82 430 19], ...
		'String', 'Divide ReHo brain by the mean within the mask (mPrefix_DirectoryName.{hdr/img})');
	set(handles.ckboxRemoveTrendBefore, ...
		'Style', 'checkbox', ...
		'Units', 'pixels', ...
		'Position', [13 555 140 21],...
		'String', 'detrend');		%'String', 'detrend BEFORE Filter');
	set(handles.ckboxRemoveTrendAfter, ...
		'Style', 'checkbox', ...
		'Units', 'pixels', ...
		'Position', [171 555 140 21],...
		'Visible', 'off', ...
		'String', 'detrend AFTER Filter');

		
	% --- EDIT TEXTS -------------------------------------
	set(handles.edtOutputDir,	...
		'Style', 'edit', ...
		'Units', 'pixels', ...
		'Position', [94 109 300 23], ...
		'BackgroundColor', [1 1 1], ...
		'String', 'Edit Text');

	set(handles.edtDataDirectory,	...
		'Style', 'edit', ...
		'Units', 'pixels', ...
		'Position', [94 336 300 22], ...
		'BackgroundColor', [1 1 1], ...
		'String', '');

	set(handles.edtMaskfile,	...
		'Style', 'edit', ...
		'Units', 'pixels', ...
		'Position', [94 240 300 23], ...
		'BackgroundColor', [1 1 1], ...
		'String', 'Edit Text', ...
		'Enable', 'off');

	set(handles.edtPrefix,	...
		'Style', 'edit', ...
		'Units', 'pixels', ...
		'Position', [94 142 115 22], ...
		'BackgroundColor', [1 1 1], ...
		'String', 'RehoMap');

	set(handles.edtBandLow,	...

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -