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

📄 avw_view.m

📁 mri_toolbox是一个工具用来MRI. 来自于SourceForge, 我上传这个软件,希望能结识对医疗软件感兴趣的兄弟.
💻 M
📖 第 1 页 / 共 5 页
字号:
      'Callback','avw_view([],[],''sagittal_slider'');');
  end
  handles.sagittal_sliderN = uicontrol('Parent',GUI,'Style','text',...
    'Units','Normalized', Font, ...
    'Position',[.65 GUIheight .03 .03], 'HorizontalAlignment', 'center',...
    'BackgroundColor',[0 0 0],'ForegroundColor',[1 1 1],...
    'BusyAction','queue',...
    'TooltipString','Sagittal slice number',...
    'String',num2str(AVWVIEW.slices.sag),'Value',AVWVIEW.slices.sag);
  handles.sagittal_sliderT = uicontrol('Parent',GUI,'Style','text',...
    'Units','Normalized', Font, ...
    'Position',[.70 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
    'BackgroundColor',[0 0 0],'ForegroundColor',[1 1 1],...
    'BusyAction','queue',...
    'TooltipString','Sagittal slice navigation',...
    'String','Sagittal');
  
  handles.sagittal_xlim = get(handles.sagittal_axes,'Xlim');
  handles.sagittal_ylim = get(handles.sagittal_axes,'Ylim');
  handles.sagittal_xline = line('Xdata',[AVWVIEW.slices.cor AVWVIEW.slices.cor],'Ydata',handles.sagittal_ylim);
  handles.sagittal_yline = line('Ydata',[AVWVIEW.slices.axi AVWVIEW.slices.axi],'Xdata',handles.sagittal_xlim);
  set(handles.sagittal_xline,'Color','b','EraseMode','xor','Tag','XLINE');
  set(handles.sagittal_yline,'Color','b','EraseMode','xor','Tag','YLINE');
  
end



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Image Contex Menus

menu=uicontextmenu;

% enable right click access to ROI tools
roi = uimenu(menu,'Label','ROI');
uimenu(roi,'Label','ROI (9x9x9 block)','Callback','avw_view([],[],''roi_9'');');
uimenu(roi,'Label','ROI (7x7x7 block)','Callback','avw_view([],[],''roi_7'');');
uimenu(roi,'Label','ROI (5x5x5 block)','Callback','avw_view([],[],''roi_5'');');
uimenu(roi,'Label','ROI (3x3x3 block)','Callback','avw_view([],[],''roi_3'');');

% save image to graphics file
uimenu(menu,'Label','Save Image','Callback','avw_view([],[],''save_image'');');

% zoom image to new figure
uimenu(menu,'Label','Zoom Image','Callback','avw_view([],[],''zoom'');');

if isfield(handles,'axial_image'),
  if isempty(get(handles.axial_image,'uicontextmenu')),
    set(handles.axial_image,'uicontextmenu',menu);
  end
end
if isfield(handles,'coronal_image'),
  if isempty(get(handles.coronal_image,'uicontextmenu')),
    set(handles.coronal_image,'uicontextmenu',menu);
  end
end
if isfield(handles,'sagittal_image'),
  if isempty(get(handles.sagittal_image,'uicontextmenu')),
    set(handles.sagittal_image,'uicontextmenu',menu);
  end
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Image Intensity at Mouse Click

GUIheight = GUIheight - 0.04;

handles.Timval = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'String','Image Intensity');
handles.imval = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .15 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'String','x','Value',0);

% Image Position at Mouse Click

GUIheight = GUIheight - 0.04;

handles.Timpos = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'String','Image Position');
handles.impos = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .15 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'String','xyz','Value',[0 0 0]);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GUIheight = GUIheight - 0.04;

handles.flip = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Flip Left and Right (viewer only, see also avw_flip).',...
  'String','Flip L/R',...
  'Callback','avw_view([],[],''flip'');');
handles.flipStatus = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .15 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Flipped Status',...
  'String','R>>L (radiological)');


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% AC Location

GUIheight = GUIheight - 0.04;

handles.Tac = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','AC point in (voxels) or (meter offset from center of volume)',...
  'String','AC Point',...
  'Callback','avw_view([],[],''ac'');');
handles.ac = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .15 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','These values are offset from volume center.',...
  'String','x,y,z');

% Nasion Location

GUIheight = GUIheight - 0.04;

handles.Tnasion = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Update Nasion - should be toward +Y',...
  'String','Fiducial: Nas',...
  'Callback','avw_view([],[],''nasion'');');
handles.nasion = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .15 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','These values are offset from volume center, should be toward +Y',...
  'String','x,y,z');

% Right Preauricular Location

