dw2dtool.m
上传用户:haiyisale
上传日期:2013-01-09
资源大小:3246k
文件大小:26k
源码类别:

波变换

开发平台:

Matlab

  1. function varargout = dw2dtool(option,varargin)
  2. %DW2DTOOL Discrete wavelet 2-D tool.
  3. %   VARARGOUT = DW2DTOOL(OPTION,VARARGIN)
  4. %
  5. %   OPTION = 'create' , 'close'
  6. %   M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 12-Mar-96.
  7. %   Last Revision: 15-Jan-2001.
  8. %   Copyright 1995-2002 The MathWorks, Inc.
  9. %   $Revision: 1.20 $ $Date: 2002/06/17 12:19:05 $
  10. % Test inputs.
  11. %-------------
  12. if nargin==0 , option = 'create'; end
  13. [option,winAttrb] = utguidiv('ini',option,varargin{:});
  14. % Default values.
  15. %----------------
  16. max_lev_anal = 5;
  17. default_nbcolors = 128;
  18. % Tag property of objects.
  19. %-------------------------
  20. tag_m_savesyn = 'Save_Syn';
  21. tag_m_savecfs = 'Save_Cfs';
  22. tag_m_savedec = 'Save_Dec';
  23. tag_pus_anal  = 'Pus_Anal';
  24. tag_pus_deno  = 'Pus_Deno';
  25. tag_pus_comp  = 'Pus_Comp';
  26. tag_pus_hist  = 'Pus_Hist';
  27. tag_pus_stat  = 'Pus_Stat';
  28. tag_pop_declev= 'Pop_DecLev';
  29. tag_pus_vis   = 'Pus_Visu';
  30. tag_pus_big   = 'Pus_Big';
  31. tag_pus_rec   = 'Pus_Rec';
  32. tag_pop_viewm = 'Pop_ViewM';
  33. tag_txt_full  = 'Txt_Full';
  34. tag_pus_full  = ['Pus_Full.1';'Pus_Full.2';'Pus_Full.3';'Pus_Full.4'];
  35. tag_axefigutil = 'Axe_FigUtil';
  36. tag_linetree   = 'Tree_lines';
  37. tag_txttree    = 'Tree_txt';
  38. tag_axeimgbig  = 'Axe_ImgBig';
  39. tag_axeimgini  = 'Axe_ImgIni';
  40. tag_axeimgvis  = 'Axe_ImgVis';
  41. tag_axeimgsel  = 'Axe_ImgSel';
  42. tag_axeimgdec  = 'Axe_ImgDec';
  43. tag_axeimgsyn  = 'Axe_ImgSyn';
  44. tag_axeimghdls = 'Img_Handles';
  45. % MemBloc0 of stored values.
  46. %---------------------------
  47. n_InfoInit   = 'DW2D_InfoInit';
  48. ind_filename = 1;
  49. ind_pathname = 2;
  50. nb0_stored   = 2;
  51. % MemBloc1 of stored values.
  52. %---------------------------
  53. n_param_anal   = 'DWAn2d_Par_Anal';
  54. ind_img_name   = 1;
  55. ind_wav_name   = 2;
  56. ind_lev_anal   = 3;
  57. ind_img_t_name = 4;
  58. ind_img_size   = 5;
  59. ind_nbcolors   = 6;
  60. ind_act_option = 7;
  61. ind_simg_type  = 8;
  62. ind_thr_val    = 9;
  63. nb1_stored     = 9;
  64. % MemBloc2.1 and 2.2 of stored values.
  65. %------------------------------------
  66. n_coefs = 'MemCoefs';
  67. n_sizes = 'MemSizes';
  68. % MemBloc3 of stored values.
  69. %---------------------------
  70. n_miscella      = 'DWAn2d_Miscella';
  71. ind_graph_area  =  1;
  72. ind_pos_axebig  =  2;
  73. ind_pos_axeini  =  3;
  74. ind_pos_axevis  =  4;
  75. ind_pos_axedec  =  5;
  76. ind_pos_axesyn  =  6;
  77. ind_pos_axesel  =  7;
  78. ind_view_status =  8;
  79. ind_save_status =  9;
  80. ind_sel_funct   = 10;
  81. nb3_stored      = 10;
  82. % Miscellaneous values.
  83. %----------------------
  84. % square_viewm  = 1;
  85. % tree_viewm    = 2;
  86. % BoxTitleSel_Col = 'g';
  87. switch option
  88.     case 'create'
  89.         % Get Globals.
  90.         %--------------
  91.         [Def_Txt_Height,Def_Btn_Height,Def_Btn_Width,Pop_Min_Width,  ...
  92.          X_Spacing,Y_Spacing,Def_FraBkColor] = ...
  93.             mextglob('get',...
  94.               'Def_Txt_Height','Def_Btn_Height','Def_Btn_Width','Pop_Min_Width',  ...
  95.               'X_Spacing','Y_Spacing','Def_FraBkColor' ...
  96.               );
  97.         % Variables initialization.
  98.         %--------------------------
  99.         BoxTitleSel_Col = 'g';
  100.         Width_LineSel   = 3;
  101.         select_funct    = 'dw2dimgs(''get_img'');';
  102.         % Wavelet 2-D window initialization.
  103.         %-----------------------------------
  104.         win_title = 'Wavelet 2-D';
  105.         [win_dw2dtool,pos_win,win_units,str_numwin,...
  106.              frame0,pos_frame0,Pos_Graphic_Area,pus_close] = ...
  107.                 wfigmngr('create',win_title,winAttrb,'ExtFig_Tool',mfilename,1,1,0);
  108.         if nargout>0 , varargout{1} = win_dw2dtool; end
  109. % Add Coloration Mode Submenu.
  110. %-----------------------------
  111. wfigmngr('add_CCM_Menu',win_dw2dtool);
  112. % Add Help for Tool.
  113. %------------------
  114. wfighelp('addHelpTool',win_dw2dtool,'T&wo-Dimensional Analysis','DW2D_GUI');
  115. % Add Help Item.
  116. %----------------
  117. wfighelp('addHelpItem',win_dw2dtool,'Working with Images','DW2D_WORKING');
  118. wfighelp('addHelpItem',win_dw2dtool,'Loading and Saving','DW2D_LOADSAVE');
  119.         % Menu construction for current figure.
  120.         %--------------------------------------
  121. [m_files,m_load,m_save] = ...
  122. wfigmngr('getmenus',win_dw2dtool,'file','load','save');
  123.         m_loadimg = uimenu(m_load,...
  124.                                 'Label','&Image ',    ...
  125.                                 'Position',1,             ...
  126.                                 'Callback',               ...
  127.                                 ['dw2dmngr(''load_img'',' ...
  128.                                         str_numwin ');']  ...
  129.                                 );
  130.         m_loadcfs = uimenu(m_load,...
  131.                                 'Label','&Coefficients ', ...
  132.                                 'Position',2,             ...
  133.                                 'Callback',               ...
  134.                                 ['dw2dmngr(''load_cfs'',' ...
  135.                                         str_numwin ');']  ...
  136.                                 );
  137.         m_loaddec = uimenu(m_load,...
  138.                                 'Label','&Decomposition ', ...
  139.                                 'Position',3,              ...
  140.                                 'Callback',                ...
  141.                                 ['dw2dmngr(''load_dec'','  ...
  142.                                         str_numwin ');']   ...
  143.                                 );
  144. m_savesyn = uimenu(m_save,...
  145.                                 'Label','&Synthesized Image ',...
  146.                                 'Position',1,                 ...
  147.                                 'Enable','Off',               ...
  148.                                 'Tag',tag_m_savesyn,          ...
  149.                                 'Callback',                   ...
  150.                                 ['dw2dmngr(''save_synt'','    ...
  151.                                         str_numwin ');']      ...
  152.                                 );
  153.         m_savecfs = uimenu(m_save,...
  154.                                 'Label','&Coefficients ', ...
  155.                                 'Position',2,             ...
  156.                                 'Enable','Off',           ...
  157.                                 'Tag',tag_m_savecfs,      ...
  158.                                 'Callback',               ...
  159.                                 ['dw2dmngr(''save_cfs'',' ...
  160.                                         str_numwin ');']  ...
  161.                                 );
  162.         m_savedec = uimenu(m_save,...
  163.                                 'Label','&Decomposition ', ...
  164.                                 'Position',3,              ...
  165.                                 'Enable','Off',            ...
  166.                                 'Tag',tag_m_savedec,       ...
  167.                                 'Callback',                ...
  168.                                 ['dw2dmngr(''save_dec'','  ...
  169.                                         str_numwin ');']   ...
  170.                                 );
  171.         m_loadtst = uimenu(m_files,...
  172.                                 'Label','&Example Analysis ', ...
  173.                                 'Position',3,             ...
  174.                                 'Separator','Off'         ...
  175.                                 );
  176.         % Submenu of test signals.
  177.         %-------------------------
  178.         beg_call_str = ['dw2dmngr(''demo'',' str_numwin];
  179.         tab  = setstr(9);
  180.         sep1 = ['At level '];
  181.         sep2 = [' , with '];
  182.         sep3 = ['    ' tab ' ---> '];
  183.         lab_str = [sep1 '3' sep2 'sym4' sep3 'Detail Durer '];
  184.         cba     = [beg_call_str ',''detail'',''sym4'',3);'];
  185.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  186.         lab_str = [sep1 '2' sep2 'haar' sep3 'Woman '];
  187.         cba     = [beg_call_str ',''woman'',''haar'',2);'];
  188.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  189.         lab_str = [sep1 '3' sep2 'haar' sep3 'Finger '];
  190.         cba     = [beg_call_str ',''detfingr'',''haar'',3);'];
  191.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  192.         lab_str = [sep1 '3' sep2 'haar' sep3 'Tire '];
  193.         cba     = [beg_call_str ',''tire'',''haar'',3);'];
  194.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  195.         lab_str = [sep1 '3' sep2 'sym3' sep3 'Chess '];
  196.         cba     = [beg_call_str ',''chess'',''sym3'',3);'];
  197.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  198.         lab_str = [sep1 '2' sep2 'bior3.7' sep3 'Barb '];
  199.         cba     = [beg_call_str ',''wbarb'',''bior3.7'',2);'];
  200.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  201.         lab_str = [sep1 '3' sep2 'bior5.5' sep3 'Facets '];
  202.         cba     = [beg_call_str ',''facets'',''bior5.5'',3);'];
  203.         uimenu(m_loadtst,'Separator','on','Label',lab_str,'Callback',cba);
  204.         lab_str = [sep1 '3' sep2 'bior4.4' sep3 'Geometry '];
  205.         cba     = [beg_call_str ',''geometry'',''bior4.4'',3);'];
  206.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  207.         lab_str = [sep1 '4' sep2 'db3' sep3 'Sinsin '];
  208.         cba     = [beg_call_str ',''sinsin'',''db3'',4);'];
  209.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  210.         lab_str = [sep1 '3' sep2 'coif2' sep3 'Tartan '];
  211.         cba     = [beg_call_str ',''tartan'',''coif2'',3);'];
  212.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  213.         lab_str = [sep1 '3' sep2 'db1' sep3 'Mandel set '];
  214.         cba     = [beg_call_str ',''mandel'',''db1'',3);'];
  215.         uimenu(m_loadtst,'Separator','on','Label',lab_str,'Callback',cba);
  216.         lab_str = [sep1 '3' sep2 'db1' sep3 'Julia set '];
  217.         cba     = [beg_call_str ',''julia'',''db1'',3);'];
  218.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  219.         lab_str = [sep1 '5' sep2 'coif1' sep3 'Ifs '];
  220.         cba     = [beg_call_str ',''wifs'',''coif1'',5);'];
  221.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  222.         lab_str = [sep1 '3' sep2 'db2' sep3 'Noisy Woman '];
  223.         cba     = [beg_call_str ',''noiswom'',''db2'',3);'];
  224.         uimenu(m_loadtst,'Separator','on','Label',lab_str,'Callback',cba);
  225.         lab_str = [sep1 '3' sep2 'bior6.8' sep3 'Noisy SinSin '];
  226.         cba     = [beg_call_str ',''noissi2d'',''bior6.8'',3);'];
  227.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  228.         lab_str = [sep1 '2' sep2 'haar' sep3 'Mandrill '];
  229.         cba     = [beg_call_str ',''wmandril'',''haar'',2);'];
  230.         uimenu(m_loadtst,'Separator','on','Label',lab_str,'Callback',cba);
  231.         lab_str = [sep1 '2' sep2 'sym5' sep3 'Gatlin '];
  232.         cba     = [beg_call_str ',''wgatlin'',''sym5'',2);'];
  233.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  234.         lab_str = [sep1 '3' sep2 'bior1.5' sep3 'Belmont 1'];
  235.         cba     = [beg_call_str ',''belmont1'',''bior1.5'',3);'];
  236.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  237.   
  238.         lab_str = [sep1 '3' sep2 'coif1' sep3 'Belmont 2'];
  239.         cba     = [beg_call_str ',''belmont2'',''coif1'',3);'];
  240.         uimenu(m_loadtst,'Label',lab_str,'Callback',cba);
  241.         % Begin waiting.
  242.         %---------------
  243.         wwaiting('msg',win_dw2dtool,'Wait ... initialization');
  244.         % General parameters initialization.
  245.         %-----------------------------------
  246.         dx = X_Spacing; dx2 = 2*dx;
  247.         dy = Y_Spacing; dy2 = 2*dy;
  248.         d_txt = (Def_Btn_Height-Def_Txt_Height);
  249.         x_frame0   = pos_frame0(1);
  250.         btn_width  = Def_Btn_Width;
  251.         w_subframe = pos_frame0(3)-4*dx;
  252.         w_util     = (pos_frame0(3)-9*dx)/3;
  253.         push_width = (pos_frame0(3)-8*dx)/2;
  254.         pop_width  = Pop_Min_Width;
  255.         % Position property of objects.
  256.         %------------------------------
  257.         xlocINI    = pos_frame0([1 3]);
  258.         ybottomINI = pos_win(4)-3.5*Def_Btn_Height-dy2;
  259.         y_low      = ybottomINI;
  260.         bdx        = (pos_frame0(3)-1.5*btn_width)/2;
  261.         x_left     = x_frame0+bdx;
  262.         y_low      = y_low-Def_Btn_Height-3*dy2;
  263.         h_btn      = 1.5*Def_Btn_Height;
  264.         pos_anal   = [x_left, y_low, 1.5*btn_width, h_btn];
  265.         x_left     = x_frame0+dx2;
  266.         y_low      = pos_anal(2)-1.5*Def_Btn_Height-2*dy2;
  267.         push_width = (pos_frame0(3)-3*dx2)/2;
  268.         pos_stat   = [x_left, y_low, push_width, h_btn];
  269.         pos_comp    = pos_stat;
  270.         pos_comp(1) = pos_stat(1)+pos_stat(3)+dx2;
  271.         y_low       = y_low-1.5*Def_Btn_Height-dy;
  272.         pos_hist    = [x_left, y_low, push_width, h_btn];
  273.         pos_deno    = pos_hist;
  274.         pos_deno(1) = pos_hist(1)+pos_hist(3)+dx2;
  275.         y_low          = y_low-Def_Btn_Height-2*dy2;
  276.         w_txt          = 2*push_width+dx2-pop_width;
  277.         pos_txt_declev = [x_left, y_low+d_txt/2, w_txt, Def_Txt_Height];
  278.         pos_declev     = [x_left+4*dx2, y_low, pop_width, Def_Btn_Height];
  279.         pos_declev(1)  = pos_txt_declev(1)+pos_txt_declev(3);
  280.         y_low          = y_low-Def_Btn_Height-2*dy2;
  281.         pos_pop_viewm  = [x_left, y_low, 2*push_width+dx2, Def_Btn_Height];
  282.         y_low          = y_low-Def_Btn_Height-dy2;
  283.         w_txt          = dx2+w_util;
  284.         xl             = x_left+dx;
  285.         yl             = y_low-Def_Txt_Height/2;
  286.         pos_txt_full   = [xl, yl, w_txt, Def_Txt_Height];
  287.         pos_pus_full      = zeros(4,4);
  288.         xl                = pos_txt_full(1)+pos_txt_full(3)+dx;
  289.         pos_pus_full(1,:) = [xl, y_low, w_util, Def_Btn_Height];
  290.         pos_pus_full(2,:) = pos_pus_full(1,:);
  291.         pos_pus_full(2,2) = pos_pus_full(2,2)-Def_Btn_Height;
  292.         pos_pus_full(3,:) = pos_pus_full(1,:);
  293.         pos_pus_full(3,1) = pos_pus_full(3,1)+pos_pus_full(3,3);
  294.         pos_pus_full(4,:) = pos_pus_full(3,:);
  295.         pos_pus_full(4,2) = pos_pus_full(4,2)-pos_pus_full(4,4);
  296.         y_low       = y_low-2*Def_Btn_Height-3*dy2;
  297.         pos_tdrag   = [x_left, y_low, w_subframe, Def_Btn_Height];
  298.         h_btn       = 1.25*Def_Btn_Height;
  299.         w_btn       = 1.25*push_width;
  300.         x_btn       = x_frame0+(pos_frame0(3)-w_btn)/2;
  301.         y_low       = y_low-h_btn;
  302.         pos_pus_vis = [x_btn , y_low , w_btn ,h_btn];
  303.         y_low       = y_low-h_btn;
  304.         pos_pus_big = [x_btn , y_low , w_btn ,h_btn];
  305.         y_low       = y_low-h_btn;
  306.         pos_pus_rec = [x_btn , y_low , w_btn ,h_btn];
  307.         % String property of objects.
  308.         %----------------------------
  309.         str_anal       = 'Analyze';
  310.         str_synt       = 'Synthesize';
  311.         str_stat       = 'Statistics';
  312.         str_comp       = 'Compress';
  313.         str_hist       = 'Histograms';
  314.         str_deno       = 'De-noise';
  315.         str_txtlev_dec = 'Decomposition at level : ';
  316.         str_vallev_dec = int2str([1:max_lev_anal]');
  317.         str_txt_drag   = 'Operations on selected image : ';
  318.         str_rec        = 'Reconstruct';
  319.         str_vis       = 'Visualize';
  320.         str_big        = 'Full Size';
  321.         str_pop_viewm  = 'View mode : Square|View mode : Tree';
  322.         str_txt_full   = 'Full Size';
  323.         % Callback property of objects.
  324.         %------------------------------
  325.         cba_pus_anal   = ['dw2dmngr(''analyze'',' str_numwin ');'];
  326.         cba_stat       = ['dw2dmngr(''stat'',' str_numwin ');'];
  327.         cba_comp       = ['dw2dmngr(''comp'',' str_numwin ');'];
  328.         cba_hist       = ['dw2dmngr(''hist'',' str_numwin ');'];
  329.         cba_deno       = ['dw2dmngr(''deno'',' str_numwin ');'];
  330.         cba_pop_declev = ['dw2dmngr(''view_dec'',' str_numwin ');'];
  331.         cba_pop_viewm  = ['dw2dmngr(''view_mode'',' str_numwin ');'];
  332.         % Command part of the window.
  333.         %============================
  334.         % Data, Wavelet and Level parameters.
  335.         %------------------------------------
  336.         utanapar('create',win_dw2dtool, ...
  337.                  'xloc',xlocINI,'bottom',ybottomINI,...
  338.                  'enable','off',        ...
  339.                  'wtype','dwt',         ...
  340.                  'maxlev',max_lev_anal  ...
  341.                  );
  342.         comFigProp = {'Parent',win_dw2dtool,'Unit',win_units};
  343.         comPusProp = {comFigProp{:},'Style','Pushbutton','Enable','off'};
  344.         comPopProp = {comFigProp{:},'Style','Popupmenu','Enable','off'};
  345.         comTxtProp = {comFigProp{:},'Style','Text', ...
  346.                       'Backgroundcolor',Def_FraBkColor};
  347.         pus_anal = uicontrol(comPusProp{:},...
  348.                              'Position',pos_anal,...
  349.                              'String',xlate(str_anal),...
  350.                              'Tag',tag_pus_anal,...
  351.                              'Interruptible','On',...
  352.                              'Callback',cba_pus_anal...
  353.                              );
  354.         pus_stat = uicontrol(comPusProp{:},...
  355.                              'Position',pos_stat,...
  356.                              'String',xlate(str_stat),...
  357.                              'Tag',tag_pus_stat,...
  358.                              'Callback',cba_stat...
  359.                              );
  360.         pus_comp = uicontrol(comPusProp{:},...
  361.                              'Position',pos_comp,...
  362.                              'String',xlate(str_comp),...
  363.                              'Tag',tag_pus_comp,...
  364.                              'Callback',cba_comp...
  365.                              );
  366.         pus_hist = uicontrol(comPusProp{:},...
  367.                              'Position',pos_hist,...
  368.                              'String',xlate(str_hist),...
  369.                              'Tag',tag_pus_hist,...
  370.                              'Callback',cba_hist...
  371.                              );
  372.         pus_deno = uicontrol(comPusProp{:},...
  373.                              'Position',pos_deno,...
  374.                              'String',xlate(str_deno),...
  375.                              'Tag',tag_pus_deno,...
  376.                              'Callback',cba_deno...
  377.                              );
  378.         txt_declev = uicontrol(comTxtProp{:},...
  379.                                'Position',pos_txt_declev,...
  380.                                'HorizontalAlignment','left',...
  381.                                'String',str_txtlev_dec...
  382.                                );
  383.         pop_declev = uicontrol(comPopProp{:},...
  384.                                'Position',pos_declev,...
  385.                                'String',str_vallev_dec,...
  386.                                'Tag',tag_pop_declev,...
  387.                                'Callback',cba_pop_declev...
  388.                                );
  389.         pop_view_mode = uicontrol(comPopProp{:},...
  390.                                   'Position',pos_pop_viewm,...
  391.                                   'String',str_pop_viewm,...
  392.                                   'Callback',cba_pop_viewm,...
  393.                                   'Tag',tag_pop_viewm...
  394.                                   );
  395.         txt_full = uicontrol(comTxtProp{:},...
  396.                              'HorizontalAlignment','Center',...
  397.                              'Position',pos_txt_full,...
  398.                              'String',str_txt_full,...
  399.                              'Tag',tag_txt_full...
  400.                              );
  401.         tooltip = strvcat(...
  402.             'View original image',    ...
  403.             'View synthesized image', ...
  404.             'View selected image',...
  405.             'View wavelet decomposition' ...
  406.             );
  407.         for k=1:4
  408.             pus_full(k) = uicontrol(comPusProp{:},...
  409.                                     'Position',pos_pus_full(k,:),...
  410.                                     'String',sprintf('%.0f',k),...
  411.                                     'Userdata',0,...
  412.                                     'ToolTip',deblank(tooltip(k,:)), ...
  413.                                     'Tag',tag_pus_full(k,:)...
  414.                                     );
  415.         end
  416.         txt_drag = uicontrol(comTxtProp{:},...
  417.                              'Position',pos_tdrag,...
  418.                              'HorizontalAlignment','left',...
  419.                              'String',str_txt_drag...
  420.                              );
  421.         pus_vis = uicontrol(comPusProp{:},...
  422.                              'Position',pos_pus_vis,...
  423.                              'String',xlate(str_vis),...
  424.                              'Tag',tag_pus_vis...
  425.                              );
  426.         pus_big  = uicontrol(comPusProp{:},...
  427.                              'Position',pos_pus_big,...
  428.                              'String',xlate(str_big),...
  429.                              'Tag',tag_pus_big...
  430.                              );
  431.         pus_rec  = uicontrol(comPusProp{:},...
  432.                              'Position',pos_pus_rec,...
  433.                              'String',xlate(str_rec),...
  434.                              'Tag',tag_pus_rec...
  435.                              );
  436.         % Adding colormap GUI.
  437.         %---------------------
  438.         utcolmap('create',win_dw2dtool, ...
  439.                  'xloc',xlocINI,'bkcolor',Def_FraBkColor);
  440.         %  Normalisation.
  441.         %----------------
  442.         Pos_Graphic_Area = wfigmngr('normalize',win_dw2dtool,Pos_Graphic_Area);
  443.         % Callbacks update.
  444.         %------------------
  445.         utanapar('set_cba_num',win_dw2dtool,[m_files;pus_anal]);
  446.         beg_cba     = ['dw2dmngr(''select'','  str_numwin ','];
  447.         cba_pus_vis = [beg_cba , num2mstr(pus_vis) ');'];
  448.         cba_pus_big = [beg_cba , num2mstr(pus_big) ');'];
  449.         cba_pus_rec = [beg_cba , num2mstr(pus_rec) ');'];
  450.         set(pus_vis,'Callback',cba_pus_vis);
  451.         set(pus_big,'Callback',cba_pus_big);
  452.         set(pus_rec,'Callback',cba_pus_rec);
  453.         beg_cba = ['dw2dmngr(''fullsize'',' str_numwin ','];
  454.         for k=1:4
  455.             pus = pus_full(k);
  456.             cba_pus_full = [beg_cba sprintf('%.0f',k) ');'];
  457.             set(pus,'Callback',cba_pus_full);
  458.         end
  459. % Add Context Sensitive Help (CSHelp).
  460. %-------------------------------------
  461. hdl_DW2D_FULLSIZE = [txt_full,pus_full(:)'];
  462. hdl_DW2D_SELECT = [txt_drag,pus_vis,pus_big,pus_rec];
  463. wfighelp('add_ContextMenu',win_dw2dtool,hdl_DW2D_FULLSIZE,'DW2D_FULLSIZE');
  464. wfighelp('add_ContextMenu',win_dw2dtool,hdl_DW2D_SELECT,'DW2D_SELECT');
  465. %-------------------------------------
  466.         % Memory for stored values.
  467.         %--------------------------
  468.         wmemtool('ini',win_dw2dtool,n_InfoInit,nb0_stored);
  469.         wmemtool('ini',win_dw2dtool,n_param_anal,nb1_stored);
  470.         wmemtool('ini',win_dw2dtool,n_miscella,nb3_stored);
  471.         wmemtool('wmb',win_dw2dtool,n_param_anal,ind_act_option,option);
  472.         wmemtool('wmb',win_dw2dtool,n_miscella,                 ...
  473.                  ind_graph_area,Pos_Graphic_Area,ind_view_status,'none', ...
  474.                  ind_save_status,'none',ind_sel_funct,select_funct       ...
  475.                  );
  476.         % Setting Colormap.
  477.         %------------------
  478.         cbcolmap('set',win_dw2dtool,'pal',{'pink',default_nbcolors});
  479.         % Creating Axes: ImgIni, ImgBig, ImgVis, ImgSyn & ImgSel.
  480.         %--------------------------------------------------------
  481.         commonProp = {...
  482.                       'Parent',win_dw2dtool,     ...
  483.                       'Position',[0 0 1 1],      ...
  484.                       'Visible','off',           ...
  485.                       'DrawMode','Fast',         ...
  486.                       'XTicklabelMode','manual', ...
  487.                       'YTicklabelMode','manual', ...
  488.                       'XTicklabel',[],           ...
  489.                       'YTicklabel',[],           ...
  490.                       'Box','On',                ...
  491.                       'XGrid','off',             ...
  492.                       'YGrid','off'              ...
  493.                       };
  494.         Axe_ImgIni = axes(commonProp{:},'Tag',tag_axeimgini);
  495.         Axe_ImgVis = axes(commonProp{:},'Tag',tag_axeimgvis);
  496.         Axe_ImgBig = axes(commonProp{:},'Tag',tag_axeimgbig);
  497.         Axe_ImgSyn = axes(commonProp{:},'Tag',tag_axeimgsyn);
  498.         Axe_ImgSel = axes(commonProp{:},'Tag',tag_axeimgsel);
  499.         % Creating AxeImgDec.
  500.         %--------------------
  501.         locProp = {commonProp{:},'XTick',[],'YTick',[],'Tag',tag_axeimgdec}; 
  502.         Axe_ImgDec = zeros(1,4*max_lev_anal);
  503.         for ind=1:4*max_lev_anal
  504.             Axe_ImgDec(ind) = axes(locProp{:});
  505.         end
  506.         wmemtool('wmb',win_dw2dtool,tag_axeimgdec,1,Axe_ImgDec);
  507.         % Creating Tree axes.
  508.         %-------------------
  509.         axe_figutil = axes(...
  510.                            'Parent',win_dw2dtool,    ...
  511.                            'Position',[0 0 1 1],     ...
  512.                            'Xlim',[0 1],'Ylim',[0 1],...
  513.                            'DrawMode','Normal',      ...
  514.                            'Visible','off',          ...
  515.                            'Tag',tag_axefigutil      ...
  516.                            );
  517.         for k = 1:max_lev_anal+1
  518.             line(...
  519.                  'Parent',axe_figutil,       ...
  520.                  'Xdata',[0 0],'Ydata',[0 0],...
  521.                  'LineWidth',2,'Color',wtbutils('colors','linDW2D'), ...
  522.                  'Visible','off',   ...
  523.                  'Userdata',k,      ...
  524.                  'Tag',tag_linetree ...
  525.                  );
  526.         end
  527.         fontsize = wmachdep('fontsize','normal');
  528.         axeXColor = get(win_dw2dtool,'DefaultAxesXColor');
  529.         for k = 1:max_lev_anal
  530.             text(...
  531.                  'Parent',axe_figutil,           ...
  532.                  'String',['L_' sprintf('%.0f',k)],...
  533.                  'FontSize',fontsize,            ...
  534.                  'FontWeight','bold',            ...
  535.                  'HorizontalAlignment','left',   ...
  536.                  'Visible','off',                ...
  537.                  'Userdata',k,                   ...
  538.                  'Color',axeXColor,              ...
  539.                  'Tag',tag_txttree               ...
  540.                  );
  541.         end
  542.         dw2darro('ini_arrow',win_dw2dtool);
  543.         wboxtitl('create',axe_figutil,Axe_ImgSel,BoxTitleSel_Col,...
  544.                           'Image Selection','off');
  545.         % End waiting.
  546.         %---------------
  547.         wwaiting('off',win_dw2dtool);
  548.     case 'close'
  549.         called_win = wfindobj('figure','Userdata',varargin{1});
  550.         delete(called_win);
  551.     otherwise
  552.         errargt(mfilename,'Unknown Option','msg');
  553.         error('*');
  554. end