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

📄 cviewer.m

📁 Edge detection in microscopy images using curvelets
💻 M
📖 第 1 页 / 共 4 页
字号:
function edit_curthrsh_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_curthrsh (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endfunction edit_l2error_Callback(hObject, eventdata, handles)% hObject    handle to edit_l2error (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,'String') returns contents of edit_l2error as text%        str2double(get(hObject,'String')) returns contents of edit_l2error as a double% --- Executes during object creation, after setting all properties.function edit_l2error_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_l2error (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');endfunction edit_PSNR_Callback(hObject, eventdata, handles)% hObject    handle to edit_PSNR (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,'String') returns contents of edit_PSNR as text%        str2double(get(hObject,'String')) returns contents of edit_PSNR as a double% --- Executes during object creation, after setting all properties.function edit_PSNR_CreateFcn(hObject, eventdata, handles)% hObject    handle to edit_PSNR (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');end% --- Executes on button press in checkbox_smooth.function checkbox_smooth_Callback(hObject, eventdata, handles)% hObject    handle to checkbox_smooth (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)if get(handles.menu_imageselect, 'Value') > 2,    % predefined image, rerun selection with new smoothing option    menu_imageselect_Callback(handles.menu_imageselect, [], handles);end    % executes on button click in top axesfunction axis_clickcallback(hObject, eventdata, handles)if strcmp(get(handles.showdirdata_tool, 'State'), 'on') && strcmp(get(get(hObject, 'Parent'),'Tag'), 'axes_top'),    clickdata = get(handles.axes_top, 'CurrentPoint');    pt = clickdata(1,[2 1]);  % swap x and y because y is first index in matrix    % plot clicked position    if ~isempty(handles.curdirdata) && ishandle(handles.curdirdata.dothandle)        delete(handles.curdirdata.dothandle);    end    hold(handles.axes_top, 'on')    hdot = plot(handles.axes_top, pt(2), pt(1), 'r*');    set(hdot, 'ButtonDownFcn', 'cviewer(''axis_clickcallback'',gcbo,[],guidata(gcbo))');        % get and save directional data    levels = getlistboxvals(handles.listbox_levels);    levels = levels(levels > 1 & levels < length(get(handles.listbox_levels,'String')));    [dirs, vals] = crvlt_getdirdata(handles.C, pt, levels);    handles.curdirdata = struct('levels',levels,'dirs',{dirs},'values',{vals},'dothandle',hdot,'dotcoords',pt([2 1]));        % plot the directional data in bottom axes    makedirplot(handles.axes_bottom, handles)    guidata(handles.axes_top, handles);end% --------------------------------------------------------------------function linkaxestool_ClickedCallback(hObject, eventdata, handles)% hObject    handle to linkaxestool (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Don't allow linked axes when showing directionsif strcmp(get(handles.showdirdata_tool, 'State'), 'on')    set(hObject, 'State', 'off')end% turn on or off linked axesif strcmp(get(hObject, 'State'),'on')    linkaxes([handles.axes_top handles.axes_bottom])else    linkaxes([handles.axes_top handles.axes_bottom], 'off')end% --------------------------------------------------------------------function showdirdata_tool_ClickedCallback(hObject, eventdata, handles)% hObject    handle to showdirdata_tool (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)if strcmp(get(hObject, 'State'), 'on'),    % turn off zoom and pan functions, and axis link    linkaxes([handles.axes_top handles.axes_bottom], 'off')    set(handles.linkaxestool, 'State', 'off')    zoom(handles.axes_top, 'off')    zoom(handles.axes_bottom, 'off')    pan(handles.axes_top, 'off')    pan(handles.axes_bottom, 'off')    set(handles.anisomeas_tool, 'State', 'off')        % make the bottom plot a directional plot    set(handles.displaymenu_bottom, 'Enable', 'off')    set(handles.plottype_menu_bottom, 'Value', 3)  % plot absolute values as default    %set(handles.polarplot_checkbox, 'Visible', 'on')  % show polar/rectangular checkbox    set(handles.dirdata_panel, 'Visible', 'on')  % show dirdata plot toolselse    % make the bottom plot a normal plot    set(handles.displaymenu_bottom, 'Enable', 'on')        %set(handles.polarplot_checkbox, 'Visible', 'off')  % hide polar/rectangular checkbox        set(handles.dirdata_panel, 'Visible', 'off')  % hide dirdata plot toolsend% --- Executes on button press in polarplot_checkbox.function polarplot_checkbox_Callback(hObject, eventdata, handles)% hObject    handle to polarplot_checkbox (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)makedirplot(handles.axes_bottom, handles)% --- Executes on button press in showseparate_button_top.function showseparate_button_top_Callback(hObject, eventdata, handles)% hObject    handle to showseparate_button_top (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% draw the top image in a new figurehf = figure;showinaxis(gca, get(handles.displaymenu_top,'Value'), get(handles.menu_plot_curveletpos_top,'Value'), ...    get(handles.plottype_menu_top,'Value'), 0, handles);axis(axis(handles.axes_top));% --- Executes on button press in showseparate_button_bottom.function showseparate_button_bottom_Callback(hObject, eventdata, handles)% hObject    handle to showseparate_button_bottom (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% draw the bottom image in a new figurehf = figure;if strcmp(get(handles.showdirdata_tool, 'State'), 'off'),    showinaxis(gca, get(handles.displaymenu_bottom,'Value'), 1, ...        get(handles.plottype_menu_bottom,'Value'), 0, handles);else    makedirplot(gca, handles)endaxis(axis(handles.axes_bottom));% --- Executes on button press in exportdata_button.function exportdata_button_Callback(hObject, eventdata, handles)% hObject    handle to exportdata_button (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)cviewdata = struct('im',[],'fim',[],'rim',[],'frim',[],'errim',[],'ferrim',[],'C',[],'Cmod',[],'dirdata',[]);cviewdata.im = handles.im;cviewdata.fim = handles.fim;cviewdata.rim = handles.rim;cviewdata.frim = handles.frim;cviewdata.errim = handles.errim;cviewdata.ferrim = handles.ferrim;cviewdata.C = handles.C;cviewdata.Cmod = handles.Cmod;cviewdata.dirdata = handles.curdirdata;assignin('base', 'cviewdata', cviewdata)msgbox('Data has been exported to the variable ''cviewdata'' in base workspace.','Export data')% --- Executes on button press in diraverage_checkbox.function diraverage_checkbox_Callback(hObject, eventdata, handles)% hObject    handle to diraverage_checkbox (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)makedirplot(handles.axes_bottom, handles)function diraverage_edit_Callback(hObject, eventdata, handles)% hObject    handle to diraverage_edit (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,'String') returns contents of diraverage_edit as text%        str2double(get(hObject,'String')) returns contents of diraverage_edit as a double% --- Executes during object creation, after setting all properties.function diraverage_edit_CreateFcn(hObject, eventdata, handles)% hObject    handle to diraverage_edit (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');end% --------------------------------------------------------------------function menu_tools_Callback(hObject, eventdata, handles)% hObject    handle to menu_tools (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function menuitem_makemovie_Callback(hObject, eventdata, handles)% hObject    handle to menuitem_makemovie (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)cmoviemaker;% --- Executes on button press in checkbox_sumlevels.function checkbox_sumlevels_Callback(hObject, eventdata, handles)% hObject    handle to checkbox_sumlevels (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)makedirplot(handles.axes_bottom, handles)% --- Executes on selection change in popup_colormap.function popup_colormap_Callback(hObject, eventdata, handles)% hObject    handle to popup_colormap (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)displaydata(handles);% --- Executes during object creation, after setting all properties.function popup_colormap_CreateFcn(hObject, eventdata, handles)% hObject    handle to popup_colormap (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.%       See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))    set(hObject,'BackgroundColor','white');end% --- Executes on button press in checkbox_invertcolormap.function checkbox_invertcolormap_Callback(hObject, eventdata, handles)% hObject    handle to checkbox_invertcolormap (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)displaydata(handles);% --------------------------------------------------------------------function anisomeas_tool_ClickedCallback(hObject, eventdata, handles)% hObject    handle to anisomeas_tool (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)if strcmp(get(hObject, 'State'), 'on'),    % turn off zoom and pan functions, and axis link    linkaxes([handles.axes_top handles.axes_bottom], 'off')    set(handles.linkaxestool, 'State', 'off')    zoom(handles.axes_top, 'off')    zoom(handles.axes_bottom, 'off')    pan(handles.axes_top, 'off')    pan(handles.axes_bottom, 'off')    set(handles.showdirdata_tool, 'State', 'off')        % make the bottom plot a directional plot    set(handles.displaymenu_bottom, 'Enable', 'off')    set(handles.plottype_menu_bottom, 'Enable', 'off')  % disable plot type        handles.stickyaxes = 0;    displaydata(handles);else    % make the bottom plot a normal plot    set(handles.displaymenu_bottom, 'Enable', 'on')        set(handles.plottype_menu_bottom, 'Enable', 'on')  % enable plot typeendfunction menu_batch_Callback(hObject, eventdata, handles)thresh = str2double(get(handles.edit_thrsh,'String'));if isnan(thresh) || (thresh < 0),    errordlg('Bad threshold value','Curvelet viewer error!');    returnendthtype = get(handles.menu_thrshtype,'Value');levels = getlistboxvals(handles.listbox_levels);dirs = getlistboxvals(handles.listbox_dirs);totdirs = length(get(handles.listbox_dirs,'String'));batchwindow(thresh, thtype, levels, dirs, totdirs);

⌨️ 快捷键说明

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