Added trimming of rims
This commit is contained in:
		
							parent
							
								
									ea0e8256d5
								
							
						
					
					
						commit
						6aa126fdc3
					
				| @ -59,22 +59,35 @@ d.FontSize = 0.6; | ||||
| d.Tag = 'Done'; | ||||
| d.Callback = @FieldDoneButtonPushed; | ||||
| 
 | ||||
| %create input field | ||||
| p = uicontrol(fig,'Style','edit'); | ||||
| p.String = 'No. points baseline'; | ||||
| p.Units = 'Normalized'; | ||||
| p.Position = [.01 .01 .5 .05]; | ||||
| p.HorizontalAlignment = 'left'; | ||||
| p.FontUnits = 'Normalized'; | ||||
| p.FontSize = 0.6; | ||||
| p.Tag = 'FieldPoints'; | ||||
| %create input fields | ||||
| p1 = uicontrol(fig,'Style','edit'); | ||||
| p1.String = 'No. points baseline'; | ||||
| p1.Units = 'Normalized'; | ||||
| p1.Position = [.01 .01 .24 .05]; | ||||
| p1.HorizontalAlignment = 'left'; | ||||
| p1.FontUnits = 'Normalized'; | ||||
| p1.FontSize = 0.6; | ||||
| p1.Tag = 'FieldPoints'; | ||||
| 
 | ||||
| uicontrol(p); %passes focus to input | ||||
| p2 = uicontrol(fig,'Style','edit'); | ||||
| p2.String = 'No. points to cut'; | ||||
| p2.Units = 'Normalized'; | ||||
| p2.Position = [.26 .01 .24 .05]; | ||||
| p2.HorizontalAlignment = 'left'; | ||||
| p2.FontUnits = 'Normalized'; | ||||
| p2.FontSize = 0.6; | ||||
| p2.Tag = 'FieldPoints'; | ||||
| 
 | ||||
| uicontrol(p1); %passes focus to input | ||||
| uiwait(fig) | ||||
| 
 | ||||
| %% Callback functions | ||||
|     function FieldApplyButtonPushed(src,event) | ||||
|         field_baseline = str2double(get(p,'String')); | ||||
|         field_baseline = str2double(get(p1,'String')); | ||||
|         field_cut = str2double(get(p2,'String')); | ||||
|         %field baseline CUTTING | ||||
|         dataIN(:,1:field_cut) = []; | ||||
|         dataIN(:,end-field_cut:end) = []; | ||||
|         %field baseline CORRECTING | ||||
|         data_size = size(dataIN); | ||||
|         dataOUT = zeros(data_size); | ||||
| @ -89,6 +102,7 @@ uiwait(fig) | ||||
|         plot(ax,dataOUT_transp) | ||||
|         axis tight | ||||
|         %writing parameter | ||||
|         params.No_field_cut_pts = field_cut; | ||||
|         params.No_field_basline_pts = field_baseline; | ||||
|     end | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user