You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ReshapeImage.m
    path of file: ./repos/ImageM/ImageM/+imagem/+actions/+image
    
    the code of the file until where you have to start completion: classdef ReshapeImage < imagem.actions.CurrentImageAction
% Reshape current image.
%
%   Class ReshapeImageAction
%
%   Example
%   ReshapeImageAction
%
%   See also
%

% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2012-05-18,    using Matlab 7.9.0.529 (R2009b
    
function run(obj, frame) %#ok<INUSL,INUSD>
         
        % get current image
        doc = currentDoc(frame);
        img = doc.Image;
        
        dims = size(img, 1:5);
        ZCT = prod(dims(3:5));
        newDims = dims;
        
        while true
            % create dialog
            gd = imagem.gui.GenericDialog('Reshape Image');
            addNumericField(gd, 'Size X:',  newDims(1), 0);
            addNumericField(gd, 'Size Y:',  newDims(2), 0);
            addNumericField(gd, 'Size Z:',  newDims(3), 0);
            addNumericField(gd, 'Channels (C):', newDims(4), 0);
            addNumericField(gd, 'Frames (T):',  newDims(5), 0);
            addMessage(gd, sprintf('ZxCxT must equal %d', ZCT));

            showDialog(gd);
            if wasCanceled(gd)
                return;
            end