Index: /trunk/src/get_file_info.m
===================================================================
--- /trunk/src/get_file_info.m	(revision 990)
+++ /trunk/src/get_file_info.m	(revision 991)
@@ -53,4 +53,7 @@
     case {'.seq','.sqb'}
         [A,FileInfo,timestamps,errormsg]=read_rdvision(fileinput,[]);
+%         %%%%%
+%         FileInfo.NumberOfFrame=24000;
+%         %%%%%%%%
     case '.h5'
         hinfo=hdf5info(fileinput);
@@ -66,4 +69,5 @@
         FileInfo.Height=BitmapInfoHeader.biHeight;
         FileInfo.Width=BitmapInfoHeader.biWidth;
+         FileInfo.BitDepth=BitmapInfoHeader.biBitCount;
     otherwise
         if ~isempty(FileExt)% exclude empty extension
Index: /trunk/src/read_cine_phantom.m
===================================================================
--- /trunk/src/read_cine_phantom.m	(revision 990)
+++ /trunk/src/read_cine_phantom.m	(revision 991)
@@ -22,26 +22,27 @@
     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
@@ -50,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/read_rdvision.m
===================================================================
--- /trunk/src/read_rdvision.m	(revision 990)
+++ /trunk/src/read_rdvision.m	(revision 991)
@@ -18,18 +18,18 @@
 
 function [A,FileInfo,timestamps,errormsg]=read_rdvision(filename,frame_idx)
-% BINREAD_RDV Permet de lire les fichiers bin gï¿œnï¿œrï¿œs par Hiris ï¿œ partir du
-% fichier seq associï¿œ.
+% BINREAD_RDV Permet de lire les fichiers bin g???n???r???s par Hiris ??? partir du
+% fichier seq associ???.
 %   [IMGS,TIMESTAMPS,NB_FRAMES] = BINREAD_RDV(FILENAME,FRAME_IDX) lit
-%   l'image d'indice FRAME_IDX de la sï¿œquence FILENAME.
-%
-%   Entrï¿œes
+%   l'image d'indice FRAME_IDX de la s???quence FILENAME.
+%
+%   Entr???es
 %   -------
-%   FILENAME  : Nom du fichier sï¿œquence (.seq).
-%   FRAME_IDX : Indice de l'image ï¿œ lire. Si FRAME_IDX vaut -1 alors la
-%   sï¿œquence est entiï¿œrement lue. Si FRAME_IDX est un tableau d'indices
+%   FILENAME  : Nom du fichier s???quence (.seq).
+%   FRAME_IDX : Indice de l'image ??? lire. Si FRAME_IDX vaut -1 alors la
+%   s???quence est enti???rement lue. Si FRAME_IDX est un tableau d'indices
 %   alors toutes les images d'incides correspondant sont lues. Si FRAME_IDX
 %   est un tableau vide alors aucune image n'est lue mais le nombre
-%   d'images et tous les timestamps sont renvoyï¿œs. Les indices commencent ï¿œ
-%   1 et se termines ï¿œ NB_FRAMES.
+%   d'images et tous les timestamps sont renvoy???s. Les indices commencent ???
+%   1 et se termines ??? NB_FRAMES.
 %
 %   Sorties
@@ -37,5 +37,5 @@
 %   IMGS        : Images de sortie.
 %   TIMESTAMPS  : Timestaps des images lues.
-%   NB_FRAMES   : Nombres d'images dans la sï¿œquence.
+%   NB_FRAMES   : Nombres d'images dans la s???quence.
 
 errormsg='';
@@ -119,7 +119,8 @@
             binrepertoire=regexprep(binrepertoire,'\','/');
             [tild,binrepertoire,DirExt]=fileparts(binrepertoire);
-            binrepertoire=[binrepertoire DirExt];
+            binrepertoire=[binrepertoire DirExt];     
         end 
       %  binrepertoire='2014-07-04T10.48.46'% case FJORD5a %%%%%%%%%%%%%%%%%%%%%%%%%
+       binrepertoire='2017-01-19T22.12.182'% EXP14 %%%%%%%%%%%%%%%%%%%%%%%%%
         binfile=fullfile(RootPath,binrepertoire,sprintf('%s%.5d.bin',bin_file,data(ii).file_idx));
         fid=fopen(binfile,'rb');
Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 990)
+++ /trunk/src/series.m	(revision 991)
@@ -626,11 +626,6 @@
         RootFile='';
     else %scan the input folder
