File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Assets/Scripts/Pinpoint/UI/EphysCopilot Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -278,11 +278,15 @@ private float _targetDriveDistance
278278 var offsetAdjustedTargetPositionWorldT =
279279 targetPositionWorldT + offsetAdjustedRelativeTargetPositionWorldT ;
280280
281- // Converting worldT back to APMLDV (position transformed)
282- targetInsertion . APMLDV = targetInsertion . World2T (
283- offsetAdjustedTargetPositionWorldT
284- ) ;
285-
281+ // Converting worldT to AtlasT (to capture new Bregma offset when there is scaling)
282+ // then switch axes to get APMLDV.
283+ var offsetAdjustedTargetPositionAtlasT =
284+ BrainAtlasManager . ActiveReferenceAtlas . World2Atlas ( offsetAdjustedTargetPositionWorldT ) ;
285+ var offsetAdjustedTargetPositionCoordinateT =
286+ BrainAtlasManager . ActiveAtlasTransform . U2T_Vector ( offsetAdjustedTargetPositionAtlasT ) ;
287+ targetInsertion . APMLDV = offsetAdjustedTargetPositionCoordinateT ;
288+
289+ // Compute target drive distance.
286290 return Vector3 . Distance ( targetInsertion . APMLDV , DuraApmldv ) ;
287291 }
288292 }
You can’t perform that action at this time.
0 commit comments