Skip to content

Commit 4506057

Browse files
committed
chore: cleaning up ProbeInsertion's new data model
1 parent c36cfb9 commit 4506057

14 files changed

+51
-51
lines changed

Assets/Scripts/API/APISpikeGLX.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void SendData()
127127
if (probeManager.APITarget == null || probeManager.APITarget.Equals("None"))
128128
continue;
129129

130-
Vector3 pos = probeManager.ProbeController.Insertion.apmldv;
130+
Vector3 pos = probeManager.ProbeController.Insertion.APMLDV;
131131

132132
if (_lastPositions.ContainsKey(probeManager))
133133
{

Assets/Scripts/Accounts/BackendComms/UnisaveAccountsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ public void RemoveProbeFromActiveExperiment(string UUID)
433433

434434
private ServerProbeInsertion ProbeManager2ServerProbeInsertion(ProbeManager probeManager, bool active = true, bool recorded = false)
435435
{
436-
Vector3 apmldv = probeManager.ProbeController.Insertion.apmldv;
437-
Vector3 angles = probeManager.ProbeController.Insertion.angles;
436+
Vector3 apmldv = probeManager.ProbeController.Insertion.APMLDV;
437+
Vector3 angles = probeManager.ProbeController.Insertion.Angles;
438438
Color color = probeManager.Color;
439439

440440
ServerProbeInsertion serverProbeInsertion = new ServerProbeInsertion(

Assets/Scripts/Craniotomy/CraniotomyPanel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private void UpdateCraniotomy()
114114

115115
public void SnapActiveCraniotomy2Probe()
116116
{
117-
Vector3 apmldv = ProbeManager.ActiveProbeManager.ProbeController.Insertion.apmldv;
117+
Vector3 apmldv = ProbeManager.ActiveProbeManager.ProbeController.Insertion.APMLDV;
118118
_positionSpace.x = apmldv.x;
119119
_positionSpace.y = apmldv.y;
120120
UpdateCraniotomy();

Assets/Scripts/Insertion/ProbeInsertion.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public float Roll
7171
/// <summary>
7272
/// The **transformed** coordinate in the active CoordinateSpace (AP, ML, DV)
7373
/// </summary>
74-
public Vector3 apmldv
74+
public Vector3 APMLDV
7575
{
7676
get => _data.APMLDV;
7777
set
@@ -83,7 +83,7 @@ public Vector3 apmldv
8383
/// <summary>
8484
/// (Yaw, Pitch, Spin)
8585
/// </summary>
86-
public Vector3 angles
86+
public Vector3 Angles
8787
{
8888
get => _data.Angles;
8989
set
@@ -108,19 +108,19 @@ public ProbeInsertion(float ap, float ml, float dv, float yaw, float pitch, floa
108108
public ProbeInsertion(Vector3 tipPosition, Vector3 angles,
109109
string atlasName, string transformName)
110110
{
111-
apmldv = tipPosition;
112-
this.angles = angles;
113-
AtlasName = atlasName;
114-
TransformName = transformName;
111+
_data.APMLDV = tipPosition;
112+
_data.Angles = angles;
113+
_data.AtlasName = atlasName;
114+
_data.TransformName = transformName;
115115
Instances.Add(this);
116116
}
117117

118118
public ProbeInsertion(ProbeInsertion otherInsertion)
119119
{
120-
apmldv = otherInsertion.apmldv;
121-
angles = otherInsertion.angles;
122-
AtlasName = otherInsertion.AtlasName;
123-
TransformName = otherInsertion.TransformName;
120+
_data.APMLDV = otherInsertion.APMLDV;
121+
_data.Angles = otherInsertion.Angles;
122+
_data.AtlasName = otherInsertion.AtlasName;
123+
_data.TransformName = otherInsertion.TransformName;
124124
Instances.Add(this);
125125
}
126126

Assets/Scripts/Pinpoint/CoordinateEntryPanel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void UpdateText()
8383
}
8484

8585
Vector3 apmldv;
86-
Vector3 angles = ProbeManager.ActiveProbeManager.ProbeController.Insertion.angles;
86+
Vector3 angles = ProbeManager.ActiveProbeManager.ProbeController.Insertion.Angles;
8787
float depth = float.NaN;
8888

8989
if (ProbeManager.ActiveProbeManager.IsProbeInBrain())
@@ -92,7 +92,7 @@ public void UpdateText()
9292
}
9393
else
9494
{
95-
apmldv = ProbeManager.ActiveProbeManager.ProbeController.Insertion.apmldv;
95+
apmldv = ProbeManager.ActiveProbeManager.ProbeController.Insertion.APMLDV;
9696
}
9797

9898
if (Settings.ConvertAPML2Probe)

Assets/Scripts/Pinpoint/Probes/Controllers/CartesianProbeController.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ public override void ResetInsertion()
333333

334334
public override void ResetPosition()
335335
{
336-
Insertion.apmldv = _defaultStart;
336+
Insertion.APMLDV = _defaultStart;
337337
}
338338

339339
public override void ResetAngles()
340340
{
341-
Insertion.angles = _defaultAngles;
341+
Insertion.Angles = _defaultAngles;
342342
}
343343

344344
#endregion
@@ -497,7 +497,7 @@ private void MoveProbe_XYZD(Vector4 direction, float speed)
497497
{
498498
// Rotate the position delta (unity world space) into the insertion's transformed space
499499
// Note that we don't apply the transform beacuse we want 1um steps to = 1um steps in transformed space
500-
Insertion.apmldv += Insertion.World2T_Vector(posDelta);
500+
Insertion.APMLDV += Insertion.World2T_Vector(posDelta);
501501
_depth += posDelta.w;
502502

503503
// Set probe position and update UI
@@ -566,7 +566,7 @@ public void DragMovementClick()
566566
axisLockPitch = false;
567567
axisLockYaw = false;
568568

569-
origAPMLDV = Insertion.apmldv;
569+
origAPMLDV = Insertion.APMLDV;
570570
origYaw = Insertion.Yaw;
571571
origPitch = Insertion.Pitch;
572572
// Note: depth is special since it gets absorbed into the probe position on each frame
@@ -691,7 +691,7 @@ public void DragMovementDrag()
691691

692692
if (moved)
693693
{
694-
Insertion.apmldv = origAPMLDV + Insertion.World2T_Vector(newXYZ);
694+
Insertion.APMLDV = origAPMLDV + Insertion.World2T_Vector(newXYZ);
695695
}
696696

697697
if (axisLockDepth)
@@ -764,7 +764,7 @@ public override void SetProbePosition()
764764
transform.position += transform.forward * _depth;
765765
Vector3 depthAdjustment = Insertion.World2T_Vector(transform.forward) * _depth;
766766

767-
Insertion.apmldv += depthAdjustment;
767+
Insertion.APMLDV += depthAdjustment;
768768
_depth = 0f;
769769
}
770770

@@ -778,20 +778,20 @@ public override void SetProbePosition()
778778

779779
public override void SetProbePosition(Vector3 position)
780780
{
781-
Insertion.apmldv = position;
781+
Insertion.APMLDV = position;
782782
SetProbePosition();
783783
}
784784

785785
public override void SetProbePosition(Vector4 positionDepth)
786786
{
787-
Insertion.apmldv = positionDepth;
787+
Insertion.APMLDV = positionDepth;
788788
_depth = positionDepth.w;
789789
SetProbePosition();
790790
}
791791

792792
public override void SetProbeAngles(Vector3 angles)
793793
{
794-
Insertion.angles = angles;
794+
Insertion.Angles = angles;
795795
SetProbePosition();
796796
}
797797

Assets/Scripts/Pinpoint/Probes/Controllers/PlaceholderProbeController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public override void ResetInsertion()
4949

5050
public override void ResetPosition()
5151
{
52-
Insertion.apmldv = defaultStart;
52+
Insertion.APMLDV = defaultStart;
5353
}
5454

5555
public override void ResetAngles()
5656
{
57-
Insertion.angles = defaultAngles;
57+
Insertion.Angles = defaultAngles;
5858
}
5959

6060

@@ -70,7 +70,7 @@ public override void SetProbePosition()
7070

7171
public override void SetProbePosition(Vector3 position)
7272
{
73-
Insertion.apmldv = position;
73+
Insertion.APMLDV = position;
7474
SetProbePosition();
7575
}
7676

@@ -81,7 +81,7 @@ public override void SetProbePosition(Vector4 positionDepth)
8181

8282
public override void SetProbeAngles(Vector3 angles)
8383
{
84-
Insertion.angles = angles;
84+
Insertion.Angles = angles;
8585
SetProbePosition();
8686
}
8787

Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public void ComputeBrainSurfaceOffset()
254254
BrainAtlasManager.ActiveReferenceAtlas.AtlasIdx2World(brainSurfaceCoordinateIdx));
255255

256256
BrainSurfaceOffset += Vector3.Distance(brainSurfaceToTransformed,
257-
_probeController.Insertion.apmldv);
257+
_probeController.Insertion.APMLDV);
258258
}
259259
}
260260

Assets/Scripts/Pinpoint/Probes/ProbeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void SetSpaceTransform(CoordinateSpace atlas, CoordinateTransform transfo
6060
// Covnert the tip coordinate into the new space
6161
var tipData = GetTipWorldU();
6262
Vector3 tipCoordNewSpace = transform.U2T(atlas.World2Space(tipData.tipCoordWorldU));
63-
Insertion.apmldv = tipCoordNewSpace;
63+
Insertion.APMLDV = tipCoordNewSpace;
6464
// Set the transforms
6565
Insertion.AtlasName = atlas.Name;
6666
Insertion.TransformName = transform.Name;

Assets/Scripts/Pinpoint/Probes/ProbeManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,11 @@ public void Probe2Text()
664664
float mult = Settings.DisplayUM ? 1000f : 1f;
665665

666666
Vector3 tipAtlasU = insertion.PositionSpaceU() + BrainAtlasManager.ActiveReferenceAtlas.AtlasSpace.ReferenceCoord;
667-
Vector3 tipAtlasT = insertion.apmldv;
667+
Vector3 tipAtlasT = insertion.APMLDV;
668668

669669
Vector3 angles = Settings.UseIBLAngles ?
670-
Utils.World2IBL(insertion.angles) :
671-
insertion.angles;
670+
Utils.World2IBL(insertion.Angles) :
671+
insertion.Angles;
672672

673673
(Vector3 entryAtlasT, float depthTransformed) = GetSurfaceCoordinateT();
674674

@@ -738,7 +738,7 @@ public void ResizeProbePanel(int newPxHeight)
738738

739739
public (Vector3 surfaceCoordinateT, float depthT) GetSurfaceCoordinateT()
740740
{
741-
return (_brainSurfaceCoordT, Vector3.Distance(_probeController.Insertion.apmldv, _brainSurfaceCoordT));
741+
return (_brainSurfaceCoordT, Vector3.Distance(_probeController.Insertion.APMLDV, _brainSurfaceCoordT));
742742
}
743743

744744
public Vector3 GetSurfaceCoordinateWorldT()
@@ -1120,8 +1120,8 @@ public static ProbeManagerData ProbeManager2ProbeData(ProbeManager probeManager)
11201120
{
11211121
ProbeManagerData data = new ProbeManagerData();
11221122

1123-
data.APMLDV = probeManager.ProbeController.Insertion.apmldv;
1124-
data.Angles = probeManager.ProbeController.Insertion.angles;
1123+
data.APMLDV = probeManager.ProbeController.Insertion.APMLDV;
1124+
data.Angles = probeManager.ProbeController.Insertion.Angles;
11251125

11261126
data.AtlasSpaceName = probeManager.ProbeController.Insertion.AtlasName;
11271127

0 commit comments

Comments
 (0)