Changeset 991 for trunk/src


Ignore:
Timestamp:
Feb 2, 2017, 1:25:44 PM (7 years ago)
Author:
sommeria
Message:

various

Location:
trunk/src
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_file_info.m

    r979 r991  
    5353    case {'.seq','.sqb'}
    5454        [A,FileInfo,timestamps,errormsg]=read_rdvision(fileinput,[]);
     55%         %%%%%
     56%         FileInfo.NumberOfFrame=24000;
     57%         %%%%%%%%
    5558    case '.h5'
    5659        hinfo=hdf5info(fileinput);
     
    6669        FileInfo.Height=BitmapInfoHeader.biHeight;
    6770        FileInfo.Width=BitmapInfoHeader.biWidth;
     71         FileInfo.BitDepth=BitmapInfoHeader.biBitCount;
    6872    otherwise
    6973        if ~isempty(FileExt)% exclude empty extension
  • trunk/src/read_cine_phantom.m

    r980 r991  
    2222    fseek(fid, imageLocations( frames(ii) ), 'bof');
    2323    if ~BitmapInfoHeader.biCompression
     24%         [A,count]=fread(fid, 10000)
    2425        imTemp = fread(fid, [BitmapInfoHeader.biWidth BitmapInfoHeader.biHeight],'uint16');
    2526        imMat(:,:,ii) = imTemp';
    2627    else
    27     imTemp = fread(fid, [BitmapInfoHeader.biWidth BitmapInfoHeader.biHeight], 'ubit10','b');
    28     im = imTemp';
    29     im( im < 1 ) = 1;
    30     im =reshape( interp1( 1:1024, lookupTable, im(:) ), BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth);
    31     im( im < CameraSetup.BlackLevel ) = CameraSetup.BlackLevel;
    32     im( im > 4064 )=4064;
    33     imMat(:,:,ii) = reshape(interp1( CameraSetup.BlackLevel:4064, linspace(0,4095,4064 - CameraSetup.BlackLevel+1), im(:)),...
    34         BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth);
    35    
    36     if mod( round(0.01*Nf), ii)
    37        if ~exist('dispStr', 'var')
    38            dispStr = ' ';
    39            disp( dispStr )
    40        end
    41        
    42      lenDispStr = length( dispStr );
    43      dispStr = ['Reading is ' num2str( round( 100*ii/Nf ) ) '% complete'];
    44      disp( [char(8)*ones(1,lenDispStr+1) dispStr] )
    45     end
     28        imTemp = fread(fid, [BitmapInfoHeader.biWidth BitmapInfoHeader.biHeight], 'ubit10','b');
     29        im = imTemp';
     30        im( im < 1 ) = 1;
     31        im =reshape( interp1( 1:1024, lookupTable, im(:) ), BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth);
     32        im( im < CameraSetup.BlackLevel ) = CameraSetup.BlackLevel;
     33        im( im > 4064 )=4064;
     34        imMat(:,:,ii) = reshape(interp1( CameraSetup.BlackLevel:4064, linspace(0,4095,4064 - CameraSetup.BlackLevel+1), im(:)),...
     35            BitmapInfoHeader.biHeight, BitmapInfoHeader.biWidth);
     36       
     37        if mod( round(0.01*Nf), ii)
     38            if ~exist('dispStr', 'var')
     39                dispStr = ' ';
     40                disp( dispStr )
     41            end
     42            
     43            lenDispStr = length( dispStr );
     44            dispStr = ['Reading is ' num2str( round( 100*ii/Nf ) ) '% complete'];
     45            disp( [char(8)*ones(1,lenDispStr+1) dispStr] )
     46        end
    4647    end
    4748end
     
    5051end
    5152
    52 function lookupTable = lookupTablePackedFun() 
     53function lookupTable = lookupTablePackedFun()
    5354% function to transform the compressed 10 bit images back, close to the 12 bit camera images
    5455lookupTable = [ 2,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15,  16,  17,  17,  18,...
  • trunk/src/read_rdvision.m

    r977 r991  
    1818
    1919function [A,FileInfo,timestamps,errormsg]=read_rdvision(filename,frame_idx)
    20 % BINREAD_RDV Permet de lire les fichiers bin gï¿œnï¿œrï¿œs par Hiris ï¿œ partir du
    21 % fichier seq associï¿œ.
     20% BINREAD_RDV Permet de lire les fichiers bin g???n???r???s par Hiris ??? partir du
     21% fichier seq associ???.
    2222%   [IMGS,TIMESTAMPS,NB_FRAMES] = BINREAD_RDV(FILENAME,FRAME_IDX) lit
    23 %   l'image d'indice FRAME_IDX de la sï¿œquence FILENAME.
    24 %
    25 %   Entrï¿œes
     23%   l'image d'indice FRAME_IDX de la s???quence FILENAME.
     24%
     25%   Entr???es
    2626%   -------
    27 %   FILENAME  : Nom du fichier sï¿œquence (.seq).
    28 %   FRAME_IDX : Indice de l'image ï¿œ lire. Si FRAME_IDX vaut -1 alors la
    29 %   sï¿œquence est entiï¿œrement lue. Si FRAME_IDX est un tableau d'indices
     27%   FILENAME  : Nom du fichier s???quence (.seq).
     28%   FRAME_IDX : Indice de l'image ??? lire. Si FRAME_IDX vaut -1 alors la
     29%   s???quence est enti???rement lue. Si FRAME_IDX est un tableau d'indices
    3030%   alors toutes les images d'incides correspondant sont lues. Si FRAME_IDX
    3131%   est un tableau vide alors aucune image n'est lue mais le nombre
    32 %   d'images et tous les timestamps sont renvoyï¿œs. Les indices commencent ï¿œ
    33 %   1 et se termines ï¿œ NB_FRAMES.
     32%   d'images et tous les timestamps sont renvoy???s. Les indices commencent ???
     33%   1 et se termines ??? NB_FRAMES.
    3434%
    3535%   Sorties
     
    3737%   IMGS        : Images de sortie.
    3838%   TIMESTAMPS  : Timestaps des images lues.
    39 %   NB_FRAMES   : Nombres d'images dans la sï¿œquence.
     39%   NB_FRAMES   : Nombres d'images dans la s???quence.
    4040
    4141errormsg='';
     
    119119            binrepertoire=regexprep(binrepertoire,'\','/');
    120120            [tild,binrepertoire,DirExt]=fileparts(binrepertoire);
    121             binrepertoire=[binrepertoire DirExt];
     121            binrepertoire=[binrepertoire DirExt];     
    122122        end
    123123      %  binrepertoire='2014-07-04T10.48.46'% case FJORD5a %%%%%%%%%%%%%%%%%%%%%%%%%
     124       binrepertoire='2017-01-19T22.12.182'% EXP14 %%%%%%%%%%%%%%%%%%%%%%%%%
    124125        binfile=fullfile(RootPath,binrepertoire,sprintf('%s%.5d.bin',bin_file,data(ii).file_idx));
    125126        fid=fopen(binfile,'rb');
  • trunk/src/series.m

    r989 r991  
    626626        RootFile='';
    627627    else %scan the input folder
    628         if strcmp(InputTable{iview,4},'level')
    629             [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=...
    630                 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2},'level0'),[InputTable{iview,3} '0' InputTable{iview,5}]);
    631         else
    632628            [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=...
    633629                find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
    634         end
    635630    end
    636631    % if no file is found, open a browser
     
    654649set(handles.MinIndex_j,'Data',MinIndex_j_table(1:nbview,:));
    655650MaxIndex_i_table=get(handles.MaxIndex_i,'Data');%retrieve the min indices in the table MinIndex
     651
    656652set(handles.MaxIndex_i,'Data',MaxIndex_i_table(1:nbview,:));
    657653MaxIndex_j_table=get(handles.MaxIndex_j,'Data');%retrieve the min indices in the table MinIndex
     
    20812077
    20822078     case 'cluster_sge' % for PSMN
    2083         % Au PSMN, on ne crée pas 1 job avec plusieurs cœurs, mais N jobs de 1 cœurs
    2084         % où N < 1000.
     2079        % Au PSMN, on ne cr??e pas 1 job avec plusieurs c??urs, mais N jobs de 1 c??urs
     2080        % o?? N < 1000.
    20852081        %create subdirectory for pbs command and log files
    20862082
     
    37373733% --- Executes on button press in MonitorCluster.
    37383734function MonitorCluster_Callback(hObject, eventdata, handles)
    3739 web('https://www.legi.grenoble-inp.fr/servfill/monika')
     3735disp('format: R/W=run/wait, time lapsed, R=nbre of cores,W=walltime')
     3736system('oarstat |grep N=UVmat')% check the list of jobs launched with uvmat
     3737
    37403738
    37413739function OutputSubDir_Callback(hObject, eventdata, handles)
  • trunk/src/series/extract_multitif_parallel.m

    r977 r991  
    5959%=======================================================================
    6060
    61 function ParamOut=ima2netcdf(Param)
     61function ParamOut=extract_multitif_parallel(Param)
    6262
    6363%%%%%%%%%%%%%%%%%    INPUT PREPARATION MODE (no RUN)    %%%%%%%%%%%%%%%%%
     
    143143XmlInput=imadoc2struct(XmlInputFile,'Camera');
    144144
     145%% create the xml file of PCO camera
     146XmlInput.Camera.CameraName='PCO';
     147t=struct2xml(XmlInput.Camera);
     148t=set(t,1,'name','ImaDoc');
     149save(t,fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']))
     150
    145151%% Main loop
    146152
  • trunk/src/series/extract_rdvision.m

    r982 r991  
    6464if isstruct(Param) && isequal(Param.Action.RUN,0)
    6565    ParamOut.AllowInputSort='off';...% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    66     ParamOut.WholeIndexRange='on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    67     ParamOut.NbSlice=1; ...%nbre of slices, 1 prevents splitting in several processes, ('off' by default)
    68     ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
    69     ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
    70     ParamOut.FieldTransform = 'off';...%can use a transform function
    71     ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on',
    72     ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
    73      ParamOut.OutputDirExt='.extract';%set the output dir extension
     66        ParamOut.WholeIndexRange='on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     67        ParamOut.NbSlice=1; ...%nbre of slices, 1 prevents splitting in several processes, ('off' by default)
     68        ParamOut.VelType='off';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     69        ParamOut.FieldName='off';...% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)
     70        ParamOut.FieldTransform = 'off';...%can use a transform function
     71        ParamOut.ProjObject='off';...%can use projection object(option 'off'/'on',
     72        ParamOut.Mask='off';...%can use mask option   (option 'off'/'on', 'off' by default)
     73        ParamOut.OutputDirExt='.extract';%set the output dir extension
    7474    ParamOut.OutputSubDirMode='one'; %output folder given by the folder name of the first input line
    75      % detect the set of image folder
     75    % detect the set of image folder
    7676    RootPath=Param.InputTable{1,1};
    77     ListStruct=dir(RootPath);   
     77    ListStruct=dir(RootPath);
    7878    ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray
    7979    check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it
    8080    check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
    8181    ListDir=ListCells(1,find(check_dir & ~check_bad));
    82 %     InputTable=cell(numel(ListDir),5);
    83 %     InputTable(:,2)=ListDir';
     82    %     InputTable=cell(numel(ListDir),5);
     83    %     InputTable(:,2)=ListDir';
    8484    isel=0;
    8585    InputTable=Param.InputTable;
     
    9090        seq_index=find(~cellfun('isempty',detect_seq),1);
    9191        if ~isempty(seq_index)
    92 %             msgbox_uvmat('ERROR',['not seq file in ' ListDir{ilist} ': please check the input folders'])
    93 %         else
    94            isel=isel+1;
    95            InputTable{isel,1}=RootPath;
    96            InputTable{isel,2}=ListDir{ilist};
     92            %             msgbox_uvmat('ERROR',['not seq file in ' ListDir{ilist} ': please check the input folders'])
     93            %         else
     94            isel=isel+1;
     95            InputTable{isel,1}=RootPath;
     96            InputTable{isel,2}=ListDir{ilist};
    9797            RootFile=regexprep(ListCellSub{1,seq_index},'.seq$','');
    9898            InputTable{isel,3}=RootFile;
    99         InputTable{isel,4}='*';
    100         InputTable{isel,5}='.seq';
    101     end
     99            InputTable{isel,4}='*';
     100            InputTable{isel,5}='.seq';
     101        end
    102102    end
    103103    hseries=findobj(allchild(0),'Tag','series');% find the parent GUI 'series'
     
    105105    set(hhseries.InputTable,'Data',InputTable)
    106106    ParamOut.ActionInput.LogPath=RootPath;% indicate the path for the output info: 0_LOG ....
    107 return
     107    return
    108108end
    109109
     
    239239        SeqData.binrepertoire=regexprep(s.sequenceSettings.bindirectory,'\\$','');%tranform Windows notation to Linux
    240240        SeqData.binrepertoire=regexprep(SeqData.binrepertoire,'\','/');
    241         [tild,binrepertoire,DirExt]=fileparts(SeqData.binrepertoire);
    242         SeqData.binrepertoire=[SeqData.binrepertoire DirExt];
     241        [tild,SeqData.binrepertoire,DirExt]=fileparts(SeqData.binrepertoire);
     242        %SeqData.binrepertoire=[SeqData.binrepertoire DirExt];
    243243    end
    244244   
     
    253253   
    254254    %%%%%%%BRICOLAGE in case of unreadable .sqb file: remplace lecture du fichier
    255     %         ind=[111 114:211];%indices of bin files
    256     %         w=1024;%w=width of images in pixels
    257     %         h=1024;%h=height of images in pixels
    258     %         bpp=2;% nbre of bytes per pixel
    259     %         lengthimage=w*h*bpp;% lengthof an image record on the binary file
    260     %         nbimages=32; %nbre of images of each camera in a bin file
    261     %         for ii=1:32*numel(ind)
    262     %             data(ii).offset=mod(ii-1,32)*2*lengthimage+lengthimage;%Dalsa_2
    263     %             %data(ii).offset=mod(ii-1,32)*2*lengthimage;%Dalsa_1
    264     %             data(ii).file_idx=ind(ceil(ii/32));
    265     %             data(ii).timestamp=0.2*(ii-1);
    266     %         end
    267     %         m.Data=data;
     255%             ind=[8356 8356:8672];%indices of bin files
     256%             w=2432;%w=width of images in pixels
     257%             h=864;%h=height of images in pixels
     258%             bpp=2;% nbre of bytes per pixel
     259%             lengthimage=w*h*bpp;% lengthof an image record on the binary file
     260%             nbimages=15; %nbre of images of each camera in a bin file
     261%             for ii=1:15*numel(ind)
     262%                 %data(ii).offset=mod(ii-1,32)*2*lengthimage+lengthimage;%Dalsa_2
     263%                 %data(ii).offset=mod(ii-1,32)*2*lengthimage;%Dalsa_1
     264%                 %data(ii).file_idx=ind(ceil(ii/32));
     265%                 data(ii).file_idx=ind(ceil(ii/15));
     266%                 data(ii).timestamp=0.005*(ii-1);
     267%             end
     268%             m.Data=data;
    268269    %%%%%%%
    269270    timestamp=zeros(1,numel(m.Data));
     
    281282    if ~isempty(errormsg)
    282283        disp(errormsg)
     284        return
     285    end
     286    if ~isequal(size(XmlData.Time(2:end,2:end)),size(reshape(timestamp(1:end),nbfield2,[])'))
     287        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,[])'))])
    283288        return
    284289    end
     
    327332        for iview=1:size(Param.InputTable,1)
    328333         fullfile(RootPath,Param.InputTable{iview,2})
    329 
    330         [SUCCESS,MESSAGE]=rmdir(fullfile(RootPath,Param.InputTable{iview,2}),'s')
     334         source_dir=fullfile(RootPath,Param.InputTable{iview,2});
     335        [SUCCESS,MESSAGE]=rmdir(source_dir,'s')
    331336        end
    332337    end
     
    368373classname=['*' classname];
    369374BitDepth=8*SeqData.bytesperpixel;%needed to write images (8 or 16 bits)
     375%%%%
     376% SeqData.binrepertoire='2017-01-26T11.59.57';
     377%SeqData.binrepertoire='2017-01-26T16.57.27';
     378%SeqData.binrepertoire='2017-01-26T19.28.05';
     379%SeqData.binrepertoire='2017-01-27T09.51.34';
     380%SeqData.binrepertoire='2017-01-27T14.21.47'
     381%%%%
    370382binrepertoire=fullfile(PathDir,SeqData.binrepertoire);
    371383FileDir=SeqData.sequencename;
Note: See TracChangeset for help on using the changeset viewer.