Index: trunk/src/plot_field.m
===================================================================
--- trunk/src/plot_field.m	(revision 1174)
+++ trunk/src/plot_field.m	(revision 1175)
@@ -409,5 +409,9 @@
 
 %% prepare the string for plot command
+if isfield(PlotParam,'Type')&& strcmp(PlotParam.Type,'semilogx')
+   plotstr='hhh=semilogx(';
+else
 plotstr='hhh=plot(';
+end
 xtitle='';
 ytitle='';
Index: trunk/src/series/civ_series.m
===================================================================
--- trunk/src/series/civ_series.m	(revision 1174)
+++ trunk/src/series/civ_series.m	(revision 1175)
@@ -51,4 +51,7 @@
 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed
 if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
+    if 0==1 %never satisfied but trigger compilation with the appropriate transform functions ('eval' inactive for compilation)
+        ima_rescale
+    end
     path_series=fileparts(which('series'));
     addpath(fullfile(path_series,'series'))
@@ -66,5 +69,5 @@
     Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     Data.FieldName='on';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
-    Data.FieldTransform = 'off';%can use a transform function
+    Data.FieldTransform = 'on';%can use a transform function
     Data.ProjObject='off';%can use projection object(option 'off'/'on',
     Data.Mask='off';%can use mask option   (option 'off'/'on', 'off' by default)
@@ -99,5 +102,5 @@
 % CheckOutputFile=isfield(Param,'OutputSubDir');%= 1 in test use for TestPatch (no nc file produced)
 
-%% input files and indexing (skipped in Test mode)
+%% input files and indexing 
 hseries=findobj(allchild(0),'Tag','series');
 RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
@@ -112,5 +115,4 @@
 if isfield(Param,'InputTable')
     [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
-    %         iview_A=0;% series index (iview) for the first image series
     iview_B=0;% series index (iview) for the second image series (only non zero for option 'shift' comparing two image series )
     if Param.ActionInput.CheckCiv1
@@ -119,5 +121,4 @@
         iview_A=2;% the second line is used for the input images
     end
-    %         if iview_A~=0
     RootPath_A=Param.InputTable{iview_A,1};
     RootFile_A=Param.InputTable{iview_A,3};
@@ -253,5 +254,12 @@
     end
 end
-% end
+
+%% introduce input image transform
+if isfield(Param,'FieldTransform')&&~isempty(Param.FieldTransform.TransformName)
+        addpath(Param.FieldTransform.TransformPath)
+    transform_fct=str2func(Param.FieldTransform.TransformName);
+    rmpath(Param.FieldTransform.TransformPath)
+end
+
 
 %%%%% MAIN LOOP %%%%%%
@@ -276,16 +284,6 @@
         end
     end
-    %     %     if CheckInputFile
-    %     if CheckOutputFile
     OutputPath=fullfile(Param.OutputPath,Param.Experiment,Param.Device);
-    %         if iview_A==0 % no nc file has been entered
-    %             ncfile=fullfile_uvmat(OutputPath,Param.InputTable{1,2},Param.InputTable{1,3},Param.InputTable{1,5},...
-    %                 NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),j1_series_Civ1(ifield),j2_series_Civ1(ifield));
-    %         else% an existing nc file has been entered
-    %             if iview_A==1% if Civ1 is performed
-    %                 Civ1Dir=OutputDir;
-    %             else
-    %                 Civ1Dir=Param.InputTable{1,2};
-    %             end
+
     if strcmp(Param.ActionInput.ListCompareMode,'PIV')
         ncfile=fullfile_uvmat(OutputPath,OutputDir,RootFile_A,'.nc',NomTypeNc,i1_series_Civ1(ifield),i2_series_Civ1(ifield),...
@@ -295,5 +293,4 @@
             j1_series_Civ1(ifield),j2_series_Civ1(ifield));
     end
-    %         end
     ncfile_out=ncfile;% by default
     
@@ -380,4 +377,5 @@
             end
             [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B_Civ1(ifield));
+            
         catch ME % display errors in reading input images
             if ~isempty(ME.message)
@@ -385,4 +383,8 @@
                 continue
             end
+        end
+        %% user defined image transform
+        if ~isempty(transform_fct)
+               par_civ1 =transform_fct(par_civ1,Param);
         end
         
@@ -597,4 +599,10 @@
             par_civ2.Grid(:,2)=reshape(GridY,[],1);% increases with array index
         end
+        
+                %% user defined image transform
+        if ~isempty(transform_fct)
+               par_civ2 =transform_fct(par_civ2,Param);
+        end
+        
         
         % get the guess from patch1 or patch2 (case 'CheckCiv3')
Index: trunk/src/series/sub_background.m
===================================================================
--- trunk/src/series/sub_background.m	(revision 1174)
+++ trunk/src/series/sub_background.m	(revision 1175)
@@ -151,6 +151,4 @@
     end
     BrightnessRankThreshold=0.1;
-   % CheckSubmedian='No';
-%     SaturationCoeff=0;
     if isfield(Param,'ActionInput')
         if isfield(Param.ActionInput,'CheckVolume') && Param.ActionInput.CheckVolume
Index: trunk/src/transform_field/ima_rescale.m
===================================================================
--- trunk/src/transform_field/ima_rescale.m	(revision 1175)
+++ trunk/src/transform_field/ima_rescale.m	(revision 1175)
@@ -0,0 +1,56 @@
+% 'ima_green': take the gree component of a color image
+%------------------------------------------------------------------------
+%%%%  Use the general syntax for transform fields with a single input %%%%
+% OUTPUT: 
+% DataOut:   output field structure 
+%
+%INPUT:
+% DataIn:  first input field structure
+
+%=======================================================================
+% Copyright 2008-2024, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
+%   http://www.legi.grenoble-inp.fr
+%   Joel.Sommeria - Joel.Sommeria (A) univ-grenoble-alpes.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_rescale(DataIn,Param)
+
+%% request input parameters
+if isfield(DataIn,'Action') && isfield(DataIn.Action,'RUN') && isequal(DataIn.Action.RUN,0)
+    prompt = {'SaturationValue'};
+    dlg_title = 'get the maximum image value';
+    num_lines= 1;
+    def     = { '1024'};
+    if isfield(Param,'TransformInput')&&isfield(Param.TransformInput,'SaturationValue')
+        def={num2str(Param.TransformInput.SaturationValue)};
+    end
+    answer = inputdlg(prompt,dlg_title,num_lines,def);
+    DataOut.TransformInput.SaturationValue=str2num(answer{1}); %size of the filtering window
+    return
+end
+
+Coeff=Param.TransformInput.SaturationValue;
+DataOut=DataIn; %default
+if isfield(DataOut,'A')
+    DataOut.A=uint16(Coeff*tanh(double(DataOut.A)/Coeff));
+end
+if isfield(DataOut,'ImageA')
+    DataOut.ImageA=uint16(Coeff*tanh(double(DataOut.ImageA)/Coeff));
+end
+if isfield(DataOut,'ImageB')
+    DataOut.ImageB=uint16(Coeff*tanh(double(DataOut.ImageB)/Coeff));
+end
+
+ 
Index: trunk/src/uvmat.m
===================================================================
--- trunk/src/uvmat.m	(revision 1174)
+++ trunk/src/uvmat.m	(revision 1175)
@@ -4019,4 +4019,5 @@
     set(handles.Histogram,'Visible','off')
     set(handles.HistoMenu,'Visible','off')
+    set(handles.LogLinHisto,'Visible','off')
     set(handles.HistoAxes,'Visible','off')
     hlegend=findobj(handles.uvmat,'Tag','HistoLegend');
@@ -4265,4 +4266,5 @@
         set(handles.Histogram,'Visible','on')
         set(handles.HistoMenu,'Visible','on')
+        set(handles.LogLinHisto,'Visible','on')
         set(handles.HistoAxes,'Visible','on')
         HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram
@@ -4383,7 +4385,12 @@
                 C=reshape(double(B),1,nxy(1)*nxy(2));% reshape in a vector
                 Histo.histo(:,col)=hist(C, Histo.(FieldName));  %calculate histogram
-            end
-        end
-        plot_field(Histo,handles.HistoAxes);
+                if isequal(get(handles.LogLinHisto,'Value'),2)
+                    PlotParam.Type='semilogx';
+                else
+                    PlotParam.Type='plot';
+                end
+            end
+        end
+        plot_field(Histo,handles.HistoAxes,PlotParam);
         hlegend=findobj(handles.uvmat,'Tag','HistoLegend');
         if isempty(hlegend)
@@ -6180,2 +6187,15 @@
 
 
+
+
+% --- Executes on selection change in LogLinHisto.
+function LogLinHisto_Callback(hObject, eventdata, handles)
+    HistoMenu_Callback(hObject, eventdata, handles)
+% hObject    handle to LogLinHisto (see GCBO)
+% eventdata  reserved - to be defined in a future version of MATLAB
+% handles    structure with handles and user data (see GUIDATA)
+
+% Hints: contents = cellstr(get(hObject,'String')) returns LogLinHisto contents as cell array
+%        contents{get(hObject,'Value')} returns selected item from LogLinHisto
+
+
