@@ -255,14 +255,18 @@ def calculate_displacement_unit_factor(
255
255
non_rigid_gradient : float , unit_locations : np .array , drift_start_um : np .array , drift_stop_um : np .array
256
256
) -> np .array :
257
257
"""
258
- In the case of introducing non-rigid drift, a set of scaling
259
- factors (one per unit) is generated for scaling the displacement
260
- as a function of unit position.
258
+ Introduces a non-rigid drift across the probe, this is a linear
259
+ scaling of the displacement based on the unit position.
260
+
261
+ To introduce non-rigid drift, a set of scaling factors (one per unit)
262
+ are generated. These scale the displacement applied to each unit
263
+ as a function of unit position. The smaller the `non_rigid_gradient`,
264
+ the larger the influence of the unit position is on scaling the
265
+ displacement (more non-linearity).
261
266
262
267
The projections of the gradient vector (x, y)
263
268
and unit locations (x, y) are normalised to range between
264
269
0 and 1 (i.e. based on relative location to the gradient).
265
- These factors are scaled by `non_rigid_gradient`.
266
270
267
271
Parameters
268
272
----------
@@ -272,6 +276,7 @@ def calculate_displacement_unit_factor(
272
276
that are based on unit location. This sets the weighting given to the factors
273
277
based on unit locations. When 1, the factors will all equal 1 (no effect),
274
278
when 0, the scaling factor based on unit location will be used directly.
279
+ Smaller number results in more nonlinearity.
275
280
unit_locations : np.array
276
281
The unit location with shape (num_units, 2)
277
282
drift_start_um : np.array
@@ -295,6 +300,7 @@ def calculate_displacement_unit_factor(
295
300
factors = 1 - factors
296
301
297
302
f = np .abs (non_rigid_gradient )
303
+ print ("f" , f )
298
304
displacement_unit_factor = factors * (1 - f ) + f
299
305
300
306
return displacement_unit_factor
0 commit comments