Index: /trunk/src/create_grid.m
===================================================================
--- /trunk/src/create_grid.m	(revision 992)
+++ /trunk/src/create_grid.m	(revision 993)
@@ -30,5 +30,5 @@
 function varargout = create_grid(varargin)
 
-% Last Modified by GUIDE v2.5 16-Dec-2010 00:17:20
+% Last Modified by GUIDE v2.5 02-Feb-2017 17:09:08
 
 % Begin initialization code - DO NOT EDIT
@@ -169,4 +169,8 @@
     varargout{2}=T;
     varargout{3}=get(handles.white,'Value');
+    varargout{4}=0;
+    if get(handles.CheckDots,'Value')
+    varargout{4}=str2num(get(handles.FilterWindow,'String'));
+    end
 end
 
@@ -220,5 +224,4 @@
 end    
 
-
 % --- Executes on button press in white.
 function white_Callback(hObject, eventdata, handles)
@@ -229,9 +232,4 @@
     set(handles.black,'Value',1)
 end
-% hObject    handle to white (see GCBO)
-% eventdata  reserved - to be defined in a future version of MATLAB
-% handles    structure with handles and user data (see GUIDATA)
-
-% Hint: get(hObject,'Value') returns toggle state of white
 
 
@@ -245,2 +243,13 @@
 end
 
+% --- Executes on button press in CheckDots.
+function CheckDots_Callback(hObject, eventdata, handles)
+val=get(handles.CheckDots,'Value');
+if val
+    set(handles.FilterWindow,'Visible','on')
+    set(handles.FilterWindow_txt,'Visible','on')
+else
+    set(handles.FilterWindow,'Visible','off')
+     set(handles.FilterWindow_txt,'Visible','off')
+end
+
Index: /trunk/src/geometry_calib.m
===================================================================
--- /trunk/src/geometry_calib.m	(revision 992)
+++ /trunk/src/geometry_calib.m	(revision 993)
@@ -856,5 +856,5 @@
     grid_input=CalibData.grid;%retrieve the previously used grid
 end
-[T,CalibData.grid,CalibData.grid.CheckWhite]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T
+[T,CalibData.grid,CalibData.grid.CheckWhite,CalibData.grid.FilterWindow]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T
 set(handles.geometry_calib,'UserData',CalibData)%store the phys grid parameters for later use
 X=[CalibData.grid.x_0 CalibData.grid.x_1 CalibData.grid.x_0 CalibData.grid.x_1]';%corner absissa in the phys coordinates (cm)
@@ -907,4 +907,28 @@
     Amod=-double(Amod);%case of black grid markers: will look for image minima
 end
+
+%%%%%%filterfor i;proved detection of dots
+if ~isequal(CalibData.grid.FilterWindow,0)
+    %definition of the cos shape matrix filter
+    FilterBoxSize_x=CalibData.grid.FilterWindow;
+    FilterBoxSize_y=CalibData.grid.FilterWindow;
+    ix=1/2-FilterBoxSize_x/2:-1/2+FilterBoxSize_x/2;%
+    iy=1/2-FilterBoxSize_y/2:-1/2+FilterBoxSize_y/2;%
+    %del=np/3;
+    %fct=exp(-(ix/del).^2);
+    fct2_x=cos(ix/((FilterBoxSize_x-1)/2)*pi/2);
+    fct2_y=cos(iy/((FilterBoxSize_y-1)/2)*pi/2);
+    %Mfiltre=(ones(5,5)/5^2);
+    Mfiltre=fct2_y'*fct2_x;
+    Mfiltre=Mfiltre/(sum(sum(Mfiltre)));%normalize filter
+    
+    if ndims(Amod)==3
+        Amod=filter2(Mfiltre,sum(Amod,3));%filter the input image, after summation on the color component (for color images)
+    else
+        Amod=filter2(Mfiltre,Amod);
+    end
+end
+%%%%%%%%%%%%%%
+
 
 %% detection of local image extrema in each direction
Index: /trunk/src/get_file_info.m
===================================================================
--- /trunk/src/get_file_info.m	(revision 992)
+++ /trunk/src/get_file_info.m	(revision 993)
@@ -146,5 +146,5 @@
 end
 switch FileInfo.FileType
