- Timestamp:
- Feb 2, 2017, 1:25:44 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/get_file_info.m
r979 r991 53 53 case {'.seq','.sqb'} 54 54 [A,FileInfo,timestamps,errormsg]=read_rdvision(fileinput,[]); 55 % %%%%% 56 % FileInfo.NumberOfFrame=24000; 57 % %%%%%%%% 55 58 case '.h5' 56 59 hinfo=hdf5info(fileinput); … … 66 69 FileInfo.Height=BitmapInfoHeader.biHeight; 67 70 FileInfo.Width=BitmapInfoHeader.biWidth; 71 FileInfo.BitDepth=BitmapInfoHeader.biBitCount; 68 72 otherwise 69 73 if ~isempty(FileExt)% exclude empty extension -
trunk/src/read_cine_phantom.m
r980 r991 22 22 fseek(fid, imageLocations( frames(ii) ), 'bof'); 23 23 if ~BitmapInfoHeader.biCompression 24 % [A,count]=fread(fid, 10000) 24 25 imTemp = fread(fid, [BitmapInfoHeader.biWidth BitmapInfoHeader.biHeight],'uint16'); 25 26 imMat(:,:,ii) = imTemp'; 26 27 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 end41 42 lenDispStr = length( dispStr );43 dispStr = ['Reading is ' num2str( round( 100*ii/Nf ) ) '% complete'];44 disp( [char(8)*ones(1,lenDispStr+1) dispStr] )45 end28 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 46 47 end 47 48 end … … 50 51 end 51 52 52 function lookupTable = lookupTablePackedFun() 53 function lookupTable = lookupTablePackedFun() 53 54 % function to transform the compressed 10 bit images back, close to the 12 bit camera images 54 55 lookupTable = [ 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18,... -
trunk/src/read_rdvision.m
r977 r991 18 18 19 19 function [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 du21 % fichier seq associ ï¿œ.20 % BINREAD_RDV Permet de lire les fichiers bin g???n???r???s par Hiris ??? partir du 21 % fichier seq associ???. 22 22 % [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 ï¿œes23 % l'image d'indice FRAME_IDX de la s???quence FILENAME. 24 % 25 % Entr???es 26 26 % ------- 27 % FILENAME : Nom du fichier s ï¿œquence (.seq).28 % FRAME_IDX : Indice de l'image ï¿œlire. Si FRAME_IDX vaut -1 alors la29 % s ï¿œquence est entiï¿œrement lue. Si FRAME_IDX est un tableau d'indices27 % 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 30 30 % alors toutes les images d'incides correspondant sont lues. Si FRAME_IDX 31 31 % 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. 34 34 % 35 35 % Sorties … … 37 37 % IMGS : Images de sortie. 38 38 % 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. 40 40 41 41 errormsg=''; … … 119 119 binrepertoire=regexprep(binrepertoire,'\','/'); 120 120 [tild,binrepertoire,DirExt]=fileparts(binrepertoire); 121 binrepertoire=[binrepertoire DirExt]; 121 binrepertoire=[binrepertoire DirExt]; 122 122 end 123 123 % binrepertoire='2014-07-04T10.48.46'% case FJORD5a %%%%%%%%%%%%%%%%%%%%%%%%% 124 binrepertoire='2017-01-19T22.12.182'% EXP14 %%%%%%%%%%%%%%%%%%%%%%%%% 124 125 binfile=fullfile(RootPath,binrepertoire,sprintf('%s%.5d.bin',bin_file,data(ii).file_idx)); 125 126 fid=fopen(binfile,'rb'); -
trunk/src/series.m
r989 r991 626 626 RootFile=''; 627 627 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 else632 628 [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileInfo,MovieObject]=... 633 629 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]); 634 end635 630 end 636 631 % if no file is found, open a browser … … 654 649 set(handles.MinIndex_j,'Data',MinIndex_j_table(1:nbview,:)); 655 650 MaxIndex_i_table=get(handles.MaxIndex_i,'Data');%retrieve the min indices in the table MinIndex 651 656 652 set(handles.MaxIndex_i,'Data',MaxIndex_i_table(1:nbview,:)); 657 653 MaxIndex_j_table=get(handles.MaxIndex_j,'Data');%retrieve the min indices in the table MinIndex … … 2081 2077 2082 2078 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Åurs2084 % 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. 2085 2081 %create subdirectory for pbs command and log files 2086 2082 … … 3737 3733 % --- Executes on button press in MonitorCluster. 3738 3734 function MonitorCluster_Callback(hObject, eventdata, handles) 3739 web('https://www.legi.grenoble-inp.fr/servfill/monika') 3735 disp('format: R/W=run/wait, time lapsed, R=nbre of cores,W=walltime') 3736 system('oarstat |grep N=UVmat')% check the list of jobs launched with uvmat 3737 3740 3738 3741 3739 function OutputSubDir_Callback(hObject, eventdata, handles) -
trunk/src/series/extract_multitif_parallel.m
r977 r991 59 59 %======================================================================= 60 60 61 function ParamOut= ima2netcdf(Param)61 function ParamOut=extract_multitif_parallel(Param) 62 62 63 63 %%%%%%%%%%%%%%%%% INPUT PREPARATION MODE (no RUN) %%%%%%%%%%%%%%%%% … … 143 143 XmlInput=imadoc2struct(XmlInputFile,'Camera'); 144 144 145 %% create the xml file of PCO camera 146 XmlInput.Camera.CameraName='PCO'; 147 t=struct2xml(XmlInput.Camera); 148 t=set(t,1,'name','ImaDoc'); 149 save(t,fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml'])) 150 145 151 %% Main loop 146 152 -
trunk/src/series/extract_rdvision.m
r982 r991 64 64 if isstruct(Param) && isequal(Param.Action.RUN,0) 65 65 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 function71 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 extension66 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 74 74 ParamOut.OutputSubDirMode='one'; %output folder given by the folder name of the first input line 75 75 % detect the set of image folder 76 76 RootPath=Param.InputTable{1,1}; 77 ListStruct=dir(RootPath); 77 ListStruct=dir(RootPath); 78 78 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 79 79 check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it 80 80 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files 81 81 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'; 84 84 isel=0; 85 85 InputTable=Param.InputTable; … … 90 90 seq_index=find(~cellfun('isempty',detect_seq),1); 91 91 if ~isempty(seq_index) 92 % msgbox_uvmat('ERROR',['not seq file in ' ListDir{ilist} ': please check the input folders'])93 % else94 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}; 97 97 RootFile=regexprep(ListCellSub{1,seq_index},'.seq$',''); 98 98 InputTable{isel,3}=RootFile; 99 InputTable{isel,4}='*';100 InputTable{isel,5}='.seq';101 end99 InputTable{isel,4}='*'; 100 InputTable{isel,5}='.seq'; 101 end 102 102 end 103 103 hseries=findobj(allchild(0),'Tag','series');% find the parent GUI 'series' … … 105 105 set(hhseries.InputTable,'Data',InputTable) 106 106 ParamOut.ActionInput.LogPath=RootPath;% indicate the path for the output info: 0_LOG .... 107 return107 return 108 108 end 109 109 … … 239 239 SeqData.binrepertoire=regexprep(s.sequenceSettings.bindirectory,'\\$','');%tranform Windows notation to Linux 240 240 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]; 243 243 end 244 244 … … 253 253 254 254 %%%%%%%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; 268 269 %%%%%%% 269 270 timestamp=zeros(1,numel(m.Data)); … … 281 282 if ~isempty(errormsg) 282 283 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,[])'))]) 283 288 return 284 289 end … … 327 332 for iview=1:size(Param.InputTable,1) 328 333 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') 331 336 end 332 337 end … … 368 373 classname=['*' classname]; 369 374 BitDepth=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 %%%% 370 382 binrepertoire=fullfile(PathDir,SeqData.binrepertoire); 371 383 FileDir=SeqData.sequencename;
Note: See TracChangeset
for help on using the changeset viewer.