I need to write a GUI that shows an image and allows to draw on it by selecting different colors

1 view (last 30 days)
I was looking at the 45 sample GUIs
I need something similar to that shown in GUI 39.
The only difference is that the drawing must be done not on a white image but on a specific image.
Then I would need another gui that works with to images, with the same size (which are image A and ASeg, which is the result of segmenting image A)
The GUI should show imag ASeg, and allow the user must to zoom on it. By zooming the user sees just a portion ASeg_Sub of image ASeg. Now, if the user clicks on the image, the GUI should switch the view and show the image A, and precisely the same portion A_Sub.
I hope I have been clear. Could you help me please?

Answers (4)

Image Analyst
Image Analyst on 23 May 2019
Attached is a masking demo and a drawing demo that may give you a start.

Elena Casiraghi
Elena Casiraghi on 23 May 2019
Thanks, I'll try to proceed based on that. But I can't change the color of the drawing right?
Can I let the user draw more than one line?

Elena Casiraghi
Elena Casiraghi on 25 May 2019
I found that indeed imfreehand let's me chose the color, however, if I zoom in it goes off :\

Elena Casiraghi
Elena Casiraghi on 26 May 2019
Here you get the code.
The code starts with CorrectMarkersLater, which calls correctMarkersNow, which calls pointsInPoly.
The aim is to show all RGB images in a directory: (correctMarkersLater). For each image, there is an RGB which shows the result of segmentation with red color/yellow color/green color. CorrectmarkersNow shows the image with segmentation results and asks the user to select areas containing wrong segmentations. Where the user selects the areas, for each areas: the areas is shown and the user is asked to select areas that must be removed or to draw the border of missing areas (pointsInPoly). The drawing is made in pointInPoly.m, and here is the problem.
I would like to code pointsInpoly by substituting the getline(...,'closed') with something that:
1) let's the user zoom on the image,
2) if the user simply clicks (intead of drawing a closed line) on the zoomed images, I would like to swith the view on the same zoomed portion of the original image (without segmentation)
3) eventually draw a line after zooming and clicking to view the original image,
4) eventually zoom out,...
With getline I can recognized if the user does a double click or draws a closed curve, HOWEVER:
  • when calling getline the zoom option on the figure goes off
  • Even if the zoom was on... I don't know how to retrieve the portion of the image showed after zooming ... therefore I don't know which portion of Original image to show
I hope I have been clear

Community Treasure Hunt

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

Start Hunting!