-    case {'image','multimage','mmreader','video','netcdf','civdata'}
+    case {'image','multimage','mmreader','cine_phantom','video','netcdf','civdata'}
         FileInfo.FileIndexing='on'; % allow to detect file index for scanning series
 end
Index: /trunk/src/readCineHeader.m
===================================================================
--- /trunk/src/readCineHeader.m	(revision 992)
+++ /trunk/src/readCineHeader.m	(revision 993)
@@ -1,3 +1,3 @@
-function [CineFileHeader, BitmapInfoHeader, CameraSetup, imageLocations,  annotationSize] = readCineHeader(filePath)
+function [CineFileHeader, BitmapInfoHeader, CameraSetup, TimeOnlyBlock, ExposureOnlyBlock, TimeCodeBlock, imageLocations,  annotationSize] = readCineHeader(filePath)
 
 fid = fopen(filePath);
@@ -28,4 +28,13 @@
 BitmapInfoHeader.biClrUsed = fread(fid, 1, 'uint32');
 BitmapInfoHeader.biClrImportant = fread(fid, 1, 'uint32');
+
+fseek(fid, hex2dec('00E2'), 'bof');
+CameraSetup.Length = fread(fid, 1, 'uint16');
+
+fseek(fid, hex2dec('0370'), 'bof');
+CameraSetup.FirmwareVersion = fread(fid, 1, 'uint32');
+
+fseek(fid, hex2dec('0374'), 'bof');
+CameraSetup.SoftwareVersion = fread(fid, 1, 'uint32');
 
 fseek(fid, hex2dec('0354'), 'bof');
@@ -60,13 +69,55 @@
 
 
+%% Tagged Information Blocks
+% AnalogDigitalSignals (ADS) -> not contained in MIRO cine-files
+% ImageTimeTaggedBlock (ITTB) -> not contained in MIRO cine-files
+
+% TimeOnlyBlock (TOB) -> Type should be 1002
+PositionTOB = CineFileHeader.OffSetup + CameraSetup.Length;
+fseek(fid, PositionTOB , 'bof');
+TimeOnlyBlock.Length = fread(fid, 1, 'uint32');
+TimeOnlyBlock.Type = fread(fid, 1, 'uint16');
+TimeOnlyBlock.Reserved = fread(fid, 1, 'uint16');
+TimeOnlyBlock.Data = transpose([1:CineFileHeader.ImageCount ; fread(fid,[2,CineFileHeader.ImageCount], 'uint32')]); % Framenumber combined with Data contained in TOB
+TimeOnlyBlock.TimestampsDatetime = datetime(TimeOnlyBlock.Data(:,3), 'ConvertFrom', 'posixtime');  % Timestamp as Datetime
+% TimeOnlyBlock.TimestampsDatestr = datestr(TimeOnlyBlock.TimestampsDatetime);  % Timestamp as String
+TimeOnlyBlock.TimestampsMillisec = TimeOnlyBlock.Data(:,2)./(2^32);    % Milliseconds of the Timestamp
+TimeOnlyBlock.ExposureTimeDelays = [0 ; TimeOnlyBlock.TimestampsMillisec(2:end)-TimeOnlyBlock.TimestampsMillisec(1:end-1)]; % Timedifference between two frames. First frame is set to have no timedifference
+
+% ExposureOnlyBlock (EOB) -> Type should be 1003
+PositionEOB = PositionTOB + TimeOnlyBlock.Length;
+fseek(fid, PositionEOB , 'bof');
+ExposureOnlyBlock.Length = fread(fid, 1, 'uint32');
+ExposureOnlyBlock.Type = fread(fid, 1, 'uint16');
+ExposureOnlyBlock.Reserved = fread(fid, 1, 'uint16');
+ExposureOnlyBlock.Data = fread(fid,CineFileHeader.ImageCount, 'uint32');
+ExposureOnlyBlock.ExposureTimesMillisec = ExposureOnlyBlock.Data ./(2^32) .*1000;
+ExposureOnlyBlock.test1 = fread(fid, 1, 'uint32');
+ExposureOnlyBlock.test2 = fread(fid, 1, 'uint16');
+ExposureOnlyBlock.test3 = fread(fid, 1, 'uint16');
+
+% RangeDataBlock (RDB) -> not contained in MIRO cine-files
+% BinSigBlock (BSB) -> not contained in MIRO cine-files
+% AnaSigBlock (ASB) -> not contained in MIRO cine-files
+
+% TimeCodeBlock (TCB)  -> Type should be 1007
+PositionTCB = PositionEOB + ExposureOnlyBlock.Length;
+fseek(fid, PositionTCB , 'bof');
+TimeCodeBlock.Length = fread(fid, 1, 'uint32');
+TimeCodeBlock.Type = fread(fid, 1, 'uint16');
+TimeCodeBlock.Reserved = fread(fid, 1, 'uint16');
+TimeCodeBlock.Data = fread(fid, 1, 'uint8');
+
+
+%% Image Locations and their Annotations
 fseek(fid, CineFileHeader.OffImageOffsets, 'bof');
 imageBlockLocations = fread(fid, CineFileHeader.ImageCount, 'int64');