GUIheight = GUIheight - 0.04;

handles.Trpa = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Update Right Preauricular - should be toward -X',...
  'String','Fiducial: RPA',...
  'Callback','avw_view([],[],''rpa'');');
handles.rpa = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .15 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','These values are offset from volume center, should be toward -X',...
  'String','x,y,z');

% Left Preauricular Location

GUIheight = GUIheight - 0.04;

handles.Tlpa = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Update Left Preauricular - should be toward +X',...
  'String','Fiducial: LPA',...
  'Callback','avw_view([],[],''lpa'');');
handles.lpa = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .15 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','These values are offset from volume center, should be toward +X',...
  'String','x,y,z');


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GUIheight = GUIheight - 0.04;

handles.contrast = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Auto contrast with gray colormap',...
  'String','Auto Contrast',...
  'Callback','avw_view([],[],''contrast'');');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GUIheight = GUIheight - 0.04;

handles.dimmer = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.55 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Dim by 1%',...
  'String','Dimmer',...
  'Callback','avw_view([],[],''dimmer'');');

handles.brighter = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.65 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Brighten by 1%',...
  'String','Brighter',...
  'Callback','avw_view([],[],''brighter'');');

handles.clim = uicontrol('Parent',GUI,'Style','edit','Units','Normalized', Font, ...
  'Position',[.75 GUIheight .06 .03], 'HorizontalAlignment', 'right',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Image intensity Climit (inverse brightness)',...
  'String',num2str(AVWVIEW.clim(2)),...
  'Callback','avw_view([],[],''setClimit'');');

handles.cmap = uicontrol('Parent',GUI,'Style','popup','Units','Normalized', Font, ...
  'Position',[.82 GUIheight .06 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [0 0 0],...
  'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Color Map',...
  'String',{'gray','bone','copper','hot','cool','spring','summer','autumn','winter','hsv','jet'},...
  'Callback','avw_view([],[],''setCmap'');');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GUIheight = 0.46;

handles.crosshairs = uicontrol('Parent',GUI,'Style','checkbox','Units','Normalized', Font, ...
  'Position',[.85 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Toggle Crosshairs on/off',...
  'String','Crosshairs','Value',1,...
  'Callback','avw_view([],[],''crosshairs'');');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GUIheight = GUIheight - 0.04;

handles.histogram = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.85 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Histogram of Volume Intensity',...
  'String','Histogram',...
  'Callback','avw_view([],[],''histogram'');');


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

GUIheight = GUIheight - 0.04;

handles.coord = uicontrol('Parent',GUI,'Style','popupmenu','Units','Normalized', Font, ...
  'Position',[.85 GUIheight .10 .03], 'HorizontalAlignment', 'left',...
  'BackgroundColor', [.3 .3 .3],'ForegroundColor', [1 1 1],...
  'BusyAction','queue',...
  'TooltipString','Voxel or Mensurated Axis Coordinates',...
  'String',{'Voxels','mm','meters'},...
  'Callback','avw_view([],[],''coordinates'');');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Font.FontWeight = 'bold';

% View avw.hdr
handles.Bhdr = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.92 .05 .07 .03],...
  'String','HDR','BusyAction','queue',...
  'TooltipString','View the .hdr parameters.',...
  'BackgroundColor',[0.0 0.0 0.5],...
  'ForegroundColor',[1 1 1], 'HorizontalAlignment', 'center',...
  'Callback',strcat('AVWVIEW = get(gcbf,''Userdata''); ',...
  'avw_view_hdr(AVWVIEW.avw,AVWVIEW.gui);',...
  'clear AVWVIEW;'));

% OK: Return the avw!
handles.Bquit = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
  'Position',[.92 .01 .07 .03],...
  'String','RETURN','BusyAction','queue',...
  'BackgroundColor',[0.0 0.5 0.0],...
  'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
  'Callback','avw_view([],[],''quit'');');

% Update the gui_struct handles for this gui
if exist('parent','var'), AVWVIEW.parent.gui = parent; end
AVWVIEW.avw = avw;
AVWVIEW.handles = handles;
set(AVWVIEW.gui,'Userdata',AVWVIEW);
set(AVWVIEW.gui,'HandleVisibility','callback');

return


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function slice_img(avw),

figure
xslice = 128;
slice = squeeze( avw.img(xslice,:,:) );
imagesc(slice); axis image; colormap('gray')
figure
yslice = 128;
slice = squeeze( avw.img(:,yslice,:) );
imagesc(slice); axis image; colormap('gray')
figure
zslice = 128;
slice = squeeze( avw.img(:,:,zslice) );
imagesc(slice); axis image; colormap('gray')

return

⌨️ 快捷键说明

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