📄 rest_setroi.m
字号:
%Time Course
uicontrol(AConfig.hFig, 'Style','Frame', 'Units','pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Position', [theLeft,theBottom,380,70]);
hSlectTxt =uicontrol('Style', 'radiobutton', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), 'Value', 0,...
'Position', [theLeft+10,theBottom+60,120,20],...
'String', 'Time courses');
uicontrol('Style', 'text', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'HorizontalAlignment', 'left', ...
'Visible', 'on', ...
'Position', [theLeft+10,theBottom+30,360,25], ...
'String', sprintf(['User defined time courses contained in a txt file']));
hROITxtLocation =uicontrol('Style', 'edit', 'Units', 'pixels', ...%'BackgroundColor', get(AConfig.hFig,'Color'), ...
'HorizontalAlignment', 'left', ...
'Visible', 'on', ...
'ForegroundColor', 'red', 'FontWeight', 'bold', ...
'Position', [theLeft+10,theBottom+10,360,20], ...
'String', 'dd');
set(hROITxtLocation, 'Callback',sprintf('rest_SetROI( ''ManualyChangeROIDefinitionInEdit'')'));
%ROI
OffsetX =MarginX;
OffsetY =MarginY+80;
theLeft =OffsetX; theBottom =OffsetY +40;
uicontrol(AConfig.hFig, 'Style','Frame', 'Units','pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Position', [theLeft,theBottom,380,160]);
hSlectNonSphere =uicontrol('Style', 'radiobutton', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Position', [theLeft+10,theBottom+150,120,20],'String', 'ROI');
hNonSphereDescription =uicontrol('Style', 'text', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'HorizontalAlignment', 'left', ...
'Visible', 'on', ...
'Position', [theLeft+10,theBottom+40,360,105], ...
'String', sprintf(['There are 4 methods to generate the ROI mask file:' ...
'\n\n1. From statistical t-map by selecting cluster after thresholding' ...
'\n2. From AAL template by selecting specific area'...
'\n3. From Brodmann template by selecting specific area'...
'\n4. From user defined mask file']));
hFromTMap=uicontrol('Style', 'radiobutton', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Visible', 'off', ...
'Position', [theLeft+30,theBottom+105,340,16],'String', '1. From statistical t-map by selecting cluster after thresholding');
hFromAAL=uicontrol('Style', 'radiobutton', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Visible', 'off', ...
'Position', [theLeft+30,theBottom+85,340,16],'String', '2. From AAL template by selecting specific area');
hFromBrodmann=uicontrol('Style', 'radiobutton', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Visible', 'off', ...
'Position', [theLeft+30,theBottom+65,340,16],'String', '3. From Brodmann template by selecting specific area');
hFromUserDefinedMask=uicontrol('Style', 'radiobutton', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Visible', 'off', ...
'Position', [theLeft+30,theBottom+45,340,16],'String', '4. From user defined mask file');
hROINonSphereInfo =uicontrol('Style', 'edit', 'Units', 'pixels', ...%'BackgroundColor', get(AConfig.hFig,'Color'), ...
'HorizontalAlignment', 'left', ...
'Visible', 'on', ...
'ForegroundColor', 'red', 'FontWeight', 'bold', ...
'Position', [theLeft+10,theBottom+10,360,20], ...
'String', 'dd');
set(hROINonSphereInfo, 'Callback',sprintf('rest_SetROI( ''ManualyChangeROIDefinitionInEdit'')'));
%Seed ROI
theLeft =OffsetX; theBottom =OffsetY +220;
uicontrol(AConfig.hFig, 'Style','Frame', 'Units','pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'Position', [theLeft,theBottom,380,70]);
hSlectSphere =uicontrol('Style', 'radiobutton', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), 'Value', 1,...
'Position', [theLeft+10,theBottom+60,120,20],'String', 'Seed ROI');
uicontrol('Style', 'text', 'Units', 'pixels', ...
'BackgroundColor', get(AConfig.hFig,'Color'), ...
'HorizontalAlignment', 'left', ...
'Visible', 'on', ...
'Position', [theLeft+10,theBottom+30,360,25], ...
'String', sprintf(['Define a seed ROI by setting the center coordinate and the radius(mm)']));
hROISphereInfo =uicontrol('Style', 'edit', 'Units', 'pixels', ...%'BackgroundColor', get(AConfig.hFig,'Color'), ...
'HorizontalAlignment', 'left', ...
'Visible', 'on', ...
'ForegroundColor', 'red', 'FontWeight', 'bold', ...
'Position', [theLeft+10,theBottom+10,360,20], ...
'String', 'dd');
set(hROISphereInfo, 'Callback',sprintf('rest_SetROI( ''ManualyChangeROIDefinitionInEdit'')'));
uicontrol('Style', 'pushbutton', 'Units', 'pixels', ...
'Visible', 'on', 'Callback', sprintf('rest_SetROI(''Delete'');') ,...
'Position', [MarginX,MarginY,75,25], ...
'String', 'Done');
%rest_misc( 'ViewROI', AROIDef);
uicontrol('Style', 'pushbutton', 'Units', 'pixels', ...
'Visible', 'on', 'Callback', sprintf('rest_SetROI(''ViewROI'');') ,...
'Position', [MarginX+80,MarginY,75,25], ...
'String', 'View ROI');
hNext =uicontrol('Style', 'pushbutton', 'Units', 'pixels', ...
'Visible', 'on', ...
'Callback', 'rest_SetROI( ''Next'' );', ...
'Position', [MarginX+305,MarginY,75,25], ...
'String', 'Next');
theRadioButtons =findobj(AConfig.hFig, 'Style', 'radiobutton');
for x=1:length(theRadioButtons),
set(theRadioButtons(x), 'Callback', 'rest_SetROI( ''Select'' );');
end
%Save handles
AConfig.hSlectNonSphere =hSlectNonSphere;
AConfig.hNonSphereDescription =hNonSphereDescription;
AConfig.hFromTMap =hFromTMap ;
AConfig.hFromAAL =hFromAAL;
AConfig.hFromBrodmann =hFromBrodmann;
AConfig.hFromUserDefinedMask=hFromUserDefinedMask;
AConfig.hROINonSphereInfo=hROINonSphereInfo;
AConfig.hSlectSphere=hSlectSphere;
AConfig.hROISphereInfo=hROISphereInfo;
AConfig.hSlectTxt =hSlectTxt;
AConfig.hROITxtLocation =hROITxtLocation;
AConfig.hNext =hNext;
Result =AConfig;
function UpdateDisplay(AConfig)
if get(AConfig.hSlectSphere, 'Value'),
set(AConfig.hROISphereInfo, 'String', AConfig.ROIDefinition);
set(AConfig.hSlectNonSphere, 'Value', 0);
set(AConfig.hNonSphereDescription, 'String', sprintf(['There are 4 methods to generate the ROI mask file:' ...
'\n\n1. From statistical t-map by selecting cluster after thresholding' ...
'\n2. From AAL template by selecting specific area'...
'\n3. From Brodmann template by selecting specific area'...
'\n4. From user defined mask file']));
set(AConfig.hFromTMap, 'Visible', 'off');
set(AConfig.hFromAAL, 'Visible', 'off');
set(AConfig.hFromBrodmann, 'Visible', 'off');
set(AConfig.hFromUserDefinedMask, 'Visible', 'off');
set(AConfig.hROINonSphereInfo, 'String', '');
set(AConfig.hSlectTxt, 'Value', 0);
set(AConfig.hROITxtLocation, 'String', '');
elseif get(AConfig.hSlectNonSphere, 'Value'),
set(AConfig.hSlectSphere, 'Value', 0);
set(AConfig.hROISphereInfo, 'String', '');
set(AConfig.hNonSphereDescription, 'String',sprintf(['There are 4 methods to generate the ROI mask file:']));
set(AConfig.hFromTMap, 'Visible', 'on');
set(AConfig.hFromAAL, 'Visible', 'on');
set(AConfig.hFromBrodmann, 'Visible', 'on');
set(AConfig.hFromUserDefinedMask, 'Visible', 'on');
set(AConfig.hROINonSphereInfo, 'String', AConfig.ROIDefinition);
set(AConfig.hSlectTxt, 'Value', 0);
set(AConfig.hROITxtLocation, 'String', '');
elseif get(AConfig.hSlectTxt, 'Value'),
set(AConfig.hSlectSphere, 'Value', 0);
set(AConfig.hROISphereInfo, 'String', '');
set(AConfig.hSlectNonSphere, 'Value', 0);
set(AConfig.hNonSphereDescription, 'String', sprintf(['There are 4 methods to generate the ROI mask file:' ...
'\n\n1. From statistical t-map by selecting cluster after thresholding' ...
'\n2. From AAL template by selecting specific area'...
'\n3. From Brodmann template by selecting specific area'...
'\n4. From user defined mask file']));
set(AConfig.hFromTMap, 'Visible', 'off');
set(AConfig.hFromAAL, 'Visible', 'off');
set(AConfig.hFromBrodmann, 'Visible', 'off');
set(AConfig.hFromUserDefinedMask, 'Visible', 'off');
set(AConfig.hROINonSphereInfo, 'String', '');
set(AConfig.hROITxtLocation, 'String', AConfig.ROIDefinition);
end
set(AConfig.hNext, 'Enable', 'on', 'ForegroundColor', 'black');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -