Changeset 972
- Timestamp:
- Nov 15, 2016, 5:22:14 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mouse_motion.m
r970 r972 224 224 sin_om=sin(pi*om/180); 225 225 pos=[xy(1,1) xy(1,2) 0]; 226 pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis; 227 end 228 pos=pos+Field.ProjObjectCoord; 226 %pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis; 227 coeff=OmAxis(3)*(1-cos_om); 228 norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; 229 norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; 230 norm_plane(3)=OmAxis(3)*coeff+cos_om; 231 %Z0=norm_plane*Field.ProjObjectCoord'/norm_plane(3); 232 pos(3)=-(norm_plane(1)*pos(1)-norm_plane(2)*pos(2))/norm_plane(3); 233 end 234 pos=pos+Field.ProjObjectCoord; 229 235 text_displ_3=[text_displ_3 'x,y,z=' num2str(pos,4)]; 230 236 end -
trunk/src/phys_XYZ.m
r924 r972 41 41 norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; 42 42 norm_plane(3)=OmAxis(3)*coeff+cos_om; 43 Z0=norm_plane*Calib.SliceCoord(Zindex,:)'/norm_plane(3);44 e lse43 % Z0=norm_plane*Calib.SliceCoord(Zindex,:)'/norm_plane(3); 44 end 45 45 Z0=Calib.SliceCoord(Zindex,3);%horizontal plane z=cte 46 end46 % end 47 47 Z0virt=Z0; 48 48 if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex') -
trunk/src/phys_ima.m
r970 r972 61 61 [Rangx]=phys_XYZ(Calib,Rangx,[0.5 0.5],ZIndex);%case of translations without rotation and quadratic deformation 62 62 [xx,Rangy]=phys_XYZ(Calib,[0.5 0.5],Rangy,ZIndex); 63 else 63 else 64 64 % the image needs to be interpolated to the new coordinates 65 65 zphys=0; %default 66 66 if isfield(Calib,'SliceCoord') %.Z= index of plane 67 SliceCoord=Calib.SliceCoord(ZIndex,:); 68 zphys=SliceCoord(3); %to generalize for non-parallel planes 69 70 % if isfield(Calib,'SliceAngle')&&~isequal(Calib.SliceAngle,[0 0 0]) 71 % om=norm(Calib.SliceAngle);%norm of rotation angle in radians 72 % OmAxis=Calib.SliceAngle/om; %unit vector marking the rotation axis 73 % cos_om=cos(pi*om/180); 74 % sin_om=sin(pi*om/180); 75 % pos=[xy(1,1) xy(1,2) 0]; 76 % pos=cos_om*pos+sin_om*cross(OmAxis,pos)+(1-cos_om)*(OmAxis*pos')*OmAxis; 77 % end 78 79 80 % if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex') 67 SliceCoord=Calib.SliceCoord(ZIndex,:); 68 zphys=SliceCoord(3); %to generalize for non-parallel planes 69 if isfield(Calib, 'SliceAngle') && ~isequal(Calib.SliceAngle,[0 0 0]) && ~isequal(Calib.SliceAngle(ZIndex,:),[0 0 0]) 70 testangle=1; 71 om=norm(Calib.SliceAngle(ZIndex,:));%norm of rotation angle in radians 72 OmAxis=Calib.SliceAngle(ZIndex,:)/om; %unit vector marking the rotation axis 73 cos_om=cos(pi*om/180); 74 sin_om=sin(pi*om/180); 75 coeff=OmAxis(3)*(1-cos_om); 76 norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; 77 norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; 78 norm_plane(3)=OmAxis(3)*coeff+cos_om; 79 %Z0=norm_plane*Calib.SliceCoord(ZIndex,:)'/norm_plane(3); 80 Z0=Calib.SliceCoord(ZIndex,3); 81 zphys=Z0-(norm_plane(1)*X-norm_plane(2)*Y)/norm_plane(3); 82 end 83 % if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex') 81 84 % H=Calib.InterfaceCoord(3); 82 85 % if H>zphys 83 86 % zphys=H-(H-zphys)/Calib.RefractionIndex; %corrected z (virtual object) 84 87 % end 85 % end88 % end 86 89 end 87 90 xima=0.5:npx(icell)-0.5;%image coordinates of corners -
trunk/src/series.m
r970 r972 2714 2714 end 2715 2715 2716 2716 2717 function [TimeValue,DtValue]=get_time(ref_i,ref_j,PairString,InputTable,FileInfo,TimeName,DtName) 2717 2718 [i1,i2,j1,j2] = get_file_index(ref_i,ref_j,PairString); … … 3486 3487 3487 3488 % --- Executes on button press in SetPairs. 3488 function SetPairs_Callback(hObject, iview, handles)3489 function SetPairs_Callback(hObject, eventdata, handles) 3489 3490 3490 3491 %% delete previous occurrence of 'set_pairs' … … 3510 3511 ListViewLines=find(cellfun('isempty',PairString)==0);%find list of non empty pairs 3511 3512 ListViewMenu=cell(numel(ListViewLines),1); 3513 iview=get(handles.PairString,'Value'); 3512 3514 for ilist=1:numel(ListViewLines) 3513 3515 ListViewMenu{ilist}=num2str(ListViewLines(ilist)); -
trunk/src/series/extract_multitif.m
r971 r972 59 59 %======================================================================= 60 60 61 function ParamOut= ima2netcdf(Param)61 function ParamOut=extract_multitif(Param) 62 62 63 63 %%%%%%%%%%%%%%%%% INPUT PREPARATION MODE (no RUN) %%%%%%%%%%%%%%%%% … … 73 73 ParamOut.OutputDirExt='.png';%set the output dir extension 74 74 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 75 75 ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 76 76 %% root input file(s) and type 77 77 % check the existence of the first file in the series … … 148 148 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1 149 149 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images 150 %% loop on the files 150 %% loop on the files 151 151 for ifile=1:numel(ListFile) 152 152 update_waitbar(WaitbarHandle,ifile/numel(ListFile)) … … 158 158 NbFrames=numel(imfinfo(ImageName)); 159 159 % loop on the frames within the tiff file 160 for iframe=1:NbFrames 161 A=imread(ImageName,iframe); 162 163 if isequal(ImagesPerLevel,1)% mode series 160 for iframe=1:NbFrames 161 if isequal(ImagesPerLevel,1)% mode series 164 162 i_index=count+1; 165 163 OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 166 else % indices i and j 164 else % indices i and j 167 165 i_index=fix(count/ImagesPerLevel)+1; 168 166 j_index=mod(count,ImagesPerLevel)+1; 169 167 OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']); 170 168 end 171 imwrite(A,OutputFile,'BitDepth',16) 169 if Param.CheckOverwrite ||~exist(OutputFile,'file') 170 A=imread(ImageName,iframe); 171 imwrite(A,OutputFile,'BitDepth',16); 172 disp([OutputFile ' written']) 173 else 174 disp([OutputFile ' already exists']) 175 end 172 176 count=count+1; 173 177 end 174 178 end 179 180 % for ifile=1:numel(ListFile) 181 % update_waitbar(WaitbarHandle,ifile/numel(ListFile)) 182 % if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 183 % disp('program stopped by user') 184 % break 185 % end 186 % ImageName=fullfile(DirImages,ListFile{ifile}); 187 % NbFrames=numel(imfinfo(ImageName)); 188 % % loop on the frames within the tiff file 189 % for iframe=1:NbFrames 190 % A=imread(ImageName,iframe); 191 % 192 % if isequal(ImagesPerLevel,1)% mode series 193 % i_index=count+1; 194 % OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 195 % else % indices i and j 196 % i_index=fix(count/ImagesPerLevel)+1; 197 % j_index=mod(count,ImagesPerLevel)+1; 198 % OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']); 199 % end 200 % imwrite(A,OutputFile,'BitDepth',16) 201 % count=count+1; 202 % end 203 % end 175 204 176 205 %% create the xml file of PCO camera … … 181 210 182 211 %% remove initial files if transfer OK 183 if i_index== (size(XmlInput.Time,1)-1)184 185 [SUCCESS,MESSAGE]=rmdir(DirImages,'s')186 187 end212 % if i_index== (size(XmlInput.Time,1)-1) 213 % 214 % [SUCCESS,MESSAGE]=rmdir(DirImages,'s') 215 % 216 % end -
trunk/src/transform_field/ima_color2BW.m
r924 r972 30 30 DataOut=DataIn; %default 31 31 if ndims(DataOut.A)==3 32 DataOut.A=uint16(sum(double(DataOut.A ,3)));%sum on color components, transform in 16 bit BW images32 DataOut.A=uint16(sum(double(DataOut.A),3));%sum on color components, transform in 16 bit BW images 33 33 end 34 34 -
trunk/src/uvmat.m
r968 r972 1177 1177 'String',num2str(SliceAngle(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_1_1'':first slice angle of inclination around the x axis');%edit box 1178 1178 uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-5*ii-4.2*hh ww hh],'tag','num_SliceAngle_1_2','BackgroundColor',[1 1 1],... 1179 'String',num2str(SliceAngle( 2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_1_2'':last slice angle of inclination around the x axis');%edit box1179 'String',num2str(SliceAngle(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_1_2'':last slice angle of inclination around the x axis');%edit box 1180 1180 uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+2*ww 0.95-6*ii-5.2*hh ww hh],'tag','num_SliceAngle_2_1','BackgroundColor',[1 1 1],... 1181 'String',num2str(SliceAngle( 1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_2_1'':first slice angle of inclination around the y axis');%edit box1181 'String',num2str(SliceAngle(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_2_1'':first slice angle of inclination around the y axis');%edit box 1182 1182 uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-6*ii-5.2*hh ww hh],'tag','num_SliceAngle_2_2','BackgroundColor',[1 1 1],... 1183 1183 'String',num2str(SliceAngle(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_2_2'':last slice angle of inclination around the y axis');%edit box … … 1269 1269 uvmat('InputFileREFRESH_Callback',huvmat,[],hhuvmat); %file input with xml reading in uvmat, show the image in phys coordinates 1270 1270 set(hObject,'BackgroundColor',[1 0 0]);% paint button back to red 1271 1272 delete(hset_slice) 1271 1273 1272 1274 %------------------------------------------------------------------------ … … 1338 1340 function set_slice_Cancel_Callback(hObject,eventdata) 1339 1341 %------------------------------------------------------------------------ 1340 h fig=get(hObject,'parent');1341 delete(h fig)1342 hset_slice=get(hObject,'parent'); 1343 delete(hset_slice) 1342 1344 1343 1345 %-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.