function CreateCenteredMIPanel(handles)
%
% Copyright 2010, Joseph O. Deasy, on behalf of the CERR development team.
% 
% This file is part of The Computational Environment for Radiotherapy Research (CERR).
% 
% CERR development has been led by:  Aditya Apte, Divya Khullar, James Alaly, and Joseph O. Deasy.
% 
% CERR has been financially supported by the US National Institutes of Health under multiple grants.
% 
% CERR is distributed under the terms of the Lesser GNU Public License. 
% 
%     This version of CERR is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     (at your option) any later version.
% 
% CERR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
% without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% See the GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with CERR.  If not, see <http://www.gnu.org/licenses/>.


    %CenteredMI Panel
    handles.centeredMI = uipanel('Parent',handles.toolPanel,'Units','normalize','FontSize',10,'Title','MI Optimizer Setup',...
                                    'Tag','centeredMIPanel','Clipping','off',...
                                    'Position',[0 0 1 1],...
                                    'Visible','on');
    dx = 0; dy = -90;                                
    h337 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[8+dx 370-5+dy 133 29],...
    'String','Histogram Bins:',...
    'Style','text',...
    'Tag','text68');
    
    handles.centeredMI_histbins = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 368+dy 116 30],...
    'String','32',...
    'Style','edit',...
    'Tag','centeredMI_histbins');

    h339 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[6+dx 332-8+dy 135 32],...
    'String','Initial Radius:',...
    'Style','text',...
    'Tag','text69');

    handles.centeredMI_initradius = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 329+dy 116 30],...
    'String','0.05',...
    'Style','edit',...
    'Tag','centeredMI_initradius');

    h341 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[6+dx 295-5+dy 135 30],...
    'String','Epsilon:',...
    'Style','text',...
    'Tag','text70');

    handles.centeredMI_epsilon = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 291+dy 116 30],...
    'String','0.001',...
    'Style','edit',...
    'Tag','centeredMI_epsilon');

    h343 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[6+dx 260-5+dy 135 28],...
    'String','Max Iteration Number:',...
    'Style','text',...
    'Tag','text71');

    handles.centeredMI_iternum = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 256+dy 116 30],...
    'String','1500',...
    'Style','edit',...
    'Tag','centeredMI_iternum');

%     h345 = uicontrol(...
%     'Parent',handles.centeredMI,...
%     'FontSize',10,...
%     'HorizontalAlignment','right',...
%     'Position',[8+dx 219+dy 133 30],...
%     'String','Initial Angle:',...
%     'Style','text',...
%     'Tag','text72');
% 
%     h346 = uicontrol(...
%     'Parent',handles.centeredMI,...
%     'FontSize',10,...
%     'HorizontalAlignment','right',...
%     'Position',[7+dx 188+dy 134 27],...
%     'String','Initial TranslationX:',...
%     'Style','text',...
%     'Tag','text73');
% 
%     handles.centeredMI_initangle = uicontrol(...
%     'Parent',handles.centeredMI,...
%     'FontSize',10,...
%     'HorizontalAlignment','left',...
%     'Position',[148+dx 223+dy 79 25],...
%     'String','0',...
%     'Style','edit',...
%     'Tag','centeredMI_initangle');
% 
%     handles.centeredMI_initTx = uicontrol(...
%     'Parent',handles.centeredMI,...
%     'FontSize',10,...
%     'HorizontalAlignment','left',...
%     'Position',[148+dx 189+dy 79 26],...
%     'String','0',...
%     'Style','edit',...
%     'Tag','centeredMI_initTx');
% 
%     h349 = uicontrol(...
%     'Parent',handles.centeredMI,...
%     'FontSize',10,...
%     'HorizontalAlignment','right',...
%     'Position',[6+dx 156+dy 135 26],...
%     'String','Initial TranslationY:',...
%     'Style','text',...
%     'Tag','text74');
% 
%     handles.centeredMI_initTy = uicontrol(...
%     'Parent',handles.centeredMI,...
%     'FontSize',10,...
%     'HorizontalAlignment','left',...
%     'Position',[148+dx 157+dy 79 25],...
%     'String','0',...
%     'Style','edit',...
%     'Tag','centeredMI_initTy');

    h351 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[6+dx 153-3+dy 135 28],...
    'String','Rotation Scale:',...
    'Style','text',...
    'Tag','text75');

    handles.centeredMI_rs = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 153+dy 116 30],...
    'String','0.6',...
    'Style','edit',...
    'Tag','centeredMI_rs');

    h353 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[8+dx 180+dy 133 30],...
    'String','Center Scale X:',...
    'Style','text',...
    'Tag','text76');

    h354 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[7+dx 213+dy 134 27],...
    'String','Center Scale Y:',...
    'Style','text',...
    'Tag','text77');

    handles.centeredMI_rcsx = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 189+dy 79 25],...
    'String','0',...
    'Style','edit',...
    'Tag','centeredMI_rcsx');

    handles.centeredMI_rcsy = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 219+dy 79 26],...
    'String','0',...
    'Style','edit',...
    'Tag','centeredMI_rcsy');

    h357 = uicontrol(...
    'Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','right',...
    'Position',[6+dx 121+dy 135 26],...
    'String','Translation Scale:',...
    'Style','text',...
    'Tag','text78');

    handles.centeredMI_ts = uicontrol('Parent',handles.centeredMI,...
    'FontSize',10,...
    'HorizontalAlignment','left',...
    'Position',[148+dx 123+dy 79 25],...
    'String','0.001',...
    'Style','edit',...
    'Tag','centeredMI_ts');



    guidata(handles.mainframe, handles);
    
end

    