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

📄 view_nii.m

📁 Please read your package and describe it at least 40 bytes. System will automatically delete the di
💻 M
📖 第 1 页 / 共 5 页
字号:
   h = (front_pos(2) - y) / 2;
   y = y + h;

   pos = [x y w h];

   if ydim > 1,
      slider_step(1) = 1/(ydim);
      slider_step(2) = 1.00001/(ydim);

      slider_val = nii_view.dims(2) - nii_view.slices.cor + 1;

      handles.coronal_slider = uicontrol('Parent',fig, ...
                'Style','slider','Units','Normalized', Font, ...
                'Position',pos, 'HorizontalAlignment','center',...
                'BackgroundColor',[0.5 0.5 0.5],'ForegroundColor',[0 0 0],...
                'BusyAction','queue',...
                'TooltipString','Coronal slice navigation',...
                'Min',1,'Max',ydim,'SliderStep',slider_step, ...
                'Value',slider_val,...
                'Callback','view_nii(''coronal_slider'');');

      set(handles.coronal_slider,'position',pos);	% linux66
   end

   %  Axial Slider
   %
%   x = front_pos(1) + front_pos(3);
%   y = front_pos(2);
%   w = side_pos(1) - x;
%   h = front_pos(4);

   x = top_pos(1);
   y = area(2);
   w = top_pos(3);
   h = top_pos(2) - y;

   pos = [x y w h];

   if zdim > 1,
      slider_step(1) = 1/(zdim);
      slider_step(2) = 1.00001/(zdim);

      handles.axial_slider = uicontrol('Parent',fig, ...
                'Style','slider','Units','Normalized', Font, ...
                'Position',pos, 'HorizontalAlignment','center',...
                'BackgroundColor',[0.5 0.5 0.5],'ForegroundColor',[0 0 0],...
                'BusyAction','queue',...
                'TooltipString','Axial slice navigation',...
                'Min',1,'Max',zdim,'SliderStep',slider_step, ...
                'Value',nii_view.slices.axi,...
                'Callback','view_nii(''axial_slider'');');

      set(handles.axial_slider,'position',pos);	% linux66
   end

   %  plot info view
   %
%   info_pos = [side_pos([1,3]); top_pos([2,4])];
%   info_pos = info_pos(:);
   gap = side_pos(1)-(top_pos(1)+top_pos(3));
   info_pos(1) = side_pos(1) + gap;
   info_pos(2) = area(2);
   info_pos(3) = side_pos(3) - gap;
   info_pos(4) = top_pos(2) + top_pos(4) - area(2) - gap;

   num_inputline = 10;
   inputline_space =info_pos(4) / num_inputline;


   %  for any info_area change, update_usestretch should also be changed


   %  Image Intensity Value at Cursor
   %
   x = info_pos(1);
   y = info_pos(2);
   w = info_pos(3)*0.5;
   h = inputline_space*0.6;

   pos = [x y w h];

   handles.Timvalcur = uicontrol('Parent',fig,'Style','text', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'left',...
      'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'visible','off', ...
      'String','Value at cursor:');

   if usepanel
      set(handles.Timvalcur, 'visible', 'on');
   end

   x = x + w;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.imvalcur = uicontrol('Parent',fig,'Style','text', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'right',...
      'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'visible','off', ...
      'String',' ');

   if usepanel
      set(handles.imvalcur, 'visible', 'on');
   end

   %  Position at Cursor
   %
   x = info_pos(1);
   y = y + inputline_space;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.Timposcur = uicontrol('Parent',fig,'Style','text', ...
        'Units','Normalized', Font, ...
        'Position',pos, 'HorizontalAlignment', 'left',...
        'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
        'BusyAction','queue',...
        'visible','off', ...
        'String','[X Y Z] at cursor:');

   if usepanel
      set(handles.Timposcur, 'visible', 'on');
   end

   x = x + w;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.imposcur = uicontrol('Parent',fig,'Style','text', ...
        'Units','Normalized', Font, ...
        'Position',pos, 'HorizontalAlignment', 'right',...
        'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
        'BusyAction','queue',...
        'visible','off', ...
        'String',' ','Value',[0 0 0]);

   if usepanel
      set(handles.imposcur, 'visible', 'on');
   end

   %  Image Intensity Value at Mouse Click
   %
   x = info_pos(1);
   y = y + inputline_space;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.Timval = uicontrol('Parent',fig,'Style','text', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'left',...
      'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'visible','off', ...
      'String','Value at crosshair:');

   if usepanel
      set(handles.Timval, 'visible', 'on');
   end

   x = x + w;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.imval = uicontrol('Parent',fig,'Style','text', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'right',...
      'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'visible','off', ...
      'String',' ');

   if usepanel
      set(handles.imval, 'visible', 'on');
   end

   %  Viewpoint Position at Mouse Click
   %
   x = info_pos(1);
   y = y + inputline_space;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.Timpos = uicontrol('Parent',fig,'Style','text', ...
        'Units','Normalized', Font, ...
        'Position',pos, 'HorizontalAlignment', 'left',...
        'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
        'BusyAction','queue',...
        'visible','off', ...
        'String','[X Y Z] at crosshair:');

   if usepanel
      set(handles.Timpos, 'visible', 'on');
   end

   x = x + w + 0.005;
   y = y - 0.008;
   w = info_pos(3)*0.5;
   h = inputline_space*0.9;

   pos = [x y w h];

   handles.impos = uicontrol('Parent',fig,'Style','edit', ...
        'Units','Normalized', Font, ...
        'Position',pos, 'HorizontalAlignment', 'right',...
        'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0],...
        'BusyAction','queue',...
        'Callback','view_nii(''impos_edit'');', ...
        'TooltipString','Viewpoint Location in Axes Unit', ...
        'visible','off', ...
        'String',' ','Value',[0 0 0]);

   if usepanel
      set(handles.impos, 'visible', 'on');
   end

   %  Origin Position
   %
   x = info_pos(1);
   y = y + inputline_space*1.2;
   w = info_pos(3)*0.5;
   h = inputline_space*0.6;

   pos = [x y w h];

   handles.Torigin = uicontrol('Parent',fig,'Style','text', ...
        'Units','Normalized', Font, ...
        'Position',pos, 'HorizontalAlignment', 'left',...
        'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
        'BusyAction','queue',...
        'visible','off', ...
        'String','[X Y Z] at origin:');

   if usepanel
      set(handles.Torigin, 'visible', 'on');
   end

   x = x + w;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.origin = uicontrol('Parent',fig,'Style','text', ...
        'Units','Normalized', Font, ...
        'Position',pos, 'HorizontalAlignment', 'right',...
        'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
        'BusyAction','queue',...
        'visible','off', ...
        'String',' ','Value',[0 0 0]);

   if usepanel
      set(handles.origin, 'visible', 'on');
   end