-
 
 fseek(fid, imageBlockLocations(1), 'bof');
 annotationSize = fread(fid, 1, 'uint32');
 
-
 imageLocations = imageBlockLocations + annotationSize;
 
+
+%%
 fclose(fid);
Index: /trunk/src/read_cine_phantom.m
===================================================================
--- /trunk/src/read_cine_phantom.m	(revision 992)
+++ /trunk/src/read_cine_phantom.m	(revision 993)
@@ -3,5 +3,6 @@
 
 
-[CineFileHeader, BitmapInfoHeader, CameraSetup, imageLocations] = readCineHeader(cineFilePath);
+% [CineFileHeader, BitmapInfoHeader, CameraSetup, imageLocations] = readCineHeader(cineFilePath);       % old
+[CineFileHeader, BitmapInfoHeader, CameraSetup, TimeOnlyBlock, ExposureOnlyBlock, TimeCodeBlock, imageLocations] = readCineHeader(cineFilePath);
 fid = fopen(cineFilePath);
 lookupTable = lookupTablePackedFun;
@@ -22,27 +23,26 @@
     fseek(fid, imageLocations( frames(ii) ), 'bof');
     if ~BitmapInfoHeader.biCompression
-%         [A,count]=fread(fid, 10000)
         imTemp = fread(fid, [BitmapInfoHeader.biWidth BitmapInfoHeader.biHeight],'uint16');
         imMat(:,:,ii) = imTemp';
     else
-        imTemp = fread(fid, [BitmapInfoHeader.biWidth BitmapInfoHeader.biHeight], 'ubit10','b');
-        im = imTemp';
-        im( im < 1 ) = 1;
-        im =reshape( interp1( 1:1024, lookupTable, im(:) ), BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth);
-        im( im < CameraSetup.BlackLevel ) = CameraSetup.BlackLevel;
-        im( im > 4064 )=4064;
-        imMat(:,:,ii) = reshape(interp1( CameraSetup.BlackLevel:4064, linspace(0,4095,4064 - CameraSetup.BlackLevel+1), im(:)),...
-            BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth);
-        
-        if mod( round(0.01*Nf), ii)
-            if ~exist('dispStr', 'var')
-                dispStr = ' ';
-                disp( dispStr )
-            end
-            
-            lenDispStr = length( dispStr );
-            dispStr = ['Reading is ' num2str( round( 100*ii/Nf ) ) '% complete'];
-            disp( [char(8)*ones(1,lenDispStr+1) dispStr] )
-        end
+    imTemp = fread(fid, [BitmapInfoHeader.biWidth BitmapInfoHeader.biHeight], 'ubit10','b');
+    im = imTemp';
+    im( im < 1 ) = 1;
+    im =reshape( interp1( 1:1024, lookupTable, im(:) ), BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth);
+    im( im < CameraSetup.BlackLevel ) = CameraSetup.BlackLevel;
+    im( im > 4064 )=4064;
+    imMat(:,:,ii) = reshape(interp1( CameraSetup.BlackLevel:4064, linspace(0,4095,4064 - CameraSetup.BlackLevel+1), im(:)),...
+        BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth); 
+    
+    if mod( round(0.01*Nf), ii)
+       if ~exist('dispStr', 'var')
+           dispStr = ' ';
+           disp( dispStr )
+       end
+       
+     lenDispStr = length( dispStr );
+     dispStr = ['Reading is ' num2str( round( 100*ii/Nf ) ) '% complete'];
+     disp( [char(8)*ones(1,lenDispStr+1) dispStr] )
+    end
     end
 end
