Display precomputed slice object on axes object

1 view (last 30 days)
Hi there
I am doing some image processing. To visualize my data (on a gui), I use the slice function. Due to the amount of data, I want to precompute the slice plot before displaying it on an axes object. My idea is, to store the precomputed slice plot handle into an variable and display it later on the axes object (which is meanwhile used for other visualization).
The slice object is generated by:
handles.model = slice(x, y, z, imSeq, loc(1), loc(2), loc(3));
hold on;
colormap(gray);
set(handles.model, 'EdgeColor', 'none');
daspect(ratio);
%...
hold off;
In another part of the gui I want display the precomputed slice object:
% is there something like this? =)
set(handles.axesSlice, 'Data', handles.model)
Of course it is possible to add a second axes onto the gui and change the visibility of it, but it would be nice if I can manage it like I am asking for ;-)
Thank you for your reply, Fabian
  2 Comments
SSITS Rayachoti
SSITS Rayachoti on 12 Jun 2012
Thanks for your inf sir
Let me to know how to extract an image from my files into Mat lab to process it

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 12 Jun 2012
See copyobj()
Note: your slice() routine is going to produce a visible graph unless you specifically make it invisible after your "hold off". And it is going to produce it on whatever the current graphics axis is...

Fabian
Fabian on 12 Jun 2012
Hi, thanks for your reply.
I played a litte with copyobj. Now my idea was:
unused = axes();
handles.model = slice(x, y, z, imSeq, loc(1), loc(2), loc(3));
% set properties...
delete(unused);
I realized, that this does not work because if I delete the axes the handles.model is not longer a handle (ishandle returns 0). So I can not use it with copyobj (get error "Invalid handle").
This means that I have to store the unused axes too (= second axes object)? I searched for setting axes objects invisible or off, but there seems to be no such property?
Fabian
  1 Comment
Walter Roberson
Walter Roberson on 12 Jun 2012
set( allchild(unused), 'Visible', 'off')
Or even easier, plop everything into a new figure, and then just set the figure visibility off.
When the Answers search engine is working better, please search on tag:always-parent and read the advise in my answer (and comments) there.

Sign in to comment.

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!