title: Matlab Update Image Handles
body: <p>I'm creating an Image Editing Program using Matlab. The user uploads the image in one pushbutton callback function. The user can then use other pushbutton callbacks to edit the image (rotate, change into black and white etc).</p>
  
  <p>Whilst I can access the image, and successfully edit it individually, it always reverts back to its original uploaded state. For example - if I were to rotate it first, then change to black and white the rotation would disappear and vice versa.</p>
  
  <p>I am using: </p>
  
  <pre><code>handles=guidata(hObject); 
  </code></pre>
  
  <p>at the beginning of every function. And</p>
  
  <pre><code>guidata(hObject, handles);
  </code></pre>
  
  <p>at the end of every function, but the functions always access the originally uploaded image.</p>
  
  <p>How can I successfully update the image handle after every edit???</p>
  
  <p>Here is an example of a callback function:</p>
  
  <pre><code>function pushbutton3_Callback(hObject, eventdata, handles)
  handles=guidata(hObject);
  I = rgb2gray(handles.im)
  himage = imshow(I, 'Parent', handles.axes1);
  guidata(hObject, handles);
  </code></pre>