@@ -51,5 +51,5 @@
 end
 
-function lookupTable = lookupTablePackedFun()
+function lookupTable = lookupTablePackedFun() 
 % function to transform the compressed 10 bit images back, close to the 12 bit camera images
 lookupTable = [ 2,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  17,  18,...
Index: /trunk/src/series.xml.default
===================================================================
--- /trunk/src/series.xml.default	(revision 993)
+++ /trunk/src/series.xml.default	(revision 993)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<SeriesParam>
+<ClusterParam>
+<Name>cluster_oar</Name>!-- Cluster name to be displayed in the menu 
+<CheckString>s=system('oarstat')</CheckString>!-- Matlab command for detecting the cluster
+<NbCoreDefault>16</NbCoreDefault>!-- proposed number of cores by default
+</ClusterParam>
+<ClusterParam>
+<Name>cluster_pbs</Name>!-- Cluster name to be displayed in the menu 
+</ClusterParam>
+<ClusterParam>
+<Name>cluster_sge</Name>!-- Cluster name to be displayed in the menu 
+CheckString>[s,w]=system('oarstat')</CheckString>
+</ClusterParam>
+</SeriesParam>
Index: /trunk/src/series/civ2vel_3C.m
===================================================================
--- /trunk/src/series/civ2vel_3C.m	(revision 992)
+++ /trunk/src/series/civ2vel_3C.m	(revision 993)
@@ -358,29 +358,41 @@
         end
     end
-    %remove wrong vector
-    temp=find(Data{1}.FF==0);
-    X1=Data{1}.X(temp);
-    Y1=Data{1}.Y(temp);
-    U1=Data{1}.U(temp);
-    V1=Data{1}.V(temp);
-    
+    %remove wrong vector  
+    if isfield(Data{1},'FF')
+        temp=find(Data{1}.FF==0);
+        X1=Data{1}.X(temp);
+        Y1=Data{1}.Y(temp);
+        U1=Data{1}.U(temp);
+        V1=Data{1}.V(temp);
+    else
+        X1=Data{1}.X;
+        Y1=Data{1}.Y;
+        U1=Data{1}.U;
+        V1=Data{1}.V;
+    end
     Ua=griddata(X1,Y1,U1,Xa,Ya);
     Va=griddata(X1,Y1,V1,Xa,Ya);
-    
-    [Ua,Va,Xa,Ya]=Ud2U(XmlData{1}.GeometryCalib,Xa,Ya,Ua,Va); % convert Xd data to X 
+    [Ua,Va,Xa,Ya]=Ud2U(XmlData{1}.GeometryCalib,Xa,Ya,Ua,Va); % convert Xd data to X
     [A]=get_coeff(XmlData{1}.GeometryCalib,Xa,Ya,XI,YI,ZI); %get coef A~
     
-    %remove wrong vector
-    temp=find(Data{2}.FF==0);
-    X2=Data{2}.X(temp);
-    Y2=Data{2}.Y(temp);
-    U2=Data{2}.U(temp);
-    V2=Data{2}.V(temp);
+    %remove wrong vector  
+    if isfield(Data{1},'FF')
+        temp=find(Data{2}.FF==0);
+        X2=Data{2}.X(temp);
+        Y2=Data{2}.Y(temp);
+        U2=Data{2}.U(temp);
+        V2=Data{2}.V(temp);
+    else
+        X2=Data{2}.X;
+        Y2=Data{2}.Y;
+        U2=Data{2}.U;
+        V2=Data{2}.V;
+    end
     Ub=griddata(X2,Y2,U2,Xb,Yb);
     Vb=griddata(X2,Y2,V2,Xb,Yb);
-
-    [Ub,Vb,Xb,Yb]=Ud2U(XmlData{2}.GeometryCalib,Xb,Yb,Ub,Vb); % convert Xd data to X 
+    [Ub,Vb,Xb,Yb]=Ud2U(XmlData{2}.GeometryCalib,Xb,Yb,Ub,Vb); % convert Xd data to X
+    
     [B]=get_coeff(XmlData{2}.GeometryCalib,Xb,Yb,XI,YI,ZI); %get coef B~
-   
+    
     
     % System to solve
Index: /trunk/src/series/civ_series.m
===================================================================
--- /trunk/src/series/civ_series.m	(revision 992)
+++ /trunk/src/series/civ_series.m	(revision 993)
@@ -60,7 +60,7 @@
     Data.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     Data.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
-    if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices')&& strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')
-        Data.Desable_j_index='on';% hide the j index in series (set by the pair choice in civ_input)
-    end
+    %     if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices')&& strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')
+    %         Data.Desable_j_index='on';% hide the j index in series (set by the pair choice in civ_input)
+    %     end
     Data.NbSlice='off'; %nbre of slices ('off' by default)
     Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
