Align Trace Baselines
Sometimes, a multi-trace recording consists of a relatively small and brief signal in each trace, superimposed on a baseline that may vary considerably between traces. Typically, this can occur in calcium-imaging data, where baseline fluorescence may vary between different regions of interest recorded simultaneously. It can be difficult to visualize such data, and thus difficult to decide what, if any, further analysis is useful, and on which regions. It can be helpful in these circumstances to eliminate the baseline shift between traces, while still viewing the various traces at the same gain, so that differences in the signal become apparent.
DataView provides two possible methods to align the baselines of multiple traces. One is to shift the traces individually up or down until each lies within its axis limits, without changing their scale. This is a purely cosmetic change that does not affect the data. The other is to apply an offset to the actual data of each trace, so that they all have the same baseline value. This changes the data themselves, and should ONLY be done if the baseline value is irrelevant, perhaps because you are only interested in changes from the baseline (and it should be properly documented in any report).
Constructed data
- Load the file baseline align.
- Expand the view to make the axes easier to see. You may want to exand the Neurosim frame itself, if space is available.
- Select the View: Matrix view menu command to open the Matrix view.
Clearly some traces have a sine wave, but the differences in amplitude are obscured because they all occupy the full height of their cell due to the autoscaling applied when the file was constructed.
- Move the Matrix view so that you can see the main toolbar and at least part of the main Chart view.
- Click the Same scale button (
) in the main toolbar (also available as the Traces: Same scale menu command).
This sets all the axes to have the same scale as axis 1. However, the different traces have different fluorescent baselines, so many are displaced outside their axis limits. In fact, the only trace now visible in the Matrix view is trace 1.
Shift traces
We could select each axis in turn and manually apply the Traces: Move up (
) and Move down (
) commands to shift each to lie within its axis range, but this would be very tedious. DataView can automate this process.
- Click in the main Chart view to make it active (previously the Matrix view was active).
- Press the "v" key to add a vertical cursor, and drag it fully to the left so that it is located at time 0.
- (You could have set this explicitly using the Cursors: Place at time menu command.)
- Select the Transform: Align trace baselines menu command to open the Align Trace Baselines dialog box.
- Select Shift scales as the Align method at the top of the dialog.
- Leave the Master trace ID at 1 and the Start cursor at 1..
- Enter 2-16 in the Traces to align edit box.
- Click OK.
The axis scales of traces 2-16 have been adjusted so that the start of each trace now lies within its axis limits at the same relative position as trace 1, and all traces are at the same scale. However, at the gain of trace 1, many traces extend vertically beyond their display cell in the Matrix view.
- Hold down the control key, and click the gain down toolbar button (
) twice. - You could have clicked the Sel all button in the Matrix view to avoid having to use the control key.
The Matrix view now shows each trace positioned within its own axis. The traces are at the same gain, so amplitude comparisons can be made visually, but absolute DC level of each trace is different: they have been vertically-shifted to bring them into view. Trace 1 has a low amplitude signal, trace 2 has a large signal, trace 3 has a medium signal, and trace 7 has no signal at all.
It might be nice to view the traces superimposed on each other to see the differences more clearly.
- Select the View: Cycle trace view menu command to open the Cycle Trace View.
The Cycle trace view displays all the traces on the same axis, with the scale settings taken from axis 1. However, the real differences in baseline between the traces means that many are out of range in the Cycle view. It is time to try the other adjustment.
Transform baselines
- Select the Cursors: Place at time menu command to open the Place Vertical Cursor dialog.
- Enter 50 in the Place at time box, and click OK.
- A new cursor appears 50 ms into the data. This is before the start of the signal.
- You could have just pressed "v" and dragged the cursor to this location, but using the dialog makes it precise for possible future replication.
- Note that there should still be a cursor at the extreme left end of the data (time 0).
- Select the Transform: Align trace baselines menu command to re-open the Align Trace Baselines dialog box.
- Leave the Align method as the default Shift data (transform) selection.
- Enter 2-16 in the Traces to align edit box.
- Leave the other entries unchanged.
- Click OK.
- Leave Write new file box checked for safety - if you are confident in the procedure you could un-check it.
- Enter a new file name when requested.
In the new file, the data in traces 2-16 have been offset so that their average value between time 0 and 50 is the same as that in trace 1 (the Master trace).
When the new file loads the Cycle Traces and Matrix views automatically switch to use it as the source for data. The Cycle traces view looks good, but some traces are off scale in the Matrix view. This is because the main view has retained its previous axis scale settings.
- Click the Same scale button (
) in the main toolbar to bring all traces into their cells in the Matrix view. - In the Cycle Trace View, click the up spin button control of the Selected trace edit box to view each trace in turn in the context of all the other traces.
REMEMBER: you have permanently changed the data in traces 2-16 in the new file, so they are no longer what was recorded in the original experiment (or, in this case, constructed from equations).
Real Data
Examples of using this facility with real data can be found in tutorials on removing photo-bleaching effects and evoked potentials.