Changeset 141 for trunk/src/uvmat.m


Ignore:
Timestamp:
Nov 29, 2010, 10:01:51 AM (13 years ago)
Author:
sommeria
Message:

cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r139 r141  
    193193
    194194%------------------------------------------------------------------------
    195 % --- Executes just before uvmat is made visible.
     195% --- Executes just before the GUI uvmat is made visible.
    196196function uvmat_OpeningFcn(hObject, eventdata, handles, input )
    197197%------------------------------------------------------------------------
     
    390390set_vec_col_bar(handles) %update the display of color code for vectors
    391391
    392 %-------------------------------------------------------------------
     392%------------------------------------------------------------------------
    393393% --- Outputs from this function are returned to the command menuline.
    394394function varargout = uvmat_OutputFcn(hObject, eventdata, handles)
    395395varargout{1} = handles.output;% the only output argument is the handle to the GUI figure
    396396
    397 %-------------------------------------------------------------------
    398 %-------------------------------------------------------------------
    399 % II - FUNCTIONS FOR INTRODUCING THE INPUT FILES
     397%------------------------------------------------------------------------
     398%------------------------------------------------------------------------
     399%  II - FUNCTIONS FOR INTRODUCING THE INPUT FILES
    400400% automatically sets the global properties when the rootfile name is introduced
    401401% then activate the view-field action if selected
    402402% it is activated either by clicking on the RootPath window or by the
    403403% browser
    404 %------------------------------------------------------------------
    405 %------------------------------------------------------------------
    406 
     404%------------------------------------------------------------------------
     405%------------------------------------------------------------------------
    407406% --- Executes on the menu Open/Browse...
    408407% search the files, recognize their type according to their name and fill the rootfile input windows
     
    484483end
    485484
    486 % --------------------------------------------------------------------
     485% -----------------------------------------------------------------------
     486% --- Open again the file whose name has been recorded in MenuFile_1
    487487function MenuFile_1_Callback(hObject, eventdata, handles)
    488488fileinput=get(handles.MenuFile_1,'Label');
    489489display_file_name(hObject, eventdata, handles,fileinput)
    490490
    491 % --------------------------------------------------------------------
     491% -----------------------------------------------------------------------
     492% --- Open again the file whose name has been recorded in MenuFile_2
    492493function MenuFile_2_Callback(hObject, eventdata, handles)
    493494fileinput=get(handles.MenuFile_2,'Label');
    494495display_file_name(hObject, eventdata, handles,fileinput)
    495496
    496 % --------------------------------------------------------------------
     497% -----------------------------------------------------------------------
     498% --- Open again the file whose name has been recorded in MenuFile_3
    497499function MenuFile_3_Callback(hObject, eventdata, handles)
    498500fileinput=get(handles.MenuFile_3,'Label');
    499501display_file_name(hObject, eventdata, handles,fileinput)
    500502
    501 % --------------------------------------------------------------------
     503% -----------------------------------------------------------------------
     504% --- Open again the file whose name has been recorded in MenuFile_4
    502505function MenuFile_4_Callback(hObject, eventdata, handles)
    503506fileinput=get(handles.MenuFile_4,'Label');
    504507display_file_name(hObject, eventdata, handles,fileinput)
    505508
    506 % --------------------------------------------------------------------
     509% -----------------------------------------------------------------------
     510% --- Open again the file whose name has been recorded in MenuFile_5
    507511function MenuFile_5_Callback(hObject, eventdata, handles)
    508512fileinput=get(handles.MenuFile_5,'Label');
    509513display_file_name(hObject, eventdata, handles,fileinput)
    510514
    511 %-----------------------------------------------------------------
    512 % fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput'
    513 %----------------------------------------------------------------
     515%------------------------------------------------------------------------
     516% --- Fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput'
    514517function display_file_name(hObject, eventdata, handles,fileinput)
    515518if ~exist(fileinput,'file')
     
    611614
    612615%------------------------------------------------------------------------
     616% --- Called by action in RootPath edit box
    613617function RootPath_Callback(hObject,eventdata,handles)
    614618%------------------------------------------------------------------------
     
    616620
    617621%------------------------------------------------------------------------
    618 %-- called by action in RootFile edit box
     622% --- Called by action in RootFile edit box
    619623function SubDir_Callback(hObject, eventdata, handles)
    620624%------------------------------------------------------------------------
     
    625629
    626630%------------------------------------------------------------------------
    627 % --- called by action in RootFile edit box
     631% --- Called by action in RootFile edit box
    628632function RootFile_Callback(hObject, eventdata, handles)
    629633%------------------------------------------------------------------------
     
    631635
    632636%------------------------------------------------------------------------
    633 % --- called by action in FileIndex edit box
     637% --- Called by action in FileIndex edit box
    634638function FileIndex_Callback(hObject, eventdata, handles)
    635639%------------------------------------------------------------------------
     
    650654
    651655%------------------------------------------------------------------------
    652 % --- called by action in FileIndex_1 edit box
    653 function FileIndex_1_Callback(hObject, eventdata, handles)
    654 %------------------------------------------------------------------------
    655 run0_Callback(hObject, eventdata, handles)
    656 
    657 %------------------------------------------------------------------------
    658 % --- update information about a new field series (indices to scan, timing, calibration from an xml file, then refresh current plots
     656% --- Update information about a new field series (indices to scan, timing,
     657%     calibration from an xml file, then refresh current plots
    659658function update_rootinfo(hObject,eventdata,handles)
    660659%------------------------------------------------------------------------
     
    895894set_scan_options(hObject, eventdata, handles)
    896895
    897 
    898 %-------------------------------------------------------------------
    899 %-- set index navigation options for new series input and refresh plot
    900 %-------------------------------------------------------------------
     896%------------------------------------------------------------------------
     897%--- Set index navigation options for new series input and refresh plot
     898%------------------------------------------------------------------------
    901899function set_scan_options(hObject, eventdata, handles)
    902900
     
    955953end
    956954
    957 %-------------------------------------------------------------------
     955%------------------------------------------------------------------------
     956% --- Executes on the menu Open/Browse_1 for the second input field,
     957%     search the files, recognize their type according to their name and fill the rootfile input windows
    958958function MenuBrowse_1_Callback(hObject, eventdata, handles)
    959959%-------------------------------------------------------------------
     
    10221022end
    10231023
    1024 % --------------------------------------------------------------------
     1024% -----------------------------------------------------------------------
     1025% --- Open again as second field the file whose name has been recorded in MenuFile_1
    10251026function MenuFile_1_1_Callback(hObject, eventdata, handles)
    10261027fileinput_1=get(handles.MenuFile_1_1,'Label');
    10271028display_file_name_1(hObject,eventdata,handles,fileinput_1)
    10281029
    1029 % --------------------------------------------------------------------
     1030% -----------------------------------------------------------------------
     1031% --- Open again as second field the file whose name has been recorded in MenuFile_2
    10301032function MenuFile_2_1_Callback(hObject, eventdata, handles)
    10311033fileinput_1=get(handles.MenuFile_2_1,'Label');
    10321034display_file_name_1(hObject,eventdata,handles,fileinput_1)
    10331035
    1034 % --------------------------------------------------------------------
     1036% -----------------------------------------------------------------------
     1037% --- Open again as second field the file whose name has been recorded in MenuFile_3
    10351038function MenuFile_3_1_Callback(hObject, eventdata, handles)
    10361039fileinput_1=get(handles.MenuFile_3_1,'Label');
    10371040display_file_name_1(hObject,eventdata,handles,fileinput_1)
    10381041
    1039 % --------------------------------------------------------------------
     1042% -----------------------------------------------------------------------
     1043% --- Open again as second field the file whose name has been recorded in MenuFile_4
    10401044function MenuFile_4_1_Callback(hObject, eventdata, handles)
    10411045fileinput_1=get(handles.MenuFile_4_1,'Label');
    10421046display_file_name_1(hObject,eventdata,handles,fileinput_1)
    10431047
    1044 % --------------------------------------------------------------------
     1048% -----------------------------------------------------------------------
     1049% --- Open again as second field the file whose name has been recorded in MenuFile_5
    10451050function MenuFile_5_1_Callback(hObject, eventdata, handles)
    10461051fileinput_1=get(handles.MenuFile_5_1,'Label');
    10471052display_file_name_1(hObject,eventdata,handles,fileinput_1)
    10481053
    1049 %----------------------------------------------------------------- 
    1050 % fills the edit boxes RootPath, RootFile,NomType...from an input file name 'fileinput'
    1051 %----------------------------------------------------------------
     1054%------------------------------------------------------------------------
     1055% fills the edit boxes RootPath_1, RootFile_1,NomType_1...from an input file name 'fileinput_1'
     1056%------------------------------------------------------------------------
    10521057function display_file_name_1(hObject,eventdata,handles,fileinput_1)
    10531058
     
    11651170RootPath_1_Callback(hObject,eventdata,handles); 
    11661171
    1167 
    1168 %-----------------------------------------------------
     1172%-----------------------------------------------------------------------
     1173% --- Called by action in RootPath_1 edit box
    11691174function RootPath_1_Callback(hObject,eventdata,handles)
    11701175update_rootinfo_1(hObject,eventdata,handles)
    11711176
    1172 %-------------------------------------------------------------------
     1177%-----------------------------------------------------------------------
     1178% --- Called by action in RootFile_1 edit box
    11731179function RootFile_1_Callback(hObject, eventdata, handles)
    11741180update_rootinfo_1(hObject,eventdata,handles)
    1175 %-------------------------------------------------------------------
    1176 
    1177 %-------------------------------------------------------------------
     1181%-----------------------------------------------------------------------
     1182
     1183%------------------------------------------------------------------------
     1184% --- Called by action in FileIndex_1 edit box
     1185function FileIndex_1_Callback(hObject, eventdata, handles)
     1186%------------------------------------------------------------------------
     1187
     1188run0_Callback(hObject, eventdata, handles)
     1189
     1190%------------------------------------------------------------------------
     1191% --- Update information about a new second field series (indices to scan, timing,
     1192%     calibration from an xml file, then refresh current plots
    11781193function update_rootinfo_1(hObject,eventdata,handles) %A REVOIR
    11791194
    11801195set(handles.RootPath_1,'BackgroundColor',[1 1 0])% indicate active program by yellow color
    11811196drawnow
    1182 %huvmat=get(handles.RootPath,'parent');
    11831197UvData=get(handles.uvmat,'UserData');%huvmat=handles of the uvmat interface
    11841198UvData.NewSeries=1; %flag for run0: begin a new series
     
    12081222    hhh=which('mmreader');
    12091223elseif ~isempty(imformats(FileExt(2:end)))|| isequal(FileExt,'.vol')
    1210     testima=1;
    12111224    if ~isequal(SubDir,'')
    12121225        RootFile=get(handles.RootFile,'String');
     
    12261239    UvData=rmfield(UvData,'MovieObject_1');
    12271240end
    1228 if strcmp(get(handles.npx,'String'),'') || strcmp(get(handles.npy,'String'),'')%update npx and npy if it is not already filled by the first input field
    1229     if  isfield(imainfo,'Width') && isfield(imainfo,'Height')
    1230         set(handles.npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box
    1231         set(handles.npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box
    1232     else
    1233         set(handles.npx,'String','');%fills nbre of pixels x box
    1234         set(handles.npy,'String','');%fills nbre of pixels x box
    1235     end
    1236     set(handles.BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image
    1237 end
    1238 
     1241if ~isempty(imainfo)% (an image has been introduced as second fierld input)
     1242    if strcmp(get(handles.npx,'String'),'') || strcmp(get(handles.npy,'String'),'')%update npx and npy if it is not already filled by the first input field
     1243        if  isfield(imainfo,'Width') && isfield(imainfo,'Height')
     1244            set(handles.npx,'String',num2str(imainfo.Width));%fills nbre of pixels x box
     1245            set(handles.npy,'String',num2str(imainfo.Height));%fills nbre of pixels x box
     1246        else
     1247            set(handles.npx,'String','');%fills nbre of pixels x box
     1248            set(handles.npy,'String','');%fills nbre of pixels x box
     1249        end
     1250        set(handles.BW,'Value',strcmp(ColorType,'grayscale'))% select handles.BW if grayscale image
     1251    end
     1252end
    12391253% find scaling parameters
    12401254filexml=[FileBase '.xml'];
     
    12471261    end
    12481262    if isfield(XmlData,'Camera')
    1249 %         if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)
    1250 %             NbSlice=XmlData.Camera.NbSlice;
    1251 %         end
    12521263        if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit)
    12531264            TimeUnit=XmlData.Camera.TimeUnit;
     
    14521463set(handles.masklevel,'String',list_index)
    14531464set(handles.masklevel,'Value',z)
    1454 
    14551465
    14561466%-------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.