@@ -73,4 +73,22 @@
     Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar)
     Data.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
+    if isequal(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')
+        if isfield(Data.ActionInput.PairIndices,'ListPairCiv2')
+            str_civ=Data.ActionInput.PairIndices.ListPairCiv2;
+        else
+            str_civ=Data.ActionInput.PairIndices.ListPairCiv1;
+        end
+        r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names');
+        if isempty(r)
+            r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names');
+            if isempty(r)
+                r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names');
+            end
+        end
+        if ~isempty(r)
+            Data.j_index_1=stra2num(r.num1);
+            Data.j_index_2=stra2num(r.num2);
+        end
+    end
     return
 end
@@ -200,5 +218,5 @@
         end
         if isempty(i1_series_Civ1)||(~isempty(PairCiv2) && isempty(i1_series_Civ2))
-            disp_uvmat('ERROR','no image pair fo civ in the input file index range',checkrun)
+            disp_uvmat('ERROR','no image pair for civ in the input file index range',checkrun)
             return
         end
@@ -208,8 +226,14 @@
     try
         if Param.ActionInput.CheckCiv1% Civ1 is performed
+            first_ima=1;
             ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1),[],j1_series_Civ1(1));
-            if ~exist(ImageName_A,'file')
+            if checkrun 
+                if ~exist(ImageName_A,'file')
                 disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun)
                 return
+                end
+            else
+%                 for ifile=1:numel(i1_series_Civ1)
+%                     if 
             end
             [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A);
@@ -412,5 +436,5 @@
                 if ~isempty(ME.message)
                     disp_uvmat('ERROR', ['error reading input image: ' ME.message],checkrun)
-                    return
+                    continue
                 end
             end
@@ -1155,5 +1179,5 @@
 [npy,npx]=size(result_conv);
 result_conv(result_conv<1)=1; %set to 1 correlation values smaller than 1  (=0 by discretisation, to avoid divergence in the log)
-%the following 8 lines are copyright (c) 1998, Uri Shavit, Roi Gurka, Alex Liberzon, Technion ï¿œ Israel Institute of Technology
+%the following 8 lines are copyright (c) 1998, Uri Shavit, Roi Gurka, Alex Liberzon, Technion ??? Israel Institute of Technology
 %http://urapiv.wordpress.com
 peaky = y;
@@ -1192,9 +1216,9 @@
         for j=-1:1
             %following 15 lines based on
-            %H. Nobach ï¿œ M. Honkanen (2005)
+            %H. Nobach ??? M. Honkanen (2005)
             %Two-dimensional Gaussian regression for sub-pixel displacement
             %estimation in particle image velocimetry or particle position
             %estimation in particle tracking velocimetry
-            %Experiments in Fluids (2005) 38: 511ï¿œ515
+            %Experiments in Fluids (2005) 38: 511???515
             c10(j+2,i+2)=i*log(result_conv(y+j, x+i));
             c01(j+2,i+2)=j*log(result_conv(y+j, x+i));
Index: /trunk/src/series/extract_multitif_parallel.m
===================================================================
--- /trunk/src/series/extract_multitif_parallel.m	(revision 992)
+++ /trunk/src/series/extract_multitif_parallel.m	(revision 993)
@@ -95,8 +95,5 @@
         return
     end
