function  ihb_ColorsTalSpace
%----------------------------------------------------------------------------------
% FORMAT ihb_LegendTalSlice
%----------------------------------------------------------------------------------
%----------------------------------------------------------------------------------
%   16.04.01    Sergey Pakhomov
%----------------------------------------------------------------------------------
hLegend = findobj('Type', 'figure', 'Tag', 'ihb_TalSpaceLeg_fig');
if ~isempty(hLegend)
    delete(hLegend);
end

screenUnits = get(0, 'units');      % Save current screen units
set(0, 'units', 'characters');      % Set characters units for screen
scrSize = get(0,'ScreenSize');      % Get screen size
set(0, 'units', screenUnits); 
    
pos(4) =  9;                        % Initial height
pos(3) = 38;                        % Initial width
pos(2) = (scrSize(4) - pos(4))/2;   % Center on 
pos(1) = (scrSize(3) - pos(3))/2;   % screen
%----------------------------------------------------------------------------------
% Load default colors
%----------------------------------------------------------------------------------
dflFileName = ihb_FileFolderName('dfl');
load(dflFileName, 'ihbdfl_color_clOrig', 'ihbdfl_color_clSymm', 'ihbdfl_color_surface');
load(dflFileName, 'ihbdfl_color_cntAx', 'ihbdfl_color_cntFr', 'ihbdfl_color_cntSag');
%----------------------------------------------------------------------------------
hLegend = figure(...
    'NumberTitle', 'off',...
    'Name', 'Legend',...
    'MenuBar', 'none',...
    'Resize', 'off',...
    'Tag', 'ihb_TalSpaceLeg_fig',...
    'Units', 'characters',...
    'Position', pos);
bkgColor = get(hLegend, 'Color');
    
pos = [2 7 2 1];
uicontrol(hLegend,...
    'Style', ' pushbutton',...
    'Units', 'characters',...
    'Position', pos,...
    'Callback', 'ihb_ColorsTalSpaceCB',...
    'TooltipString', 'Click to change color',...
    'Tag', 'ihb_clr_Axial',...
    'BackgroundColor', ihbdfl_color_cntAx);
pos = [2 5 2 1];
uicontrol(hLegend,...
    'Style', ' pushbutton',...
    'Units', 'characters',...
    'Position', pos,...
    'Callback', 'ihb_ColorsTalSpaceCB',...
    'TooltipString', 'Click to change color',...
    'Tag', 'ihb_clr_Frontal',...
    'BackgroundColor', ihbdfl_color_cntFr);
pos = [2 3 2 1];
uicontrol(hLegend,...
    'Style', ' pushbutton',...
    'Units', 'characters',...
    'Position', pos,...
    'Callback', 'ihb_ColorsTalSpaceCB',...
    'TooltipString', 'Click to change color',...
    'Tag', 'ihb_clr_Saggital',...
    'BackgroundColor', ihbdfl_color_cntSag);

pos = [6 7 10 1];
uicontrol(hLegend,...
    'Style', 'text',...
    'Units', 'characters',...
    'Position', pos,...
    'BackgroundColor', bkgColor,...
    'HorizontalAlignment', 'right',...
    'String', 'Axial');
pos = [6 5 10 1];
uicontrol(hLegend,...
    'Style', 'text',...
    'Units', 'characters',...
    'Position', pos,...
    'BackgroundColor', bkgColor,...
    'HorizontalAlignment', 'right',...
    'String', 'Frontal');
pos = [6 3 10 1];
uicontrol(hLegend,...
    'Style', 'text',...
    'Units', 'characters',...
    'Position', pos,...
    'HorizontalAlignment', 'right',...
    'BackgroundColor', bkgColor,...
    'String', 'Saggital');

pos = [20 7 2 1];
uicontrol(hLegend,...
    'Style', ' pushbutton',...
    'Units', 'characters',...
    'Position', pos,...
    'Callback', 'ihb_ColorsTalSpaceCB',...
    'TooltipString', 'Click to change color',...
    'Tag', 'ihb_clr_Orig',...
    'BackgroundColor', ihbdfl_color_clOrig);
pos = [20 5 2 1];
uicontrol(hLegend,...
    'Style', ' pushbutton',...
    'Units', 'characters',...
    'Position', pos,...
    'Callback', 'ihb_ColorsTalSpaceCB',...
    'TooltipString', 'Click to change color',...
    'Tag', 'ihb_clr_Symm',...
    'BackgroundColor', ihbdfl_color_clSymm);
pos = [20 3 2 1];
uicontrol(hLegend,...
    'Style', ' pushbutton',...
    'Units', 'characters',...
    'Position', pos,...
    'Callback', 'ihb_ColorsTalSpaceCB',...
    'TooltipString', 'Click to change color',...
    'Tag', 'ihb_clr_Surface',...
    'BackgroundColor', ihbdfl_color_surface);

pos = [24 7 12 1];
uicontrol(hLegend,...
    'Style', 'text',...
    'Units', 'characters',...
    'Position', pos,...
    'BackgroundColor', bkgColor,...
    'HorizontalAlignment', 'right',...
    'String', 'Original');
pos = [24 5 12 1];
uicontrol(hLegend,...
    'Style', 'text',...
    'Units', 'characters',...
    'Position', pos,...
    'BackgroundColor', bkgColor,...
    'HorizontalAlignment', 'right',...
    'String', 'Symmetrical');
pos = [24 3 12 1];
uicontrol(hLegend,...
    'Style', 'text',...
    'Units', 'characters',...
    'Position', pos,...
    'BackgroundColor', bkgColor,...
    'HorizontalAlignment', 'right',...
    'String', 'Surface');

pos = [11 0.9 16 1.2];
uicontrol(hLegend,...
    'Style', ' pushbutton',...
    'Units', 'characters',...
    'Position', pos,...
    'Callback', 'close',...
    'String', 'Close');
