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
c4fa8a1e
Commit
c4fa8a1e
authored
11 years ago
by
Yoann Guilhem
Browse files
Options
Downloads
Patches
Plain Diff
New feature in GtVolView: save figure command in context menu.
Signed-off-by:
Yoann Guilhem
<
yoann.guilhem@esrf.fr
>
parent
887e41fe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zUtil_TomoUtils/GtVolView.m
+27
-0
27 additions, 0 deletions
zUtil_TomoUtils/GtVolView.m
with
27 additions
and
0 deletions
zUtil_TomoUtils/GtVolView.m
+
27
−
0
View file @
c4fa8a1e
...
@@ -667,11 +667,16 @@ classdef GtVolView < GtBaseGuiElem
...
@@ -667,11 +667,16 @@ classdef GtVolView < GtBaseGuiElem
set
(
obj
.
conf
.
h_im
,
'UIContextMenu'
,
obj
.
conf
.
h_context_menu
);
set
(
obj
.
conf
.
h_im
,
'UIContextMenu'
,
obj
.
conf
.
h_context_menu
);
set
(
obj
.
conf
.
h_overlay
,
'UIContextMenu'
,
obj
.
conf
.
h_context_menu
);
set
(
obj
.
conf
.
h_overlay
,
'UIContextMenu'
,
obj
.
conf
.
h_context_menu
);
% Copy pixel info in context menu
cbk
=
@
(
src
,
evt
)
copy3DPixInfoToClipboard
(
obj
);
cbk
=
@
(
src
,
evt
)
copy3DPixInfoToClipboard
(
obj
);
obj
.
conf
.
h_menu_items
=
{};
obj
.
conf
.
h_menu_items
=
{};
obj
.
conf
.
h_menu_items
{
end
+
1
}
=
uimenu
(
obj
.
conf
.
h_context_menu
,
...
obj
.
conf
.
h_menu_items
{
end
+
1
}
=
uimenu
(
obj
.
conf
.
h_context_menu
,
...
'Label'
,
'Copy pixel 3D info'
,
...
'Label'
,
'Copy pixel 3D info'
,
...
'Callback'
,
cbk
);
'Callback'
,
cbk
);
% Save figure in context menu
obj
.
conf
.
h_menu_items
{
end
+
1
}
=
uimenu
(
obj
.
conf
.
h_context_menu
,
...
'Label'
,
'Save figure'
,
...
'Callback'
,
@
(
src
,
evt
)
saveFigure
(
obj
));
end
end
function
point
=
get3DPixelInfo
(
obj
)
function
point
=
get3DPixelInfo
(
obj
)
...
@@ -917,6 +922,28 @@ classdef GtVolView < GtBaseGuiElem
...
@@ -917,6 +922,28 @@ classdef GtVolView < GtBaseGuiElem
end
end
drawnow
;
drawnow
;
end
end
function
saveFigure
(
obj
,
fname
,
ftype
)
% GTVOLVIEW/SAVEFIGURE Save the content of axis to a file
cancel
=
false
;
if
(
~
exist
(
'fname'
,
'var'
)
||
isempty
(
fname
)
||
...
~
exist
(
'ftype'
,
'var'
)
||
isempty
(
ftype
))
[
fname
,
ftype
,
cancel
]
=
imputfile
();
else
if
(
exist
(
fname
,
'file'
))
answer
=
inputwdefault
([
'
''
'
fname
'
''
already exists.\n Do you want to replace it?'
],
'n'
);
if
(
~
strcmp
(
answer
,
'y'
))
cancel
=
true
;
end
end
end
if
(
cancel
)
disp
(
'User canceled image saving, so nothing has been written.'
);
else
im
=
frame2im
(
getframe
(
obj
.
conf
.
h_ax
));
imwrite
(
im
,
fname
,
ftype
);
end
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
...
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