Remove imellipse after double click MATLAB - image

Just wondering how I can get rid of the imellipse after calling it in MATLAB. Currently I call it, double click it to plot the ellipse on my image, then I want to remove the ellipse tool.
I have a GUI, which I click a pushbutton to make an imellipse. After double clicking the imellipse, an outline is plotted onto my image and the dimensions saved to some matrix.
After double clicking it, resulting in a plot onto my image, I would like the ellipse ring (created from the function) to disappear. It just seems to stick around on the image (is this normal, or should it disappear?).
I can include my code, it just seems irrelevant to the problem (remove imellipse after double clicking).
I hope this is more clear!
Thanks!

imellipse creates a ROI on the figure, which can be removed if you delete the associated ROI object.
Let's suppose you have used imellipse like this -
Lesion = imellipse(handles.axes1);
Then, get all the information that you need from Lesion and then delete it. For example, if you need the mask information from it, store it somewhere.
LesionMask = Lesion.createMask();
Now, delete the ROI object which is Lesion.
delete(Lesion); %// Deletes the ROI related to imellipse
Read more about how to handle ROIs at Region-of-interest (ROI) base class Documentation

Related

keep new image when drawing lines by dragging the mouse in matlab

I am new in matlab GUI. I want to drawing lines by dragging the mouse. I found this issue but I want save new image with drawn lines. If i run this line, it will show me the same image.
imshow(im);
How can I get new image with drawn lines and for example show it?
You can also grab the image data directly in the Command Prompt. Once you draw all of your lines on your figure window, you can use getframe, which takes a snapshot of the current frame in focus. In this case, this should be your image with the drawn lines. When you call getframe, this will give you a structure with an element called cdata. This will give you an RGB array of what was seen in the figure (without the menu bars... just the figure data itself).
Example:
im = imread('cameraman.tif');
imshow(im);
h = getframe;
out = h.cdata;
figure;
imshow(out); %// Should give you the same image as the figure
You can use print to print the figure to some file. Not sure if you want to have exact reproduction of your line and image. In this case the best way probably would be to store the coordinates and properties of the line and use that to draw it on the image when you want to display it again later.

Geoserver ExternalGraphic draw icon incorrect

I run into a problem with Geoserver.
I'm drawing multiple icons which each represent a place all over my map using ExternalGraphic.
But geoserver didn't draw them correctly as they are. I attach an image as the result of geoserver drawing:
As you can see, the 2 car icon, both got cut off around 1 pixel comapre to its original size (1 got cut off from top down while another from bottom up). It make same icon look differentfrom place to place. And i think because of this cutting, after lose some pixel, they resize the image back to its original size, which make the $ on top left look blurry compare to the one next to it.
Also as in External graphic document mention, i didn't use any Size attribute so they won't get resize or anything. So i'm not sure why the image got cut off like that.
Any1 can help me about this case ? Thank you in advance.
I suggest you open a report at http://jira.codehaus.org/browse/GEOS attaching one of the images and your style document.

Table, rectangle placed on top of an image is not coming properly in preview mode in SSRS

I wanted to draw a rectangle with rounded corners in SSRS. But, after lot of research i got to know that currently there is no property for that. So, i am trying to use an image of a rectangle with rounded corners and on top of that trying to align the table and other controls within the image. But, when i am previewing it or exporting it to a PDF file, first the image is getting displayed, then below that all other controls comes. Am i doing anything wrong. Please let me know.
Why don't you try to enclose your image rectangle and other controls etc. within an SSRS Rectangle with BorderStyle = None...
Try following:
Create an image (the rectangle with rounded corners) in your favourite image drawing program. I did mine in Microsoft Paint
and save it as JPEG.
In SSRS report design, in Report Data pane, right click on Images >> Add Image and point to the image that you created in Step 1. (Untitled, in my case see the fig. below)
In SSRS report design, add a Rectangle from the Toolbox to the design surface and in the Properties Pane:
a) look for the BackgroundImage property Click its + sign. then
b) Enter values for Source as Embedded, BackgroundRepeat as Clip and the Value property , when you click the dropdown for its values, should show you the name of the image that you embedded in Step-2, select this name
Resize your rectangle to fit the shape and add your items to this rectangle.
EDIT:
Regarding the question in the Comment, I don't think that the size of the image rectangle can be increased dynamically. If that's the case then you may need to find some other work-around
HTH

Can MATLAB generate, save, and then load axes into a gui axes object dynamically?

