Œ НŒ Н-HHddg(ќšHHdh $O $O $NormalџџџџА џ6џџџџџџџџx  ШB6H6H$$x5Д,6ЦZ3ђD\SЁI^џJКЙMЙMЙMЙMЙMЙMЙMi "W BW4$т€Ђ Baselines for Igor Pro џџџџџџџџџџџџџџћ6Baselines for Igor Pro is a user-contributed, open source package written by Tony Withers. It is available for download from igorexchange.com and can be installed using the IgorExchange project installer . џџџџџџЬџџџџљџџџџџџ2The package aims to provide a user interface for fitting baselines to various kinds of spectroscopic data. As much as possible, the baselines are defined and reproducible. A baseline is defined by the function coefficients or, in the case of the spline family of baselines, the node positions. For masked and auto families of baselines, a baseline can also be described by the fit range and function, together with any input parameters. This means that, given the same input data and a description of the parameters used, the baseline can be exactly reproduced. џџџџџџNew for Baselines Version 4 _Baselines now includes all of the baseline types from the ArcHull and BaselineSpline projects. џџџџџџEA lot of the code has been rewritten and the user interface updated. џџџџџџЌSome code bottlenecks have been fixed. The result is that the baseline preview is updated more smoothly in response to changing settings, dragging nodes or moving cursors. џџџџџџRPreferences are now saved in a package preferences file and are easily editable. џџџџџџУ$Subrange fitting provides an easy way to adjust the output of the automatic baseline algorithms, and can used to treat different regions of interest separately. See usage notes for more details. џџџџџџџџџџiNew "marquee buttons" for quick input, and SetVariable controls for precise adjustment of fitting range. џџџџџџ”Improved algorithm for guessing node positions for spline type baselines. Hold down the shift key when clicking the reset button to snap-to-trace. џџџџџџNode editing mode can be toggled using a new graph window button. The button is moveable in Igor 8+ and transparent in Igor 9. џџџџџџVA user-defined function can be used for both masked and automatic iterative fitting. џџџџџџ,New manual baselines use cursors for input. џџџџџџ4Wave assignments for large waves are multithreaded. џџџџџџContact the Developer r6Bug reports, feature requests and general comments are welcome. Please leave a comment at the  at IgorExchange. џџџџџџ^џџџџџџ_џџџџџџ"How to use Baselines for Igor Pro To get started, plot all of the waves that need baseline correction in a graph window. The waves may be vertically offset as you please. Select 'Baselines' from the analysis menu to attach the 'Baseline Controls' panel to the top graph. Traces in the graph will be recolored (unless the trace recoloring option is turned off in the settings panel) so that the selected trace, together with a preview of the baseline and baseline-subtracted waves, are the only non-grey traces. Traces are reset to their original colors when the 'Baseline Controls' panel is closed. Select a spectrum and baseline type from the popup menus in the control panel. The four tabs select between four 'families' of baseline algorithms: masked function fitting, manual function fitting, automatic baselines that process the input data to estimate a baseline, and spline baselines that are interpolated between node positions selected by the user. Baselines works with both waveform and x-y traces, but not with 2D waves. Clicking on the cog icon opens a control panel where you can adjust the settings for baseline fitting. Close the main 'Baseline Controls' panel to clean up after fitting. Note that baselines uses cursors C through J, so don't try to use them for other purposes in the baseline fitting graph window. џџџџџџBaseline Functions E6Most of Igor Pro's built-in curve fitting functions can be selected as a baseline fit function. The fit coefficients are stored in the wave W_Coef, in case you need them for further processing. Some additional functions are selectable in the masked- and automatic-fitting tabs. These are described in the following sections. џџџџџџџџџџ3џџџџџџ96Some baseline functions have a 'peak' option. When the 'Peak' checkbox is checked, the first coefficient of the fit function is set to the baseline reference value, meaning that these are peak functions with no vertical offset. The fit coefficents are described in the help for built-in curve fitting functions. џџџџџџџџџџ6џџџџџџЖ6A user-defined fit function can be added by editing the last  in the procedure file. Your function will be available in the baseline type popups in the masked-region and auto tabs. џџџџџџ=џџџџџџ>џџџџџџMasked Fitting тUse the graph marquee tool (click and drag) to select a region of the spectrum, then use the + and - buttons (buttons adjacent to the marquee or the ones in the control panel) to add or remove a fitting region. Alternatively, keyboard shortcuts can be used in place of the buttons for adding and removing fit regions; the default keys are + and -, respectively. The baseline is determined by a leastsquares fit of the chosen function to data that fall within the selected regions. џџџџџџ6The tangent baseline (mask tab) will attempt to find a horizontal tangent if one fit region is selected, and a common tangent if two regions are selected. Each region is fitted with a cubic function, so the fit will be successful only if the selected regions can each be fit nicely with a cubic function, and if a horizontal or common tangent can be found with contact points within the selected regions. The coefficents for the tangent line are stored in W_Coef and are written to the wavenotes of output waves, together with the coordinates of the tangent points. џџџџџџManual Fitting KThe manual baselines allow you to create a baseline by positioning the cursors. The constant, line, and poly functions create a baseline that passes though all of the cursor positions. For Gaussian and Lorentzian functions, one cursor sets the baseline y-offset, the other sets the peak position and height, and the horizontal distance separating the cursors sets the peak width parameter. For sinusoidal baselines, the amplitude is set by the vertical offset of the two cursors and the number of complete cycles that should appear between the cursors can be selected in the popup menu. џџџџџџ Auto Fitting ЗThe arc hull type baseline adds to the spectrum a circular arc with adjustable depth (ie., the spectrum is bent), and the lower portion of a convex hull is calculated for the resultant spectrum. The baseline consists of the sum of the arc and the convex hull. Adjust arc depth using the SetVariable control to find an optimal value. Arc depth increments by 10% of its value and has y-axis units. Setting arc depth to zero creates a convex hull (a.k.a. 'rubber band') type baseline. For X-Y data, the X wave needs to be monatonic for arc hull calculation. Note that baseline segments can be convex or concave depending on the sign of the depth variable. The arc hull algorithm is not iterative. џџџџџџсSpline: baseline is a cubic spline using the convex hull as nodes. When arc depth is non-zero the nodes are more like a subset of alphashape vertices. Adjust Smooth and Depth parameters to produce an optimal number of nodes. џџџџџџ{Iterative: the function selected in the Fit Func popup is fitted iteratively. Any fit point with a negative residual (positive if the negative peaks checkbox is selected) is replaced by the corresponding point from the input data after each iteration, thus eliminating points with a positive residual, so ultimately eliminating peaks from the fit. The fit output is used as the input for the next iteration. The algorithm is similar to that described by Lieber and Mahadevan-Jansen (2003) Applied Spectroscopy 57: 1363-1367. For the first eight iterations only points with a residual above 50% of the greatest residual are eliminated. џџџџџџ‡Pre-smoothing: the baseline is calculated for a smoothed copy of the spectrum, then subtracted from the original. With the right choice of smoothing factor, the baseline will pass through spectroscopic noise rather than underlying the noise. Note that the baseline-subtracted output is not smoothed with respect to the original data, the smoothing is used only for calculating the baseline. џџџџџџ@Negative Peaks: subtract the top part of the convex hull, or fit to the top of the spectrum. Useful for dealing with downward facing peaks, or for when you have a reverse-scaled vertical axis. The negative peaks setting is also adjustable in the settings panel, and affects the guesses for y positions of spline nodes. џџџџџџїUse Convex Hull at Start: In the first iteration, the baseline function is fit to the lower (upper for negative peaks) part of a convex hull of the input data. For some spectra this reduces the influence of peaks on the iterative baseline output. џџџџџџSpline Baselines в6When 'edit mode' is selected the nodes can be moved. The spline updates as the nodes are repositioned. In edit mode you can add a new node at any position on the graph by positioning the mouse cursor and clicking while holding down the control key. Nodes may be deleted by clicking them with the option key held down. Clicking the (moveable) button in the graph window will toggle between node editing mode and 'normal' mode where you can interact with the graph as usual. Cubic and smoothing splines are calculated using Igor's Interpolate2 operation. Cubic splines are calculated with 'natural' ends. When a spline type baseline is subtracted the node positions are saved in a 2D wave and can be later reloaded. Selecting a trace in the 'data wave' popup menu will reposition the nodes by adjusting their vertical positions. Clicking the node reset button resets horizontal and vertical node positions. The default algorithm guesses node positions by first fitting an auto-type baseline. Clicking the reset button with the shift key held down will position the nodes on the trace rather than guessing their positions. The horizontal positions are not changed unless there are insufficient nodes within the x-range of the new trace. џџџџџџџџџџџџџџџџSubrange Fitting ДEnable subrange fitting by clicking the checkbox and select a subrange by adjusting the values in the setvariable controls or by dragging the vertical cursors. When a baseline is subtracted, points within the selected range of any existing output wave are overwritten. For baselines in the mask, manual and spline families, this setting affects only the baseline subtraction process: the baseline calculation includes masked regions, cursors or nodes outside of the selected region. For algorithmic baselines (Auto tab), the data within the selected region are used to calculate the baseline, so adjusting the output range also changes the baseline. Spline nodes are not saved for subranges. џџџџџџШIf a baseline has already been subtracted from the selected trace, points outside of the subrange will be filled with the existing values in both the baseline and baseline-subtracted output preview. џџџџџџSubtracting Baselines †The 'Subtract' button will make copies of baseline and baseline-subtracted waves. The output waves can be saved in either the current data folder, or in the same location as the input data wave. The names of the output waves are formed from the input wavename, together with a suffix as defined in the settings panel. Use the subrange setting to subtract baselines in a piecemeal fashion. џџџџџџAll-at-once fitting cycles through all of the traces in the plot, fitting a baseline using the current settings. Baselines and baseline-subtracted waves are created for each trace. All-at-once spline fitting guesses a y-position for the nodes for each trace. џџџџџџVNote that output waves with the baseline and subtracted-wave suffixes defined in the settings cannot be chosen as data waves for baseline fitting. If you want to subtract a sequence of baselines from one wave, edit the suffix in the settings panel after each baseline subtraction, or rename the output baseline-subtracted waves between fits. џџџџџџЧBaseline fit parameters are saved in the wavenotes of output waves. When a baseline subrange is subtracted, the baseline parameters for the subrange are appended to the wavenotes of the output waves.џџџџџџZ и"DМоH6 И d ќ j Ў њ  Ф ь .А& .(vŒ№дЮ b#%Z&j'‚',Ј,t/T0p02*3˜4TopicџџџџдH џSubtopicџџџџHА џ SeeAlsoџџџџHд џTopicBody1џџџџд$Hи џStepsџџџџ$дHи џTopicBody1aџџџџд$Hи џNOTElџџџџHдmи џ Commandџџџџа $6HZl~и hА џpictureџџџџд $ џCode_Indented1џџџџ$$а6HZl~ЂДЦиъќ DhŒА џCode1aџџџџа$6HZl~ЂДЦиќ DhА џCode1џџџџа$6HZl~ЂДЦиќ DhŒАд џCode_Indented1aџџџџ$$а6HZl~ЂДЦиъќDhŒА џTable2џџџџид џOperationFlags1aџџlјД џTable3џџџџА џOperationBody1aџџџџА џOperationSectionџџАHи џ OperationBody1џџТ џOperationFlags1џџџџlјД џSteplџџ-А џStep_textџџ--А џ RelatedTopicsџџZд џ ListBulletedџџџџ$ј џListNumberedџџџџ$дHи џsteps_indentedџџџџ$6дHи џSubtopic_IndentedџџџџА$Hи џTopicBody_Indented1џџџџ$$дHи џTopicBody_Indented1aџџџџ$$дHи џOperationKeywords1џџџџј џOperationKeywords1aџџџџљ џ NE6шш „GшшџџўџџПЮн*/66three functionsclick to open the baselines procedure fileDisplayProcedure /W=$"Baselines.ipf" "UserFunc"џџўџџПЮфф9baselines project pageBrowseURL "https://www.wavemetrics.com/project/Baselines"‰иФ.Ф8f*ddФ:ФФdmІ*x–rждGenevaCourierHelveticaMonacoBobGothicNew YorkPalatinoTimesChicagoSymbolOsakaCourier NewMonaco CEяМ­яМГ яМАу‚Ду‚Зуƒƒу‚ЏLucida GrandeLucida SansAmerican Typewriter LightPlantagenet CherokeeOptimaAmerican TypewriterKhmer MNArial Unicode MSZapf DingbatsApple SymbolsAppleGothicDџџџџџџџџџџџџџџЬЬџџџџџџЬЬkнТЂЬЬ џџ@@ ЬЬ ™™ ff ЬЬжЃџџџџЬЬЬЬ“>џџЬЬкgлL™™™™уMffэ3.3ff€€€€€@џџ@@@џџ™™џџаннннннЊЊЊЊЊЊ 2ЬЬ!ўџўџўџ"џџЊЊ#ˆˆˆˆˆˆ$ffffff%џџUU&џџџПџП'џџff(ЛЛЛЛЛЛ)џџ@Хй*``џџ+`ђ,-@юnџџ.ЬЬŽˆ/џџЬЬ0™™™™™™1ЬЬ@D23333333џџќџ@4ЬЬЩЬ5ЬЬЬЬЬЬ6]fЬЬ7™™8+gЬЬ9Tsfц:€€џџ;џџќ@<џ=wwwwww> Ѓ9fц?>џ@+AЬЬыQB™™q=Cџџ€€Dџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџш 8PˆŸЪ, 2Tgv…#’%Ѓ(ДBaselines for Igor ProNew for Baselines Version 4Contact the DeveloperHow to use Baselines for Igor ProBaseline FunctionsMasked FittingManual FittingAuto FittingSpline BaselinesSubrange FittingSubtracting BaselinesShowUserFuncBaselinesHyperlink–d(