-        if strcmp(InputTable{iview,4},'level')
-            [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=...
-                find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2},'level0'),[InputTable{iview,3} '0' InputTable{iview,5}]);
-        else
             [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=...
                 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
-        end
     end
     % if no file is found, open a browser
@@ -654,4 +649,5 @@
 set(handles.MinIndex_j,'Data',MinIndex_j_table(1:nbview,:));
 MaxIndex_i_table=get(handles.MaxIndex_i,'Data');%retrieve the min indices in the table MinIndex
+
 set(handles.MaxIndex_i,'Data',MaxIndex_i_table(1:nbview,:));
 MaxIndex_j_table=get(handles.MaxIndex_j,'Data');%retrieve the min indices in the table MinIndex
@@ -2081,6 +2077,6 @@
 
      case 'cluster_sge' % for PSMN
-        % Au PSMN, on ne crÃ©e pas 1 job avec plusieurs cÅurs, mais N jobs de 1 cÅurs
-        % oÃ¹ N < 1000.
+        % Au PSMN, on ne cr??e pas 1 job avec plusieurs c??urs, mais N jobs de 1 c??urs
+        % o?? N < 1000.
         %create subdirectory for pbs command and log files
 
@@ -3737,5 +3733,7 @@
 % --- Executes on button press in MonitorCluster.
 function MonitorCluster_Callback(hObject, eventdata, handles)
-web('https://www.legi.grenoble-inp.fr/servfill/monika')
+disp('format: R/W=run/wait, time lapsed, R=nbre of cores,W=walltime')
+system('oarstat |grep N=UVmat')% check the list of jobs launched with uvmat
+
 
 function OutputSubDir_Callback(hObject, eventdata, handles)
Index: /trunk/src/series/extract_multitif_parallel.m
===================================================================
--- /trunk/src/series/extract_multitif_parallel.m	(revision 990)
+++ /trunk/src/series/extract_multitif_parallel.m	(revision 991)
@@ -59,5 +59,5 @@
 %=======================================================================
 
-function ParamOut=ima2netcdf(Param)
+function ParamOut=extract_multitif_parallel(Param)
 
 %%%%%%%%%%%%%%%%%    INPUT PREPARATION MODE (no RUN)    %%%%%%%%%%%%%%%%%
@@ -143,4 +143,10 @@
 XmlInput=imadoc2struct(XmlInputFile,'Camera');
 
+%% 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},[Param.InputTable{1,2} '.xml']))
+
 %% Main loop
 
Index: /trunk/src/series/extract_rdvision.m
===================================================================
--- /trunk/src/series/extract_rdvision.m	(revision 990)
+++ /trunk/src/series/extract_rdvision.m	(revision 991)
@@ -64,22 +64,22 @@
 if isstruct(Param) && isequal(Param.Action.RUN,0)
     ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
-    ParamOut.WholeIndexRange='on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
-    ParamOut.NbSlice=1; ...%nbre of slices, 1 prevents splitting in several processes, ('off' by default)
-    ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
-    ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
-    ParamOut.FieldTransform = 'off';...%can use a transform function
-    ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on',
-    ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
-     ParamOut.OutputDirExt='.extract';%set the output dir extension
+        ParamOut.WholeIndexRange='on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
+        ParamOut.NbSlice=1; ...%nbre of slices, 1 prevents splitting in several processes, ('off' by default)
+        ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
+        ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
+        ParamOut.FieldTransform = 'off';...%can use a transform function
+        ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on',
+        ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
+        ParamOut.OutputDirExt='.extract';%set the output dir extension
     ParamOut.OutputSubDirMode='one'; %output folder given by the folder name of the first input line
-     % detect the set of image folder
+    % detect the set of image folder
     RootPath=Param.InputTable{1,1};
-    ListStruct=dir(RootPath);   
+    ListStruct=dir(RootPath);
     ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
     check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it
     check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
     ListDir=ListCells(1,find(check_dir & ~check_bad));
