Skip to content
Snippets Groups Projects
Commit 586cf897 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Rounded some corners in GtVolView to prepare linkname fix.


Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@887 4c865b51-4357-4376-afb4-474e03ccb993
parent c0cab7ad
No related branches found
No related tags found
No related merge requests found
......@@ -438,9 +438,6 @@ classdef GtVolView < GtBaseGuiElem
% Reset back the zoom to the previous state (before the inclusion)
set(zoomOp, 'Enable', zoomState);
% Mouse scroll action to move slider
set(obj.conf.h_figure, 'WindowScrollWheelFcn', @(src, evt)scrollVolume(obj, evt));
% write the app variable to a shared location (appending if necessary)
if ~isempty(obj.conf.linkname)
if (isappdata(0, obj.conf.linkname))
......@@ -498,9 +495,15 @@ classdef GtVolView < GtBaseGuiElem
%%% saved yet, matlab is going to throw errors in the callbacks.
%%% Thankfully these callbacks just need the objects but not the
%%% other callbacks
slider_cbk = @(src, evt)changeSlice(obj, round(get(obj.conf.h_slider, 'Value')));
obj.addUICallback(obj.conf.h_slider, ...
'AdjustmentValueChangedCallback', ...
@(src, evt)updateDisplay(obj), true);
slider_cbk, true);
% Mouse scroll action to move slider
obj.addUICallback(obj.conf.h_figure, 'WindowScrollWheelFcn', ...
@(src, evt)scrollVolume(obj, evt), false);
obj.addUICallback(obj.conf.h_min, ...
'AdjustmentValueChangedCallback', ...
@(src, evt)updateBC(obj), true);
......@@ -580,17 +583,19 @@ classdef GtVolView < GtBaseGuiElem
obj.conf.h_context_menu = uicontextmenu('Parent', obj.conf.h_figure);
set(obj.conf.h_im, 'UIContextMenu', obj.conf.h_context_menu);
set(obj.conf.h_overlay, 'UIContextMenu', obj.conf.h_context_menu);
cbk = @(src, evt)copy3DPixInfoToClipboard(obj, get3DPixelInfo(obj));
obj.conf.h_menu_items = {};
obj.conf.h_menu_items{end+1} = uimenu(obj.conf.h_context_menu, ...
'Label', 'Copy pixel 3D info', ...
'Callback', @(src,evt)copy3DPixInfoToClipboard(obj, get3DPixelInfo(obj)));
'Callback', cbk);
end
function point = get3DPixelInfo(obj)
point2D = get(obj.conf.h_ax, 'CurrentPoint');
point = zeros(1,3);
point(obj.conf.horDim) = point2D(1,1);
point(obj.conf.verDim) = point2D(1,2);
point = zeros(1, 3);
point(obj.conf.horDim) = point2D(1, 1);
point(obj.conf.verDim) = point2D(1, 2);
point(obj.conf.ortDim) = obj.conf.slicendx;
end
......@@ -635,7 +640,7 @@ classdef GtVolView < GtBaseGuiElem
slice = squeeze(vol(:, obj.conf.slicendx,:));
end
% Cope with matlab showing issue
if obj.conf.verDim > obj.conf.horDim
if (obj.conf.verDim > obj.conf.horDim)
slice = permute(slice, [2, 1]);
end
end
......@@ -646,7 +651,7 @@ classdef GtVolView < GtBaseGuiElem
slice = obj.loadSlice(vol);
if is_overlay && ~isa(vol,'integer')
if (is_overlay && ~isa(vol,'integer'))
sliceMin = min(slice(:));
sliceMax = max(slice(:));
sliceRange = sliceMax - sliceMin;
......@@ -660,7 +665,6 @@ classdef GtVolView < GtBaseGuiElem
% GTVOLVIEW/DOUPDATEDISPLAY Function that actually updates all the
% visualized GUI components of the GUI element
obj.conf.slicendx = round(get(obj.conf.h_slider, 'Value'));
set(obj.conf.h_slider, 'Value', obj.conf.slicendx);
if (obj.conf.firsttime)
......@@ -729,12 +733,11 @@ classdef GtVolView < GtBaseGuiElem
function scrollVolume(obj, evt)
% GTVOLVIEW/SCROLLVOLUME Function that moves the slider when using
% mouse scroll
if evt.VerticalScrollCount ~= 0
if (evt.VerticalScrollCount ~= 0)
newSlicendx = round(get(obj.conf.h_slider, 'Value')) + evt.VerticalScrollCount;
newSlicendx = max(newSlicendx, get(obj.conf.h_slider, 'Min'));
newSlicendx = min(newSlicendx, get(obj.conf.h_slider, 'Max'));
set(obj.conf.h_slider, 'Value', newSlicendx);
obj.updateDisplay();
obj.changeSlice(newSlicendx);
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment