- Timestamp:
- Mar 13, 2016, 6:29:07 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/browse_data.m
r924 r931 47 47 %------------------------------------------------------------------------ 48 48 % --- Executes just before browse_data is made visible. 49 function browse_data_OpeningFcn(hObject, eventdata, handles, DataSeries,EnableMirror )49 function browse_data_OpeningFcn(hObject, eventdata, handles, DataSeries,EnableMirror,MultiDevices) 50 50 %------------------------------------------------------------------------ 51 51 … … 73 73 set(hObject, 'Position', FigPos); 74 74 set(hObject, 'Units', OldUnits); 75 if exist('MultiDevices','var') && strcmp(MultiDevices,'on') 76 set(handles.ListDevices,'Max',2) 77 else 78 set(handles.ListDevices,'Max',1) 79 end 75 80 if exist('EnableMirror','var') && strcmp(EnableMirror,'on') 76 81 set(handles.CreateMirror,'Visible','on') … … 608 613 Campaign=get(handles.SourceDir,'String'); 609 614 end 615 handles.output=[]; 610 616 handles.output.Campaign=Campaign; 611 617 Experiment=get(handles.ListExperiments,'String'); -
trunk/src/series/extract_multitif.m
r930 r931 142 142 ImagesPerLevel=100;%100; 143 143 count=0; 144 %count= 933;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08:67->_11_1145 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 144 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1 145 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images 146 146 %% loop on the files 147 147 for ifile=1:numel(ListFile) … … 156 156 for iframe=1:NbFrames 157 157 A=imread(ImageName,iframe); 158 count=count+1; 158 159 159 if isequal(ImagesPerLevel,1)% mode series 160 160 161 OutputFile=fullfile(OutputDir,['img_' num2str(count ) '.png']);161 OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 162 162 else % mode multilevel or volume (indices i and j) 163 163 i_index=fix(count/ImagesPerLevel)+1; … … 166 166 end 167 167 imwrite(A,OutputFile,'BitDepth',16) 168 count=count+1; 168 169 end 169 170 end -
trunk/src/series/extract_rdvision.m
r930 r931 4 4 %------------------------------------------------------------------------ 5 5 % 6 %%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%% 6 %%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS % 7 %%%%%%%%%%%%%%%%%%%%%%%%%% 7 8 % 8 9 %OUTPUT … … 243 244 244 245 246 245 247 %% reading the .sqb file 246 248 m = memmapfile(filename_sqb,'Format', { 'uint32' [1 1] 'offset'; ... … … 286 288 checkpreserve=1;% will not erase the initial files, possibility of error 287 289 end 290 291 %% checking consistency with the xml file 292 if ~isequal(SeqData.nb_frames,numel(timestamp)) 293 disp_uvmat('ERRROR',['inconsistent number of images ' num2str(SeqData.nb_frames) ' with respect to the xml file: ' num2str(numel(timestamp))] ,checkrun); 294 return 295 end 296 288 297 if nbfield2>1 289 298 NomTypeNew='_1_1'; … … 301 310 FileDir=SeqData.sequencename; 302 311 FileDir=regexprep(FileDir,'_Master_Dalsa_4M180$','');%suppress '_Master_Dalsa_4M180' 303 for i1=1:n pi-1304 for j1=1:n pj-1312 for i1=1:numel(timestamp)/nbfield2 313 for j1=1:nbfield2 305 314 OutputFile=fullfile_uvmat(RootPath,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode 315 try 306 316 A=imread(OutputFile);% check image reading (stop if error) 317 catch ME 318 disp(['checking ' OutputFile]) 319 disp(ME.message) 320 end 307 321 end 308 322 end … … 378 392 OutputFile=fullfile_uvmat(PathDir,FileDir,'img','.png',NomTypeNew,i1,[],j1);% TODO: set NomTypeNew from SeqData.mode 379 393 fname=fullfile(binrepertoire,sprintf('%s%.5d.bin',SeqData.binfile,SqbData(ii).file_idx)); 380 if exist(OutputFile,'file') 394 if exist(OutputFile,'file')% do not recreate existing image file 381 395 fid=0; 382 396 else -
trunk/src/uvmat.m
r924 r931 1273 1273 RootPath=read_file_boxes(hhuvmat); 1274 1274 1275 OutPutDir=uigetfile_uvmat('choose an image folder to calibratewith slice position?',fileparts(RootPath),'uigetdir');1276 OutPut=browse_data(OutPutDir );1275 OutPutDir=uigetfile_uvmat('choose an image folder to document with slice position?',fileparts(RootPath),'uigetdir'); 1276 OutPut=browse_data(OutPutDir,'off','on'); 1277 1277 nbcalib=0; 1278 1278 for ilist=1:numel(OutPut.Experiment) 1279 SubDirBase=regexprep(OutPut.DataSeries{1},'\..+$',''); 1280 XmlFile=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},[SubDirBase '.xml']); 1281 1282 % read the current xml file 1283 [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib'); 1284 if ~isempty(errormsg) 1285 msgbox_uvmat('ERROR',['error in reading ' XmlFile ': ' errormsg]) 1286 return 1287 end 1288 GeometryCalib=s.GeometryCalib; 1289 GeometryCalib.NbSlice=SliceData.NbSlice; 1290 GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan; 1291 Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice); 1292 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 1293 GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3); 1294 Angle_1=linspace(SliceData.SliceAngle_1(1),SliceData.SliceAngle_1(2),SliceData.NbSlice); 1295 Angle_2=linspace(SliceData.SliceAngle_2(1),SliceData.SliceAngle_2(2),SliceData.NbSlice); 1296 GeometryCalib.SliceAngle(:,1)=Angle_1';%rotation around x axis (to generalise) 1297 GeometryCalib.SliceAngle(:,2)=Angle_2';%rotation around y axis (to generalise) 1298 GeometryCalib.SliceAngle(:,3)=0; 1299 if SliceData.CheckRefraction 1300 GeometryCalib.InterfaceCoord=[0 0 SliceData.H]; 1301 GeometryCalib.RefractionIndex=SliceData.RefractionIndex; 1302 elseif isfield(GeometryCalib,'RefractionIndex') 1303 GeometryCalib=rmfield(GeometryCalib,'RefractionIndex'); 1304 GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord'); 1305 end 1306 1307 % update the current xml file 1308 errormsg=update_imadoc(GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file 1309 if ~strcmp(errormsg,'') 1310 msgbox_uvmat('ERROR',errormsg); 1311 else 1312 display([XmlFile ' updated with slice positions']) 1313 nbcalib=nbcalib+1; 1279 for idevice=1:numel(OutPut.DataSeries) 1280 SubDirBase=regexprep(OutPut.DataSeries{idevice},'\..+$',''); 1281 XmlFile=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},[SubDirBase '.xml']); 1282 1283 % read the current xml file 1284 if exist(XmlFile,'file') 1285 [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib'); 1286 if ~isempty(errormsg) 1287 msgbox_uvmat('ERROR',['error in reading ' XmlFile ': ' errormsg]) 1288 return 1289 end 1290 GeometryCalib=s.GeometryCalib; 1291 GeometryCalib.NbSlice=SliceData.NbSlice; 1292 GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan; 1293 Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice); 1294 GeometryCalib.SliceCoord=Z_plane'*[0 0 1]; 1295 GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3); 1296 Angle_1=linspace(SliceData.SliceAngle_1(1),SliceData.SliceAngle_1(2),SliceData.NbSlice); 1297 Angle_2=linspace(SliceData.SliceAngle_2(1),SliceData.SliceAngle_2(2),SliceData.NbSlice); 1298 GeometryCalib.SliceAngle(:,1)=Angle_1';%rotation around x axis (to generalise) 1299 GeometryCalib.SliceAngle(:,2)=Angle_2';%rotation around y axis (to generalise) 1300 GeometryCalib.SliceAngle(:,3)=0; 1301 if SliceData.CheckRefraction 1302 GeometryCalib.InterfaceCoord=[0 0 SliceData.H]; 1303 GeometryCalib.RefractionIndex=SliceData.RefractionIndex; 1304 elseif isfield(GeometryCalib,'RefractionIndex') 1305 GeometryCalib=rmfield(GeometryCalib,'RefractionIndex'); 1306 GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord'); 1307 end 1308 1309 % update the current xml file 1310 errormsg=update_imadoc(GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file 1311 if ~strcmp(errormsg,'') 1312 msgbox_uvmat('ERROR',errormsg); 1313 else 1314 display([XmlFile ' updated with slice positions']) 1315 nbcalib=nbcalib+1; 1316 end 1317 end 1314 1318 end 1315 1319 end
Note: See TracChangeset
for help on using the changeset viewer.