-%     InputTable=cell(numel(ListDir),5);
-%     InputTable(:,2)=ListDir';
+    %     InputTable=cell(numel(ListDir),5);
+    %     InputTable(:,2)=ListDir';
     isel=0;
     InputTable=Param.InputTable;
@@ -90,14 +90,14 @@
         seq_index=find(~cellfun('isempty',detect_seq),1);
         if ~isempty(seq_index)
-%             msgbox_uvmat('ERROR',['not seq file in ' ListDir{ilist} ': please check the input folders'])
-%         else
-           isel=isel+1;
-           InputTable{isel,1}=RootPath;
-           InputTable{isel,2}=ListDir{ilist};
+            %             msgbox_uvmat('ERROR',['not seq file in ' ListDir{ilist} ': please check the input folders'])
+            %         else
+            isel=isel+1;
+            InputTable{isel,1}=RootPath;
+            InputTable{isel,2}=ListDir{ilist};
             RootFile=regexprep(ListCellSub{1,seq_index},'.seq$','');
             InputTable{isel,3}=RootFile;
-        InputTable{isel,4}='*';
-        InputTable{isel,5}='.seq';
-    end
+            InputTable{isel,4}='*';
+            InputTable{isel,5}='.seq';
+        end
     end
     hseries=findobj(allchild(0),'Tag','series');% find the parent GUI 'series'
@@ -105,5 +105,5 @@
     set(hhseries.InputTable,'Data',InputTable)
     ParamOut.ActionInput.LogPath=RootPath;% indicate the path for the output info: 0_LOG ....
-return
+    return
 end
 