-    xmlinput=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml');
-    [tild,ParamOut.ActionInput.XmlFile]=fileparts(xmlinput);
-    ParamOut.ActionInput.XmlFile
-    
+    ParamOut.ActionInput.XmlFile=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml');  
     return
 end
@@ -140,33 +137,34 @@
 
 %% Timing
-XmlInputFile=fullfile(Param.InputTable{1,1},[Param.ActionInput.XmlFile '.xml'])
-XmlInput=imadoc2struct(XmlInputFile,'Camera');
-
-%% create the xml file of PCO camera
+XmlInputFile=Param.ActionInput.XmlFile;
+[XmlInput,errormsg]=imadoc2struct(XmlInputFile,'Camera');
+if ~isempty(errormsg)
+    disp(['bad xml input file: ' errormsg])
+    return
+end
+ImagesPerLevel=size(XmlInput.Time,2)-1;%100;%use the xmlinformation to get the nbre of j indices
+
+%% create the xml file of PCO camera if it does not exist
+Newxml=fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']);
+if ~exist(Newxml,'file')
 XmlInput.Camera.CameraName='PCO';
-t=struct2xml(XmlInput.Camera);
+XmlInput=rmfield(XmlInput,'Time');
+XmlInput=rmfield(XmlInput,'TimeUnit');
+t=struct2xml(XmlInput);
 t=set(t,1,'name','ImaDoc');
-save(t,fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']))
+save(t,Newxml);
+end
 
 %% Main loop
 
-ImagesPerLevel=size(XmlInput.Time,2)-1;%100;
+
 % count=0;
 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1
 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images
 %% loop on the files
-%for ifile=1:numel(ListFile)
-%     update_waitbar(WaitbarHandle,ifile/numel(ListFile))
-%     if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
-%         disp('program stopped by user')
-%         break
-%     end
-%    ImageName=fullfile(DirImages,ListFile{ifile});
-%   NbFrames=numel(imfinfo(ImageName));
-% loop on the frames within the tiff file
+% include the first tiff file with no index in the first iteration
 if Param.IndexRange.first_i==1% first slice of processing
     firstindex=0;
    count=0;
-%     count=3;
 else
     firstindex=Param.IndexRange.first_i;
@@ -174,9 +172,8 @@
     NbFrames=numel(imfinfo(ImageName));
    count=Param.IndexRange.first_i*NbFrames;
- %   count=Param.IndexRange.first_i*NbFrames+3;
 end
 for ifile=firstindex:Param.IndexRange.last_i
     if firstindex==0 && ifile==0% first slice of processing
-            ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif')
+        ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif')
     else
         ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},['im@' num2str(ifile,'%04d') '.tif'])
@@ -202,41 +199,5 @@
     end
 end
-    %end
-
-% for ifile=1:numel(ListFile)
-%     update_waitbar(WaitbarHandle,ifile/numel(ListFile))
-%     if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue')
-%         disp('program stopped by user')
-%         break
-%     end
-%     ImageName=fullfile(DirImages,ListFile{ifile});
-%     NbFrames=numel(imfinfo(ImageName));
-%     % loop on the frames within the tiff file
-%     for iframe=1:NbFrames      
-%         A=imread(ImageName,iframe);
-% 
-%         if isequal(ImagesPerLevel,1)% mode series 
-%             i_index=count+1;
-%             OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']);
-%         else % indices i and j 
-%             i_index=fix(count/ImagesPerLevel)+1;
-%             j_index=mod(count,ImagesPerLevel)+1;
-%             OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']);
-%         end
-%         imwrite(A,OutputFile,'BitDepth',16)
-%         count=count+1;
-%     end
-% end
-
-%% create the xml file of PCO camera
-% XmlInput.Camera.CameraName='PCO';
-% t=struct2xml(XmlInput.Camera);
-% t=set(t,1,'name','ImaDoc');
-% save(t,fullfile(Param.InputTable{1,1},'PCO.xml'))
-
-%% remove initial files if transfer OK
-%     if i_index== (size(XmlInput.Time,1)-1)
-% 
-%         [SUCCESS,MESSAGE]=rmdir(DirImages,'s')
-%        
-%     end
+
+
+
