Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
13c26724
Commit
13c26724
authored
8 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
GtVolView: added simple/not-fully-functional zoom propagation mechanics
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
8b947460
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zUtil_GUI/GtEventLinkerVolView.m
+14
-3
14 additions, 3 deletions
zUtil_GUI/GtEventLinkerVolView.m
zUtil_TomoUtils/GtVolView.m
+15
-5
15 additions, 5 deletions
zUtil_TomoUtils/GtVolView.m
with
29 additions
and
8 deletions
zUtil_GUI/GtEventLinkerVolView.m
+
14
−
3
View file @
13c26724
...
...
@@ -4,6 +4,8 @@ classdef GtEventLinkerVolView < handle
perspective
;
horflip
;
verflip
;
zoom_state
;
end
properties
(
Access
=
private
)
...
...
@@ -12,26 +14,29 @@ classdef GtEventLinkerVolView < handle
end
methods
(
Access
=
public
)
function
self
=
GtEventLinkerVolView
(
volDims
,
slicendx
,
persp
,
hflip
,
vflip
,
volViewer
)
function
self
=
GtEventLinkerVolView
(
volDims
,
slicendx
,
persp
,
hflip
,
vflip
,
zoom_state
,
volViewer
)
self
.
dims
=
volDims
;
self
.
slice
=
slicendx
;
self
.
perspective
=
persp
;
self
.
horflip
=
hflip
;
self
.
verflip
=
vflip
;
self
.
zoom_state
=
zoom_state
;
addlistener
(
self
,
'slice'
,
'PostSet'
,
@
(
src
,
evt
)
self
.
propagateSlice
);
addlistener
(
self
,
'perspective'
,
'PostSet'
,
@
(
src
,
evt
)
self
.
propagatePerspective
);
addlistener
(
self
,
'horflip'
,
'PostSet'
,
@
(
src
,
evt
)
self
.
propagateHorFlip
);
addlistener
(
self
,
'verflip'
,
'PostSet'
,
@
(
src
,
evt
)
self
.
propagateVerFlip
);
addlistener
(
self
,
'zoom_state'
,
'PostSet'
,
@
(
src
,
evt
)
self
.
propagateZoom
);
self
.
attach
(
volViewer
,
volDims
)
end
function
notify
(
self
,
slicendx
,
persp
,
hflip
,
vflip
)
function
notify
(
self
,
slicendx
,
persp
,
hflip
,
vflip
,
zoom_state
)
self
.
slice
=
slicendx
;
self
.
perspective
=
persp
;
self
.
horflip
=
hflip
;
self
.
verflip
=
vflip
;
self
.
zoom_state
=
zoom_state
;
end
function
attach
(
self
,
volViewer
,
volDims
)
...
...
@@ -40,7 +45,7 @@ classdef GtEventLinkerVolView < handle
'Volume dimensions mismatch for linkname'
)
end
% Attach listener's callback
self
.
handles
=
[
self
.
handles
volViewer
];
self
.
handles
=
[
self
.
handles
,
volViewer
];
end
function
isNowEmpty
=
detach
(
self
,
volViewer
)
...
...
@@ -74,5 +79,11 @@ classdef GtEventLinkerVolView < handle
self
.
handles
(
ii
)
.
verFlip
(
self
.
verflip
);
end
end
function
propagateZoom
(
self
)
for
ii
=
1
:
length
(
self
.
handles
)
self
.
handles
(
ii
)
.
setZoom
(
self
.
zoom_state
);
end
end
end
end
This diff is collapsed.
Click to expand it.
zUtil_TomoUtils/GtVolView.m
+
15
−
5
View file @
13c26724
...
...
@@ -253,6 +253,11 @@ classdef GtVolView < GtBaseGuiElem
obj
.
updateDisplay
();
end
function
setZoom
(
obj
,
xy_lims
)
set
(
obj
.
conf
.
h_ax
,
'XLim'
,
xy_lims
{
1
})
set
(
obj
.
conf
.
h_ax
,
'YLim'
,
xy_lims
{
2
})
end
function
value
=
getVolValue
(
obj
,
point
)
% GTVOLVIEW/GETVOLVALUE Returns the value for the given point, from the
% volume stored in the object
...
...
@@ -534,7 +539,9 @@ classdef GtVolView < GtBaseGuiElem
appdata
.
(
obj
.
conf
.
linkname
)
=
...
GtEventLinkerVolView
(
obj
.
conf
.
dim
,
obj
.
conf
.
slicendx
,
...
obj
.
conf
.
plane
,
obj
.
conf
.
horflip
,
...
obj
.
conf
.
verflip
,
obj
);
obj
.
conf
.
verflip
,
...
get
(
obj
.
conf
.
h_ax
,
{
'XLim'
,
'YLim'
}),
...
obj
);
end
else
disp
(
'First instance of GtVolView linkname'
);
...
...
@@ -542,7 +549,9 @@ classdef GtVolView < GtBaseGuiElem
appdata
.
(
obj
.
conf
.
linkname
)
=
...
GtEventLinkerVolView
(
obj
.
conf
.
dim
,
obj
.
conf
.
slicendx
,
...
obj
.
conf
.
plane
,
obj
.
conf
.
horflip
,
...
obj
.
conf
.
verflip
,
obj
);
obj
.
conf
.
verflip
,
...
get
(
obj
.
conf
.
h_ax
,
{
'XLim'
,
'YLim'
}),
...
obj
);
end
setappdata
(
0
,
'GtVolView'
,
appdata
);
end
...
...
@@ -807,8 +816,8 @@ classdef GtVolView < GtBaseGuiElem
end
frame
=
'XYZ'
;
xlabel
(
obj
.
conf
.
h_ax
,
frame
(
obj
.
conf
.
horDim
));
ylabel
(
obj
.
conf
.
h_ax
,
frame
(
obj
.
conf
.
verDim
));
xlabel
(
obj
.
conf
.
h_ax
,
frame
(
obj
.
conf
.
horDim
));
ylabel
(
obj
.
conf
.
h_ax
,
frame
(
obj
.
conf
.
verDim
));
set
(
obj
.
conf
.
h_im
,
'xdata'
,
linspace
(
obj
.
conf
.
hordisplay
(
1
),
obj
.
conf
.
hordisplay
(
2
),
obj
.
conf
.
dim
(
obj
.
conf
.
horDim
)));
set
(
obj
.
conf
.
h_im
,
'ydata'
,
linspace
(
obj
.
conf
.
verdisplay
(
1
),
obj
.
conf
.
verdisplay
(
2
),
obj
.
conf
.
dim
(
obj
.
conf
.
verDim
)));
...
...
@@ -831,7 +840,8 @@ classdef GtVolView < GtBaseGuiElem
if
(
isfield
(
appdata
,
obj
.
conf
.
linkname
))
appdata
.
(
obj
.
conf
.
linkname
)
.
notify
(
...
obj
.
conf
.
slicendx
,
obj
.
conf
.
plane
,
...
obj
.
conf
.
horflip
,
obj
.
conf
.
verflip
);
obj
.
conf
.
horflip
,
obj
.
conf
.
verflip
,
...
{
xlim
,
ylim
});
else
gtError
(
'GtVolView:linkname_inconsistency'
,
...
'Linkname "%s" doesn
''
t exist!'
,
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment