Changeset 1099 for trunk


Ignore:
Timestamp:
Apr 14, 2021, 4:02:22 PM (15 months ago)
Author:
sommeria
Message:

extrtact_multitif cleaned

Location:
trunk/src
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plot_object.m

    r1098 r1099  
    245245    end
    246246end
    247 if ismember(ObjectData.Type,{'line','polyline','polygon'})
     247if ismember(ObjectData.Type,{'line','polyline','polygon'})&&...
     248        ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'})
    248249    if length(xline)<2
    249250        theta=0;
     
    357358                end
    358359            elseif length(PlotData.SubObject)==2
    359                 set(PlotData.SubObject(1),'XData',xinf);
    360                 set(PlotData.SubObject(1),'YData',yinf);
    361                 set(PlotData.SubObject(2),'XData',xsup);
    362                 set(PlotData.SubObject(2),'YData',ysup);
     360                if ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'})
     361                    set(PlotData.SubObject(1),'XData',xinf);
     362                    set(PlotData.SubObject(1),'YData',yinf);
     363                    set(PlotData.SubObject(2),'XData',xsup);
     364                    set(PlotData.SubObject(2),'YData',ysup);
     365                end
    363366            elseif length(PlotData.SubObject)==1
    364                 set(PlotData.SubObject(1),'XData',xsup);
    365                 set(PlotData.SubObject(1),'YData',ysup);
     367                if ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'})
     368                    set(PlotData.SubObject(1),'XData',xsup);
     369                    set(PlotData.SubObject(1),'YData',ysup);
     370                end
     371            end
     372            if strcmp(ObjectData.ProjMode,'none')
     373                delete(PlotData.SubObject)
     374                PlotData=rmfield(PlotData,'SubObject');
    366375            end
    367376        end
     
    398407    end
    399408    if test_patch
     409        createimage=1;
    400410        if isfield(PlotData,'SubObject')
    401         for iobj=1:length(PlotData.SubObject)
    402             if ~ishandle(PlotData.SubObject(iobj))
    403                 hold on
    404                 hhh=image([xlim(1)+dx/2 xlim(2)-dx/2],[ylim(1)+dy/2 ylim(2)-dy/2],imflag,'Tag','proj_object','HitTest','off');
    405                 set(hhh,'AlphaData',(flag)*0.2)% set partial transparency to the filling color
    406                 PlotData.SubObject(iobj)=hhh;
    407             else
     411            for iobj=1:length(PlotData.SubObject)
    408412                objtype=get(PlotData.SubObject(iobj),'Type');
    409413                if isequal(objtype,'image')
     
    411415                    set(PlotData.SubObject(iobj),'XData',[xlim(1)+dx/2 xlim(2)-dx/2])
    412416                    set(PlotData.SubObject(iobj),'YData',[ylim(1)+dy/2 ylim(2)-dy/2])
    413                 end
    414             end
    415         end
     417                    createimage=0;
     418                end
     419            end
     420        end
     421        if createimage
     422            hold on
     423            hhh=image([xlim(1)+dx/2 xlim(2)-dx/2],[ylim(1)+dy/2 ylim(2)-dy/2],imflag,'Tag','proj_object','HitTest','off');
     424            set(hhh,'AlphaData',(flag)*0.2)% set partial transparency to the filling color
     425            PlotData.SubObject(1)=hhh;
    416426        end
    417427    else% no patch image requested, erase existing ones
     
    420430                if ishandle(PlotData.SubObject(iobj)) && strcmp(get(PlotData.SubObject(iobj),'Type'),'image')
    421431                    delete(PlotData.SubObject(iobj))
     432                    PlotData=rmfield(PlotData,SubObject(iobj));
    422433                end
    423434            end
     
    462473        case {'line','polyline','polygon'}
    463474            hh=line(xline,yline,'Color',col);
     475            if ismember(ObjectData.ProjMode,{'projection','interp_lin','interp_tps'})
    464476                PlotData.SubObject(1)=line(xinf,yinf,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');%draw sub-lines
    465477                PlotData.SubObject(2)=line(xsup,ysup,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');
     478            end
    466479                for ipt=1:sizcoord(1)
    467480                    PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',...
     
    496509    end
    497510end
     511%put the deformpoints to the front
     512            listc=get(gca,'children');
     513            checkdeform=strcmp(get(listc,'tag'),'DeformPoint');
     514            [nn,Index]=sort(checkdeform,'descend');
     515            set(gca,'children',listc(Index))
    498516set(hh,'UserData',PlotData)
  • trunk/src/series/extract_multitif.m

    r1093 r1099  
    1 %'ima2netcdf': read image series and transform to netcdf
     1%'extract_multitif': read image series from PCO cameras (tiff image series) and write .png images
    22%------------------------------------------------------------------------
    3 
    43   
    5 % function ParamOut=ima2netcdf(Param)
     4% function ParamOut=extract_multitif(Param)
    65%
    76%%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    5958%=======================================================================
    6059
    61 function ParamOut=extract_multitif_parallel(Param)
     60function ParamOut=extract_multitif(Param)
    6261
    6362%%%%%%%%%%%%%%%%%    INPUT PREPARATION MODE (no RUN)    %%%%%%%%%%%%%%%%%
     
    7473    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    7574    ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)
    76     ParamOut.CPUTime=7;% expected time for writting one image ( in minute)
     75    ParamOut.CPUTime=10;% expected time for writting the output of one source image ( in minute)
    7776    %% root input file(s) and type
    7877    % check the existence of the first file in the series
     
    126125ImagesPerLevel=size(XmlInput.Time,2)-1;%100;%use the xmlinformation to get the nbre of j indices
    127126
    128 %% create the xml file of PCO camera if it does not exist
    129 Newxml=fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']);
    130 if ~exist(Newxml,'file')
    131 XmlInput.Camera.CameraName='PCO';
    132 XmlInput=rmfield(XmlInput,'Time');
    133 XmlInput=rmfield(XmlInput,'TimeUnit');
    134 t=struct2xml(XmlInput);
    135 t=set(t,1,'name','ImaDoc');
    136 save(t,Newxml);
     127%% create the xml file for timing if it does not exist : example to adapt
     128TEST=0;
     129if TEST
     130    count0=14;
     131    Dtj=0.05;% time interval between frames
     132    ImagesPerLevel=455;% total number of images per position, ImagesPerLevel-Nbj images skiiped during motion between two positions
     133    Nbj=390; %Nbre of images kept at a given position
     134    Dti=Dtj*ImagesPerLevel;
     135    NbLevel=11;
     136    NbScan=3;
     137    TimeReturn=268.5; %time needed to return back to the first position (in sec)
     138    NbReturn=round(TimeReturn/Dtj);
     139    NbSkipReturn=NbReturn+1-NbLevel*ImagesPerLevel;
     140   
     141    Newxml=fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']);
     142    if ~exist(Newxml,'file')
     143        XmlInput.Camera.CameraName='PCO';
     144        XmlInput.Camera.TimeUnit='s';
     145        XmlInput.Camera.BurstTiming.FrameFrequency=1;
     146        XmlInput.Camera.BurstTiming.Time=0;% for 200
     147        XmlInput.Camera.BurstTiming.Dtj=Dtj;
     148        XmlInput.Camera.BurstTiming.NbDtj=Nbj-1;
     149        XmlInput.Camera.BurstTiming.Dti=Dti;
     150        XmlInput.Camera.BurstTiming.NbDti=NbLevel-1;
     151        XmlInput.Camera.BurstTiming.Dtk=TimeReturn;
     152        XmlInput.Camera.BurstTiming.NbDtk=NbScan-1;
     153        t=struct2xml(XmlInput);
     154        t=set(t,1,'name','ImaDoc');
     155        save(t,Newxml);
     156    end
    137157end
    138158
Note: See TracChangeset for help on using the changeset viewer.