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: BrainNet_Option.m
    path of file: ./repos/EEGapp/EEGapp/custom_stuff/Brain_net
    
    the code of the file until where you have to start completion: function varargout = BrainNet_Option(varargin)
%BrainNet Viewer, a graph-based brain network mapping tool, by Mingrui Xia
%Function for control panel
%-----------------------------------------------------------
%	Copyright(c) 2013
%	State Key Laboratory of Cognitive Neuroscience and Learning, Beijing Normal University
%	Written by Mingrui Xia
%	Mail to Author:  <a href="mingruixia@gmail.com">Mingrui Xia</a>
%   Version 1.52;
%   Date 20110531;
%   Last edited 20150414
%-----------------------------------------------------------
%
% BrainNet_Option MATLAB code for BrainNet_Option.fig
%      BrainNet_Option, by itself, creates a new BrainNet_Option or raises the existing
%      singleton*.
%
%      H = BrainNet_Option returns the handle to a new BrainNet_Option or the handle to
%      the existing singleton*.
%
%      BrainNet_Option('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in BrainNet_Option.M with the given input arguments.
%
%      BrainNet_Option('Property','Value',...) creates a new BrainNet_Option or rai
    
function ImgPW_edit_Callback(hObject, eventdata, handles)
% hObject    handle to ImgPW_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of ImgPW_edit as text
%        str2double(get(hObject,'String')) returns contents of ImgPW_edit as a double
global EC
switch get(handles.ImgDW_popupmenu,'Value')
    case 1
        set(handles.ImgDW_edit,'String',num2str(str2double(get(handles.ImgPW_edit,'String'))/str2double(get(handles.ImgD_edit,'String'))*2.54,'%6.2f'));
    case 2
        set(handles.ImgDW_edit,'String',num2str(str2double(get(handles.ImgPW_edit,'String'))/str2double(get(handles.ImgD_edit,'String')),'%6.2f'));
end
if get(handles.ImgC_checkbox,'Value')==1
    set(handles.ImgPH_edit,'String',num2str(str2double(get(handles.ImgPW_edit,'String'))*EC.img.height/EC.img.width,'%5d'));
    set(handles.ImgDH_edit,'String',num2str(str2double(get(handles.ImgDW_edit,'String'))*EC.img.height/EC.img.width,'%6.2f'));
end


% --- Executes during object creation, after setting all properties.
function ImgPW_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ImgPW_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function ImgPH_edit_Callback(hObject, eventdata, handles)
% hObject    handle to ImgPH_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of ImgPH_edit as text
%        str2double(get(hObject,'String')) returns contents of ImgPH_edit as a double
global EC
switch get(handles.ImgDW_popupmenu,'Value')
    case 1
        set(handles.ImgDH_edit,'String',num2str(str2double(get(handles.ImgPH_edit,'String'))/str2double(get(handles.ImgD_edit,'String'))*2.54,'%6.2f'));
    case 2
        set(handles.ImgDH_edit,'String',num2str(str2double(get(handles.ImgPH_edit,'String'))/str2double(get(handles.ImgD_edit,'String')),'%6.2f'));
end
if get(handles.ImgC_checkbox,'Value')==1
    set(handles.ImgPW_edit,'String',num2str(str2double(get(handles.ImgPH_edit,'String'))*EC.img.width/EC.img.height,'%5d'));
    set(handles.ImgDW_edit,'String',num2str(str2double(get(handles.ImgDH_edit,'String'))*EC.img.width/EC.img.height,'%6.2f'));
end


% --- Executes during object creation, after setting all properties.
function ImgPH_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ImgPH_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function ImgD_edit_Callback(hObject, eventdata, handles)
% hObject    handle to ImgD_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of ImgD_edit as text
%        str2double(get(hObject,'String')) returns contents of ImgD_edit as a double
switch get(handles.ImgDW_popupmenu,'Value')
    case 1
        set(handles.ImgPW_edit,'String',num2str(str2double(get(handles.ImgDW_edit,'String'))*str2double(get(handles.ImgD_edit,'String'))/2.54,'%5.0f'));
        set(handles.ImgPH_edit,'String',num2str(str2double(get(handles.ImgDH_edit,'String'))*str2double(get(handles.ImgD_edit,'String'))/2.54,'%5.0f'));
    case 2
        set(handles.ImgPW_edit,'String',num2str(str2double(get(handles.ImgDW_edit,'String'))*str2double(get(handles.ImgD_edit,'String')),'%5.0f'));
        set(handles.ImgPH_edit,'String',num2str(str2double(get(handles.ImgDH_edit,'String'))*str2double(get(handles.ImgD_edit,'String')),'%5.0f'));
end




% --- Executes during object creation, after setting all properties.
function ImgD_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ImgD_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- If Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over BakC_text.
function BakC_text_ButtonDownFcn(hObject, eventdata, handles)
% hObject    handle to BakC_text (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
c=uisetcolor('Select Color');
if length(c)==3
    set(handles.BakC_text,'BackgroundColor',c);
    ChangeFlag(handles);
end