title: Select a ROI (circle and square) in matlab in order to aply a filter
body: <p>I am working on matlab and I want to do an interactive selection like you do when you use the function roipoly, but I want to select or a circle or a square. I already search for funcion to select a region of interest (ROI) like you select when you use roipoly but using a circle or a square but I can't find anything.</p>
  
  <p>Any tips?</p>
  
  <p>I already tried using the ginput. </p>
  
  <pre><code>[X, Y]= ginput(2)
  
  xmin=min(X)
  xmax=max(X)
  ymin=min(Y)
  ymax=max(Y)
  </code></pre>
  
  <p>In this code I define the corner of the square (the user defines the two points with the ginput). But when I check the points of the image, they are wrong. I think is because of the size of the figure that is not the same on the plot.</p>
  
  <p>The best way to select the ROI that I want is to using a function similar with the roipoly, but for a circle and for a square, instead of a polygon. And with this type of function I have only can select points inside of the picture with the "ginput" I have to type a error message if the user select any point outside of the figure (the problem is that they don't match, the point that I can select is greater then the size of the image).</p>