You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/how_to/handle_drift.py
+22-20Lines changed: 22 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -133,32 +133,33 @@ def preprocess_chain(rec):
133
133
# We load back the results and use the widgets module to explore the estimated drift motion.
134
134
#
135
135
# For all methods we have 4 plots:
136
+
#
136
137
# * top left: time vs estimated peak depth
137
138
# * top right: time vs peak depth after motion correction
138
139
# * bottom left: the average motion vector across depths and all motion across spatial depths (for non-rigid estimation)
139
140
# * bottom right: if motion correction is non rigid, the motion vector across depths is plotted as a map, with the color code representing the motion in micrometers.
140
141
#
141
142
# A few comments on the figures:
142
-
# * the preset **'rigid_fast'** has only one motion vector for the entire probe because it is a "rigid" case.
143
-
# The motion amplitude is globally underestimated because it averages across depths.
144
-
# However, the corrected peaks are flatter than the non-corrected ones, so the job is partially done.
145
-
# The big jump at=600s when the probe start moving is recovered quite well.
146
-
# * The preset **kilosort_like** gives better results because it is a non-rigid case.
147
-
# The motion vector is computed for different depths.
148
-
# The corrected peak locations are flatter than the rigid case.
149
-
# The motion vector map is still be a bit noisy at some depths (e.g around 1000um).
150
-
# * The preset **dredge** is offcial DREDge re-implementation in spikeinterface.
151
-
# It give the best result : very fast and smooth motion estimation. Very few noise.
152
-
# This method also capture very well the non rigid motion gradient along the probe.
153
-
# The best method on the market at the moement.
154
-
# An enormous thanks to the dream team : Charlie Windolf, Julien Boussard, Erdem Varol, Liam Paninski.
155
-
# Note that in the first part of the recording before the imposed motion (0-600s) we clearly have a non-rigid motion:
156
-
# the upper part of the probe (2000-3000um) experience some drifts, but the lower part (0-1000um) is relatively stable.
157
-
# The method defined by this preset is able to capture this.
158
-
# * The preset **nonrigid_accurate** this is the ancestor of "dredge" before it was published.
159
-
# It seems to give the good results on this recording but with bit more noise.
160
-
# * The preset **dredge_fast** similar than dredge but faster (using grid_convolution).
161
-
# * The preset **nonrigid_fast_and_accurate** a variant of nonrigid_accurate but faster (using grid_convolution).
143
+
# * the preset **'rigid_fast'** has only one motion vector for the entire probe because it is a "rigid" case.
144
+
# The motion amplitude is globally underestimated because it averages across depths.
145
+
# However, the corrected peaks are flatter than the non-corrected ones, so the job is partially done.
146
+
# The big jump at=600s when the probe start moving is recovered quite well.
147
+
# * The preset **kilosort_like** gives better results because it is a non-rigid case.
148
+
# The motion vector is computed for different depths.
149
+
# The corrected peak locations are flatter than the rigid case.
150
+
# The motion vector map is still be a bit noisy at some depths (e.g around 1000um).
151
+
# * The preset **dredge** is offcial DREDge re-implementation in spikeinterface.
152
+
# It give the best result : very fast and smooth motion estimation. Very few noise.
153
+
# This method also capture very well the non rigid motion gradient along the probe.
154
+
# The best method on the market at the moement.
155
+
# An enormous thanks to the dream team : Charlie Windolf, Julien Boussard, Erdem Varol, Liam Paninski.
156
+
# Note that in the first part of the recording before the imposed motion (0-600s) we clearly have a non-rigid motion:
157
+
# the upper part of the probe (2000-3000um) experience some drifts, but the lower part (0-1000um) is relatively stable.
158
+
# The method defined by this preset is able to capture this.
159
+
# * The preset **nonrigid_accurate** this is the ancestor of "dredge" before it was published.
160
+
# It seems to give the good results on this recording but with bit more noise.
161
+
# * The preset **dredge_fast** similar than dredge but faster (using grid_convolution).
162
+
# * The preset **nonrigid_fast_and_accurate** a variant of nonrigid_accurate but faster (using grid_convolution).
162
163
#
163
164
#
164
165
@@ -205,6 +206,7 @@ def preprocess_chain(rec):
205
206
# We can see here that some clusters seem to be more compact on the 'y' axis, especially for the preset "nonrigid_accurate".
206
207
#
207
208
# Be aware that there are two ways to correct for the motion:
209
+
#
208
210
# 1. Interpolate traces and detect/localize peaks again (`interpolate_recording()`)
209
211
# 2. Compensate for drifts directly on peak locations (`correct_motion_on_peaks()`)
0 commit comments