SCM

SCM Repository

[batman] Annotation of /SplineFitBATMAN_MATLABcode/replotspinepoints.m
ViewVC logotype

Annotation of /SplineFitBATMAN_MATLABcode/replotspinepoints.m

Parent Directory Parent Directory | Revision Log Revision Log


Revision 346 - (view) (download)

1 : jie 346 function [hObject, handles] = replotspinepoints(hObject, handles)
2 :     % written 120213 Dr. Jie Hao, Imperial College London
3 :     x = handles.x;
4 :     y = handles.y;
5 :    
6 :     clicks=length(x);
7 :     set(0,'CurrentFigure', handles.plotFigure);
8 :     hold on
9 :     handles.hselect = plot(x,y,'rp','markersize',handles.mksize);
10 :    
11 :    
12 :     for i = 1:clicks
13 :     xy(:,i) = [x(i);y(i)];
14 :     end
15 :     t = 1:clicks;
16 :     ts = 1:0.1: clicks;
17 :     xys = spline(t,xy,ts);
18 :    
19 :     handles.hspline = plot(xys(1,:),xys(2,:),'b-');
20 :     Xn = handles.nmrdata(handles.dorder,:);
21 :     offset = str2num(get(handles.offset,'String'));
22 :     if offset == 0
23 :     warndlg('Please input offset > 0.');
24 :     return;
25 :     end
26 :     ppmerror = str2num(get(handles.ppmRange, 'String'));
27 :    
28 :    
29 :     if (~isempty(handles.h2))
30 :     if( ishandle(handles.h2))
31 :     delete(handles.h2);
32 :     handles.h2 = [];
33 :     end
34 :     end
35 :    
36 :     if handles.flagpoint == 1
37 :     flagmin = 0;
38 :     ppmx = intersectSpecSpline(Xn, offset, x, y, handles.ppm, flagmin, ppmerror);
39 :     elseif handles.flagpoint == 2
40 :     flagmin = 1;
41 :     ppmx = intersectSpecSpline(Xn, offset, x, y, handles.ppm, flagmin, ppmerror);
42 :     else
43 :     ppmx = intersectSpecSplineRatio(Xn, offset, x, y, handles.ppm);
44 :     end
45 :     if (size(ppmx,1) ~= 2)
46 :     ppmx = ppmx';
47 :     end
48 :    
49 :     if (size(ppmx,2) == length(handles.dorder))
50 :     hold on;
51 :     h2 = plot(ppmx(1,:),ppmx(2,:),'bs');
52 :     else
53 :     warndlg('Number of spectra mismatch number of points selected. Please re-select.');
54 :     [hObject, handles] = deletePlot(hObject, handles);
55 :     return;
56 :     end
57 :    
58 :     handles.ppmx = ppmx;
59 :     handles.h2 = h2;
60 :     guidata(hObject, handles);

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge