function varargout = Visualization_4d(varargin)
% VISUALIZATION_4D M-file for Visualization_4d.fig
% VISUALIZATION_4D, by itself, creates a new VISUALIZATION_4D or raises the existing
% singleton*.
%
% H = VISUALIZATION_4D returns the handle to a new VISUALIZATION_4D or the handle to
% the existing singleton*.
%
% VISUALIZATION_4D('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in VISUALIZATION_4D.M with the given input arguments.
%
% VISUALIZATION_4D('Property','Value',...) creates a new VISUALIZATION_4D or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Visualization_4d_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Visualization_4d_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help Visualization_4d
% Last Modified by GUIDE v2.5 07-Feb-2007 22:44:47
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Visualization_4d_OpeningFcn, ...
'gui_OutputFcn', @Visualization_4d_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Visualization_4d is made visible.
function Visualization_4d_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Visualization_4d (see VARARGIN)
% Choose default command line output for Visualization_4d
handles.output = hObject;
handles.folder=[pwd '\Visual_Data\'];
d = dir([handles.folder '*.mat']);
handles.datalist=char(d.name);
if isempty(handles.datalist)==1
set(handles.select_data,'String','Visual_Data - Folder is Empty')
else
set(handles.select_data,'String',handles.datalist)
end
handles.cbar=0;
guidata(hObject, handles);
% UIWAIT makes Visualization_4d wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Visualization_4d_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in rotate.
function rotate_Callback(hObject, eventdata, handles)
% hObject handle to rotate (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of rotate
handles=guidata(gcbo);
if get(hObject,'Value')==get(hObject,'Max')
rotate3d on
else
rotate3d off
end
guidata(gcbo,handles)
% --- Executes on button press in boundary_slices.
function boundary_slices_Callback(hObject, eventdata, handles)
% hObject handle to boundary_slices (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of boundary_slices
handles=guidata(gcbo);
if get(hObject,'Value')==get(hObject,'Max')
set(handles.boundary,'Visible','on')
else
set(handles.boundary,'Visible','off')
end
guidata(gcbo,handles)
% --- Executes on button press in grid_on_slice.
function grid_on_slice_Callback(hObject, eventdata, handles)
% hObject handle to grid_on_slice (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of grid_on_slice
handles=guidata(gcbo);
if get(hObject,'Value')==get(hObject,'Max')
set(handles.boundary,'EdgeColor','k')
set(handles.sliceplane_x,'EdgeColor','k')
set(handles.sliceplane_y,'EdgeColor','k')
set(handles.sliceplane_z,'EdgeColor','k')
else
set(handles.boundary,'EdgeColor','none')
set(handles.sliceplane_x,'EdgeColor','none')
set(handles.sliceplane_y,'EdgeColor','none')
set(handles.sliceplane_z,'EdgeColor','none')
end
guidata(gcbo,handles)
% --- Executes on button press in grid_on.
function grid_on_Callback(hObject, eventdata, handles)
% hObject handle to grid_on (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of grid_on
handles=guidata(gcbo);
if get(hObject,'Value')==get(hObject,'Max')
grid on
else
grid off
end
guidata(gcbo,handles)
% --- Executes on slider movement.
function x_slider_Callback(hObject, eventdata, handles)
% hObject handle to x_slider (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
handles=guidata(gcbo);
i=get(hObject,'Value');
axes(handles.axes1)
delete(handles.sliceplane_x)
handles.sliceplane_x=slice(handles.X,handles.Y,handles.Z,handles.V,i,[],[]);
if get(handles.grid_on_slice,'Value')==0
delete(handles.sliceplane_x_boundary)
handles.sliceplane_x_boundary=plot3([i i i i i],[handles.ymin handles.ymax handles.ymax handles.ymin handles.ymin],...
[handles.zmin handles.zmin handles.zmax handles.zmax handles.zmin],'k');
end
set(handles.sliceplane_x,'FaceColor','interp')
% set(handles.sliceplane_x,'Visible','off')
% set(handles.sliceplane_x(i),'Visible','on')
if get(handles.grid_on_slice,'Value')==get(handles.grid_on_slice,'Min')
set(handles.sliceplane_x,'EdgeColor','none')
end
set(handles.sliceplane_x,'Visible','on')
set(handles.x_slice,'Value',1,'Enable','on')
guidata(gcbo,handles)
% --- Executes on slider movement.
function y_slider_Callback(hObject, eventdata, handles)
% hObject handle to y_slider (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
handles=guidata(gcbo);
i=get(hObject,'Value');
axes(handles.axes1)
delete(handles.sliceplane_y)
handles.sliceplane_y=slice(handles.X,handles.Y,handles.Z,handles.V,[],i,[]);
if get(handles.grid_on_slice,'Value')==0
delete(handles.sliceplane_y_boundary)
handles.sliceplane_y_boundary=plot3([handles.xmin handles.xmax handles.xmax handles.xmin handles.xmin ],[i i i i i],...
[handles.zmin handles.zmin handles.zmax handles.zmax handles.zmin],'k');
end
set(ha
- 1
- 2
- 3
- 4
- 5
- 6
前往页