From 1ec2223413ff291661b2fe90533abea65b771d47 Mon Sep 17 00:00:00 2001 From: Dan Birman Date: Mon, 12 Feb 2024 14:31:45 -0800 Subject: [PATCH] fix: adding some docs and fixing a bug in slicerenderer --- Assets/Scripts/Pinpoint/Probes/ProbeManager.cs | 9 ++++++++- Assets/Scripts/Pinpoint/TP_SliceRenderer.cs | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs b/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs index 2d074358..590e7fc6 100644 --- a/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs +++ b/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs @@ -458,7 +458,12 @@ public List GetProbeDepthIDs() } return depthIDs; } - + + /// + /// Gets the probe anatomy in depth format (SpikeGLX) + /// + /// + /// private string perShankDepthIDs(int shank) { // Create a list of range, acronym color @@ -524,6 +529,8 @@ private string perShankDepthIDs(int shank) /// /// Get a serialized representation of the channel ID data + /// + /// (OpenEphys format) /// /// public string GetChannelAnnotationIDs(bool collapsed = true) diff --git a/Assets/Scripts/Pinpoint/TP_SliceRenderer.cs b/Assets/Scripts/Pinpoint/TP_SliceRenderer.cs index 10f88fad..f8da7c56 100644 --- a/Assets/Scripts/Pinpoint/TP_SliceRenderer.cs +++ b/Assets/Scripts/Pinpoint/TP_SliceRenderer.cs @@ -81,6 +81,7 @@ public void UpdateSlicePosition() if (ProbeManager.ActiveProbeManager != null) (tipCoordWorld, _, _, _) = ProbeManager.ActiveProbeManager.ProbeController.GetTipWorldU(); + Vector3 tipCoordWorldT = ProbeManager.ActiveProbeManager.ProbeController.ProbeTipT.position; // vertex order -x-y, +x-y, -x+y, +x+y // compute the world vertex positions from the raw coordinates @@ -89,8 +90,10 @@ public void UpdateSlicePosition() Vector3[] newSagittalVerts = new Vector3[4]; for (int i = 0; i < _coronalOrigWorldU.Length; i++) { - newCoronalVerts[i] = BrainAtlasManager.WorldU2WorldT(new Vector3(_coronalOrigWorldU[i].x, _coronalOrigWorldU[i].y, tipCoordWorld.z), false); - newSagittalVerts[i] = BrainAtlasManager.WorldU2WorldT(new Vector3(tipCoordWorld.x, _sagittalOrigWorldU[i].y, _sagittalOrigWorldU[i].z), false); + newCoronalVerts[i] = new Vector3(_coronalOrigWorldU[i].x, _coronalOrigWorldU[i].y, tipCoordWorldT.z); + newSagittalVerts[i] = new Vector3(tipCoordWorldT.x, _sagittalOrigWorldU[i].y, _sagittalOrigWorldU[i].z); + //newCoronalVerts[i] = BrainAtlasManager.WorldU2WorldT(new Vector3(_coronalOrigWorldU[i].x, _coronalOrigWorldU[i].y, tipCoordWorld.z), false); + //newSagittalVerts[i] = BrainAtlasManager.WorldU2WorldT(new Vector3(tipCoordWorld.x, _sagittalOrigWorldU[i].y, _sagittalOrigWorldU[i].z), false); } _coronalSliceGo.GetComponent().mesh.vertices = newCoronalVerts;