@@ -239,6 +239,6 @@
         SeqData.binrepertoire=regexprep(s.sequenceSettings.bindirectory,'\\$','');%tranform Windows notation to Linux
         SeqData.binrepertoire=regexprep(SeqData.binrepertoire,'\','/');
-        [tild,binrepertoire,DirExt]=fileparts(SeqData.binrepertoire);
-        SeqData.binrepertoire=[SeqData.binrepertoire DirExt];
+        [tild,SeqData.binrepertoire,DirExt]=fileparts(SeqData.binrepertoire);
+        %SeqData.binrepertoire=[SeqData.binrepertoire DirExt];
     end
    
@@ -253,17 +253,18 @@
     
     %%%%%%%BRICOLAGE in case of unreadable .sqb file: remplace lecture du fichier
-    %         ind=[111 114:211];%indices of bin files
-    %         w=1024;%w=width of images in pixels
-    %         h=1024;%h=height of images in pixels
-    %         bpp=2;% nbre of bytes per pixel
-    %         lengthimage=w*h*bpp;% lengthof an image record on the binary file
-    %         nbimages=32; %nbre of images of each camera in a bin file
-    %         for ii=1:32*numel(ind)
-    %             data(ii).offset=mod(ii-1,32)*2*lengthimage+lengthimage;%Dalsa_2
-    %             %data(ii).offset=mod(ii-1,32)*2*lengthimage;%Dalsa_1
-    %             data(ii).file_idx=ind(ceil(ii/32));
-    %             data(ii).timestamp=0.2*(ii-1);
-    %         end
-    %         m.Data=data;
+%             ind=[8356 8356:8672];%indices of bin files
+%             w=2432;%w=width of images in pixels
+%             h=864;%h=height of images in pixels
+%             bpp=2;% nbre of bytes per pixel
+%             lengthimage=w*h*bpp;% lengthof an image record on the binary file
+%             nbimages=15; %nbre of images of each camera in a bin file
+%             for ii=1:15*numel(ind)
+%                 %data(ii).offset=mod(ii-1,32)*2*lengthimage+lengthimage;%Dalsa_2
+%                 %data(ii).offset=mod(ii-1,32)*2*lengthimage;%Dalsa_1
+%                 %data(ii).file_idx=ind(ceil(ii/32));
+%                 data(ii).file_idx=ind(ceil(ii/15));
+%                 data(ii).timestamp=0.005*(ii-1);
+%             end
+%             m.Data=data;
     %%%%%%%
     timestamp=zeros(1,numel(m.Data));
@@ -281,4 +282,8 @@
     if ~isempty(errormsg)
         disp(errormsg)
+        return
+    end
+    if ~isequal(size(XmlData.Time(2:end,2:end)),size(reshape(timestamp(1:end),nbfield2,[])'))
+        disp(['size of record ' num2str(size(XmlData.Time(2:end,2:end))) ' does not fit with timestamp size ' num2str(size(reshape(timestamp(1:end),nbfield2,[])'))])
         return
     end
@@ -327,6 +332,6 @@
         for iview=1:size(Param.InputTable,1)
          fullfile(RootPath,Param.InputTable{iview,2})
-
-        [SUCCESS,MESSAGE]=rmdir(fullfile(RootPath,Param.InputTable{iview,2}),'s')
+         source_dir=fullfile(RootPath,Param.InputTable{iview,2});
+        [SUCCESS,MESSAGE]=rmdir(source_dir,'s')
         end
     end
@@ -368,4 +373,11 @@
 classname=['*' classname];
 BitDepth=8*SeqData.bytesperpixel;%needed to write images (8 or 16 bits)
+%%%%
+% SeqData.binrepertoire='2017-01-26T11.59.57';
+%SeqData.binrepertoire='2017-01-26T16.57.27';
+%SeqData.binrepertoire='2017-01-26T19.28.05';
+%SeqData.binrepertoire='2017-01-27T09.51.34';
+%SeqData.binrepertoire='2017-01-27T14.21.47'
+%%%%
 binrepertoire=fullfile(PathDir,SeqData.binrepertoire);
 FileDir=SeqData.sequencename;
Index: /trunk/src/transform_field/ima_crop.m
===================================================================
--- /trunk/src/transform_field/ima_crop.m	(revision 991)
+++ /trunk/src/transform_field/ima_crop.m	(revision 991)
@@ -0,0 +1,53 @@
+% 'ima_crop': removes an upper and lower band to the image
+
+%------------------------------------------------------------------------
+%%%%  Use the general syntax for transform fields with a single input and parameters %%%%
+% OUTPUT: 
+% DataOut:   output field structure 
+%
+%INPUT:
+% DataIn:  input field structure
+% Param: matlab structure whose field Param.TransformInput contains the filter parameters
+%-----------------------------------
+
+%=======================================================================
+% Copyright 2008-2017, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
+%   http://www.legi.grenoble-inp.fr
+%   Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr
+%
+%     This file is part of the toolbox UVMAT.
+%
+%     UVMAT is free software; you can redistribute it and/or modify
+%     it under the terms of the GNU General Public License as published
+%     by the Free Software Foundation; either version 2 of the license,
+%     or (at your option) any later version.
+%
+%     UVMAT is distributed in the hope that it will be useful,
+%     but WITHOUT ANY WARRANTY; without even the implied warranty of
+%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+%     GNU General Public License (see LICENSE.txt) for more details.
+%=======================================================================
+
+function DataOut=ima_crop(DataIn,Param)
+
+%% request input parameters
+if isfield(DataIn,'Action') && isfield(DataIn.Action,'RUN') && isequal(DataIn.Action.RUN,0)
+    prompt = {'npy_upper';'npy_lower'};
+    dlg_title = 'remove image lines above and below';
+    num_lines= 2;
+    def     = { '0';'0'};
+    if isfield(Param,'TransformInput')&&isfield(Param.TransformInput,'CropUpper')&&...
+            isfield(Param.TransformInput,'CropLower')
+        def={num2str(Param.TransformInput.CropUpper);num2str(Param.TransformInput.CropLower)};
+    end
+    answer = inputdlg(prompt,dlg_title,num_lines,def);
+    DataOut.TransformInput.CropUpper=str2num(answer{1}); %size of the filtering window
+    DataOut.TransformInput.CropLower=str2num(answer{2}); %size of the filtering window
+    return
+end
+
+DataOut=DataIn; %default
+
+DataOut.A(1:Param.TransformInput.CropUpper,:)=[];
+DataOut.A(end-Param.TransformInput.CropLower+1:end,:)=[];
+ 