Edited for clarity:
I have a GUI that controls a script that generates approximately 40 plots. I want to display any given plot in the GUI window on demand by selecting its number in a drop-down box. The problem is that the plots take a while to generate so I would rather make them once and then load them as needed into the axes object in the GUI. The plots each have different properties, labels, legends, etc..
I tried generating figures and then saving them and trying to load that into the axes object in the GUI and it did not work.
If I initially make the plots using the axes object in the GUI as the target axes I can't save the plot and the legends, etc..
Is this possible in MATLAB?
If I understand the question correctly, you have a GUI with axes and a callback to plot stuff into the axes. For some reason, e.g. because plotting takes a while, you want to be able to save a specific plot and have the ability to reload it.
The easiest way to deal with this issue is to not put an axes object into your GUI, but to use a two-window GUI, where one window has all the controls, and the other is the figure into which you plot stuff. This is advantageous for several reasons: Saving/loading becomes easy, you have access to the figure toolbar, and you can resize etc the figure as you wish (resizing GUIs is generally hairy). You can store the handle to the axes of the figure in the GUI handle structure via SETAPPDATA and access it via GETAPPDATA. Note that you'll want to put a small check at the beginning of your plotting callback, where you check whether the figure still exists using ISHANDLE on the axes handle, and open a new figure if the check returns false.
If you really want to have an axes object in your GUI, the easiest is to just save the x and y data, as well as other properties of the plot that a user may be able to customize (whether the legend is on, or off, or the legend's position property), so that you can regenerate it on the fly.
If, for some reason it is not sufficient to save just properties, you can generate a hidden figure, and use COPYOBJ to copy the axes and its children to that figure, which you then save. However, this is rather clumsy and might come with all kinds of surprising annoyances.
You need to know the handles of axes within the figure. Otherwise it will be difficult to change the axes properties if the figure contains a newer axes object, because gca will refer to the new axes.
The axes can be accessed post figure generation through the figure object because individual axes of a figure are children of the figure object. The following code snippet may help you.
close all
subplot(2,1,1)
subplot(2,1,2)
hAxes = get(gcf, 'Children')
get(hAxes(1)) %shows axes properties of one axes obj
get(hAxes(2)) %shows axes properties of the other
set(hAxes(1), 'YTickLabel', ['a';'b';'c';'d';'e';'f']) %set an axis property
I'm guessing a bit here, but it sounds like you want to create a GUI with an axes that displays different plots, legends, etc. based on which item of a drop-down menu is selected. If this is right, I'm guessing the problem you are having is that plotting a new set of data in the axes causes the old data to be replaced, leaving you to have to regenerate the entire plot anew every time you select a new menu item.
One way I would consider approaching this problem would be to make use of UIPANELs and the 'Visible' property of graphics objects. You could create one panel per menu item, add an axes to each along with whatever data you wish to plot, then simply toggle the visibility of the panels using the SET command instead of replotting everything when a new menu item is selected. Here's an example:
hFigure = figure; %# Create a figure
hPanelA = uipanel('Parent',hFigure); %# Add panel A to the figure
hAxesA = axes('Parent',hPanelA); %# Add an axes to panel A
plot(hAxesA,1:10,rand(1,10),'r'); %# Plot a red line
text(5,0.5,'hello','Parent',hAxesA); %# Plot some text
legend(hAxesA,'red line'); %# Add a legend
hPanelB = uipanel('Parent',hFigure); %# Add panel B to the figure
hAxesB = axes('Parent',hPanelB); %# Add an axes to panel B
plot(hAxesB,1:10,rand(1,10),'b'); %# Plot a blue line
text(5,0.5,'world','Parent',hAxesB); %# Plot some text
legend(hAxesB,'blue line'); %# Add a legend
Now, you can make panel A visible and panel B invisible by doing the following:
set([hPanelA hPanelB],{'Visible'},{'on'; 'off'});
And you can do the reverse (hide panel A and show panel B) by doing this:
set([hPanelA hPanelB],{'Visible'},{'off'; 'on'});
You should notice that toggling between the two panels with their two separate axes is quick and smooth, which likely wouldn't be the case if you had to erase and replot data in a single set of axes every time you wanted to look at a new plot. Creating all the graphics objects you need when the GUI is created, then modifying the visibility (or other properties) as needed with the SET command makes for a more efficient GUI.
Also note that you can still modify object properties even when they are invisible, so (continuing from my example above) I could do something like this:
set([hPanelA hPanelB],{'Visible'},{'on'; 'off'}); %# Hide panel B
set(hPanelB,'BackgroundColor','b'); %# Change the color of panel B
set([hPanelA hPanelB],{'Visible'},{'off'; 'on'}); %# Show panel B
And now you should see that the background color of panel B is blue. If you also saved handles to your plotted lines and text, you could update them with new values before making them visible again.

Getting an irregular-shaped object's pixel area in Photoshop

Is there a way to get an oddly-shaped object's pixel area in CS5? Eg. Circle/ellipse. Or, if there's some easy-to-automate way to do it outside of Photoshop.
I know it's possible to use a magic wand selection and see the height+width in the info panel, but that only works accurately for rectangles.
Thanks!!
Double click the layer thumbnail in the layers list
This will select the shape of pixels in the layer.

Resources