Changeset 457 for trunk/src/series/ima_levels.m
- Timestamp:
- Jun 17, 2012, 10:52:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/ima_levels.m
r454 r457 1 1 %'ima_levels': rescale the image intensity to reduce strong luminosity peaks (their blinking effects often perturbs PIV)) 2 % this function can be used as a template for applying a transform (here 'levels.m') oneach image of a series2 % this function can be used as a template for applying a transform (here 'levels.m') to each image of a series 3 3 %------------------------------------------------------------------------ 4 4 % function GUI_input=ima_levels(Param) 5 5 % 6 6 %%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%% 7 % 8 % This function is used in four modes by the GUI series: 9 % 1) config GUI: with no input argument, the function determine the suitable GUI configuration 10 % 2) interactive input: the function is used to interactively introduce input parameters, and then stops 11 % 3) RUN: the function itself runs, when an appropriate input structure Param has been introduced. 12 % 4) BATCH: the function itself proceeds in BATCH mode, using an xml file 'Param' as input. 13 % 7 14 %OUTPUT 8 15 % GUI_input=list of options in the GUI series.fig needed for the function … … 50 57 end 51 58 52 %% get input parameters, file names and indices 59 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%% 60 %% select different modes, RUN, parameter input, BATCH 53 61 % BATCH case: read the xml file for batch case 54 if ischar(Param) && ~isempty(find(regexp(Param,'.xml$'))) 55 Param=xml2struct(Param); 56 checkrun=0; 57 % RUN case: parameters introduced as the input structure Param 58 else 62 if ischar(Param) 63 if strcmp(Param,'input?') 64 checkrun=1;% will inly search input parameters (preparation of BATCH mode) 65 else 66 Param=xml2struct(Param); 67 checkrun=0; 68 end 69 % RUN case: parameters introduced as the input structure Param 70 else 59 71 hseries=guidata(Param.hseries);%handles of the GUI series 60 72 WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series 61 checkrun=1; % indicate the RUN option is used 62 end 63 64 % get the set of input file names (cell array filecell), and the lists of 65 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 73 checkrun=2; % indicate the RUN option is used 74 end 66 75 67 76 %% root input file(s) and type … … 72 81 FileExt=Param.InputTable(:,5); 73 82 83 % get the set of input file names (cell array filecell), and the lists of 84 % input file or frame indices i1_series,i2_series,j1_series,j2_series 85 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 86 % filecell{iview,fileindex}: cell array representing the list of file names 87 % iview: line in the table corresponding to a given file series 88 % fileindex: file index within the file series, 89 % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j 90 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 91 % set of frame indices used for movie or multimage input 74 92 % numbers of slices and file indices 93 75 94 NbSlice=1;%default 76 95 if isfield(Param.IndexRange,'NbSlice') … … 78 97 end 79 98 nbview=numel(i1_series);%number of input file series (lines in InputTable) 80 nbfield_j=size(i1_series{1},1); %nb of consecutivefields for the j index (bursts or volume slices)81 nbfield_i=size(i1_series{1},2); %nb of consecutivefields for the i index82 nbfield=nbfield_j*nbfield_i; %total number of fi les or frames99 nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices) 100 nbfield_i=size(i1_series{1},2); %nb of fields for the i index 101 nbfield=nbfield_j*nbfield_i; %total number of fields 83 102 nbfield_i=floor(nbfield/NbSlice);%total number of indexes in a slice (adjusted to an integer number of slices) 84 103 nbfield=nbfield_i*NbSlice; %total number of fields after adjustement … … 86 105 %determine the file type on each line from the first input file 87 106 ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images) 107 88 108 [FileType{1},FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1}); 89 109 CheckImage{1}=~isempty(find(strcmp(FileType,ImageTypeOptions)));% =1 for images
Note: See TracChangeset
for help on using the changeset viewer.