if 0
   %  Voxel Unit
   %
   x = info_pos(1);
   y = y + inputline_space;
   w = info_pos(3)*0.5;

   pos = [x y w h];

   handles.Tcoord = uicontrol('Parent',fig,'Style','text', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'left',...
      'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'visible','off', ...
      'String','Axes Unit:');

   if usepanel
      set(handles.Tcoord, 'visible', 'on');
   end

   x = x + w + 0.005;
   w = info_pos(3)*0.5 - 0.005;

   pos = [x y w h];

   Font.FontSize   = 8;

   handles.coord = uicontrol('Parent',fig,'Style','popupmenu', ...
      'Units','Normalized', Font, ...
      'Position',pos, ...
      'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'TooltipString','Choose Voxel or Millimeter',...
      'String',{'Voxel','Millimeter'},...
      'visible','off', ...
      'Callback','view_nii(''coordinates'');');

%      'TooltipString','Choose Voxel, MNI or Talairach Coordinates',...
%      'String',{'Voxel','MNI (mm)','Talairach (mm)'},...

   Font.FontSize   = 12;

   if usepanel
      set(handles.coord, 'visible', 'on');
   end
end

   %  Crosshair
   %
   x = info_pos(1);
   y = y + inputline_space;
   w = info_pos(3)*0.4;

   pos = [x y w h];

   handles.Txhair = uicontrol('Parent',fig,'Style','text', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'left',...
      'BackgroundColor', [0.8 0.8 0.8], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'visible','off', ...
      'String','Crosshair:');

   if usepanel
      set(handles.Txhair, 'visible', 'on');
   end

   x = info_pos(1) + info_pos(3)*0.5;
   w = info_pos(3)*0.2;
   h = inputline_space*0.7;

   pos = [x y w h];

   Font.FontSize   = 8;

   handles.xhair_color = uicontrol('Parent',fig,'Style','push', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'center',...
      'TooltipString','Crosshair Color',...
      'User',[1 0 0],...
      'String','Color',...
      'visible','off', ...
      'Callback','view_nii(''xhair_color'');');

   if usepanel
      set(handles.xhair_color, 'visible', 'on');
   end

   x = info_pos(1) + info_pos(3)*0.7;
   w = info_pos(3)*0.3;

   pos = [x y w h];

   handles.xhair = uicontrol('Parent',fig,'Style','popupmenu', ...
      'Units','Normalized', Font, ...
      'Position',pos, ...
      'BackgroundColor', [1 1 1], 'ForegroundColor', [0 0 0],...
      'BusyAction','queue',...
      'TooltipString','Display or Hide Crosshair',...
      'String',{'On','Off'},...
      'visible','off', ...
      'Callback','view_nii(''crosshair'');');

   if usepanel
      set(handles.xhair, 'visible', 'on');
   end

   %  Histogram & Color
   %
   x = info_pos(1);
   w = info_pos(3)*0.45;
   h = inputline_space * 1.5;

   pos = [x,  y+inputline_space*0.9,  w,  h];

   handles.hist_frame = uicontrol('Parent',fig, ...	
   	'Units','normal', ...
   	'BackgroundColor',[0.8 0.8 0.8], ...
   	'Position',pos, ...
        'visible','off', ...
   	'Style','frame');

   if usepanel
%      set(handles.hist_frame, 'visible', 'on');
   end

   handles.coord_frame = uicontrol('Parent',fig, ...	
   	'Units','normal', ...
   	'BackgroundColor',[0.8 0.8 0.8], ...
   	'Position',pos, ...
        'visible','off', ...
   	'Style','frame');

   if usepanel
      set(handles.coord_frame, 'visible', 'on');
   end

   x = info_pos(1) + info_pos(3)*0.475;
   w = info_pos(3)*0.525;
   h = inputline_space * 1.5;

   pos = [x,  y+inputline_space*0.9,  w,  h];

   handles.color_frame = uicontrol('Parent',fig, ...	
   	'Units','normal', ...
   	'BackgroundColor',[0.8 0.8 0.8], ...
   	'Position',pos, ...
        'visible','off', ...
   	'Style','frame');

   if usepanel
      set(handles.color_frame, 'visible', 'on');
   end

   x = info_pos(1) + info_pos(3)*0.025;
   y = y + inputline_space*1.2;
   w = info_pos(3)*0.2;
   h = inputline_space*0.7;

   pos = [x y w h];

   Font.FontSize   = 8;

   handles.hist_eq = uicontrol('Parent',fig,'Style','toggle', ...
      'Units','Normalized', Font, ...
      'Position',pos, 'HorizontalAlignment', 'center',...

⌨️ 快捷键说明

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