Index: /trunk/src/series.m
===================================================================
--- /trunk/src/series.m	(revision 927)
+++ /trunk/src/series.m	(revision 928)
@@ -1504,5 +1504,5 @@
     end
 end
-
+ActionFullName=fullfile(get(handles.ActionPath,'String'),ActionName);
 %% If a compiled version has been selected (ext .sh) check weather it needs to be recompiled
 if strcmp(ActionExt,'.sh')
Index: /trunk/src/series/extract_rdvision.m
===================================================================
--- /trunk/src/series/extract_rdvision.m	(revision 927)
+++ /trunk/src/series/extract_rdvision.m	(revision 928)
@@ -64,5 +64,5 @@
     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='one'; ...%nbre of slices, 'one' prevents splitting in several processes, ('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)
@@ -184,10 +184,10 @@
 checkpreserve=0;% if =1, will npreserve the original images, else it erases them at the end
 for iview=1:size(Param.InputTable,1)
-    for iview_xml=1:size(Param.InputTable,1)% loojk for the xml files in the different data directories
-    filexml=[fullfile(RootPath,Param.InputTable{iview_xml,2},Param.InputTable{iview,3}) '.xml'];%new convention: xml at the level of the image folder
-    if exist(filexml,'file')
-        break
-    end
-    end 
+    for iview_xml=1:size(Param.InputTable,1)% look for the xml files in the different data directories
+        filexml=[fullfile(RootPath,Param.InputTable{iview_xml,2},Param.InputTable{iview,3}) '.xml'];%new convention: xml at the level of the image folder
+        if exist(filexml,'file')
+            break
+        end
+    end
     if ~exist(filexml,'file')
         disp_uvmat('ERROR',[filexml ' missing'],checkrun)
@@ -195,6 +195,7 @@
     end
     [XmlData,errormsg]=imadoc2struct(filexml);
-    
-    newxml=[fullfile(RootPath,Param.InputTable{iview,3}) '.xml']
+    newxml=fullfile(RootPath,Param.InputTable{iview,3});
+    newxml=regexprep(newxml,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180'
+    newxml=[newxml '.xml'];
     
     [success,errormsg] = copyfile(filexml,newxml); %copy the xml file in the upper folder
@@ -306,15 +307,13 @@
         end
     end
-    
-    % check images
-    
-%     delete(fullfile(RootPath,'Running.xml'))%delete the  xml file to indicate that processing is finished
-%     if ~checkpreserve
-%         for ibin=1:numel(BinList)
-%             delete(BinList{ibin})
-%         end
-%         rmdir(fullfile(RootPath,Param.InputTable{iview,2}))
-%     end
-end
+end
+
+%% remove binary files if transfer OK
+    if ~checkpreserve
+        for ibin=1:numel(BinList)
+            delete(BinList{ibin})
+        end
+        rmdir(fullfile(RootPath,Param.InputTable{iview,2}))
+    end
 delete(fullfile(RootPath,'Running.xml'))%delete the  xml file to indicate that processing is finished
 
@@ -352,5 +351,7 @@
 BitDepth=8*SeqData.bytesperpixel;%needed to write images (8 or 16 bits)
 binrepertoire=fullfile(PathDir,SeqData.binrepertoire);
-OutputDir=fullfile(PathDir,SeqData.sequencename);
+FileDir=SeqData.sequencename;
+FileDir=regexprep(FileDir,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180'
+OutputDir=fullfile(PathDir,FileDir);
 if ~exist(OutputDir,'dir')
     %     errormsg=[OutputDir ' already exist, delete it first'];
@@ -371,5 +372,5 @@
     end
     i1=floor((ii-1)/nbfield2)+1;
-    OutputFile=fullfile_uvmat(PathDir,SeqData.sequencename,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode
+    OutputFile=fullfile_uvmat(PathDir,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode
     fname=fullfile(binrepertoire,sprintf('%s%.5d.bin',SeqData.binfile,SqbData(ii).file_idx));
     if exist(OutputFile,'file')
Index: /trunk/src/transform_field/ima_edge_detection.m
===================================================================
--- /trunk/src/transform_field/ima_edge_detection.m	(revision 927)
+++ /trunk/src/transform_field/ima_edge_detection.m	(revision 928)
@@ -4,5 +4,5 @@
 %%%%  Use the general syntax for transform fields with a single input and parameters %%%%
 % OUTPUT: 
-% DataOut:   output field structure 
+% Data:   output field structure 
 %
 %INPUT:
@@ -29,8 +29,8 @@
 %=======================================================================
 
-function DataOut=ima_edge_detection(DataIn,Param)
+function Data=ima_edge_detection(Data,Param,Data_1)
 
 %% request input parameters
-if isfield(DataIn,'Action') && isfield(DataIn.Action,'RUN') && isequal(DataIn.Action.RUN,0)
+if isfield(Data,'Action') && isfield(Data.Action,'RUN') && isequal(Data.Action.RUN,0)
     prompt = {'npx';'npy';'threshold'};
     dlg_title = 'get the filter size in x and y';
@@ -42,12 +42,10 @@
     end
     answer = inputdlg(prompt,dlg_title,num_lines,def);
-    DataOut.TransformInput.FilterBoxSize_x=str2num(answer{1}); %size of the filtering window
-    DataOut.TransformInput.FilterBoxSize_y=str2num(answer{2}); %size of the filtering window
-    DataOut.TransformInput.LumThreshold=str2num(answer{3}); %size of the filtering window
+    Data.TransformInput.FilterBoxSize_x=str2num(answer{1}); %size of the filtering window
+    Data.TransformInput.FilterBoxSize_y=str2num(answer{2}); %size of the filtering window
+    Data.TransformInput.LumThreshold=str2num(answer{3}); %size of the filtering window
     return
 end
 
-DataOut=DataIn; %default
-%DataOut.A=255*edge(DataIn.A);
 
 %definition of the cos shape matrix filter
@@ -62,28 +60,38 @@
 Mfiltre=Mfiltre/(sum(sum(Mfiltre)));%normalize filter
 
+Afilt=filter2(Mfiltre,Data.A);% smooth the image, excluding the edges (spurious reflexions)
+
+    %Afilt=filter2(Mfiltre,Data.A(100:end-100,100:end-100));% smooth the image, excluding the edges (spurious reflexions)
+  %Data.A= double(Data.A)-Afilt;
 
 
-    Afilt=filter2(Mfiltre,DataIn.A(100:end-100,100:end-100));% smooth the image, excluding the edges (spurious reflexions)
+    
+    
+%     
     Amax=max(max(Afilt));
     Amin=min(min(Afilt));
+%     Data.A( Data_1.A(100:end-100,100:end-100)==100)=(Amin+Amax)/2;
+
+ 
+ 
     Athreshold=(Amin+Amax)*Param.TransformInput.LumThreshold;
 %     
-%     DataOut.A=zeros(size(DataIn.A,1),size(DataIn.A,2),3);
-    DataOut.A=(DataIn.A>Athreshold);%transform to the initial image format
-%     DataOut.A(:,:,1)=DataIn.A;%transform to the initial image format, red
-STATS = regionprops(DataOut.A, 'FilledArea','MinorAxisLength','MajorAxisLength','PixelIdxList');
+%     Data.A=zeros(size(Data.A,1),size(Data.A,2),3);
+    Data.A=(Data.A>Athreshold);%transform to the initial image format
+%     Data.A(:,:,1)=Data.A;%transform to the initial image format, red
+STATS = regionprops(Data.A, 'FilledArea','MinorAxisLength','MajorAxisLength','PixelIdxList');
 Area=zeros(size(STATS));
 for iobj=1:numel(STATS)
     Area(iobj)=STATS(iobj).FilledArea;
 end
-[Area, main_obj]=max(Area);
-    MajorAxisLength=STATS(main_obj).MajorAxisLength
-    MinorAxisLength=STATS(main_obj).MinorAxisLength
+[Area, main_obj]=max(Area)
+    MajorAxisLength=STATS(main_obj).MajorAxisLength;
+    MinorAxisLength=STATS(main_obj).MinorAxisLength;
 for iobj=1:numel(STATS)
     if iobj~=main_obj
-    DataOut.A(STATS(iobj).PixelIdxList)=0;
+    Data.A(STATS(iobj).PixelIdxList)=0;
     end
 end
 
-DataOut.A=Amax*DataOut.A;
+Data.A=Amax*Data.A;
  
Index: /trunk/src/transform_field/ima_patch_detection.m
===================================================================
--- /trunk/src/transform_field/ima_patch_detection.m	(revision 927)
+++ /trunk/src/transform_field/ima_patch_detection.m	(revision 928)
@@ -87,5 +87,8 @@
 DataOut=DataIn; %default
 %Amask=imread('/fsnet/project/coriolis/2015/15MINI_MEDDY/0_REF_FILES/mask_patch.png');
-plot_mask(DataIn.A,Param.TransformInput.LumThreshold)
+hfig=findobj(allchild(0),'Tag','set_threshold');
+hThreshold=findobj(hfig,'Tag','Threshold');
+Threshold=str2num(get(hThreshold,'String'));
+plot_mask(DataIn.A,Threshold)
 % Athreshold=Param.TransformInput.LumThreshold;
 % %
