Skip to content

Commit

Permalink
fix: adding some docs and fixing a bug in slicerenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Feb 12, 2024
1 parent a55e4b2 commit 1ec2223
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Assets/Scripts/Pinpoint/Probes/ProbeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,12 @@ public List<string> GetProbeDepthIDs()
}
return depthIDs;
}


/// <summary>
/// Gets the probe anatomy in depth format (SpikeGLX)
/// </summary>
/// <param name="shank"></param>
/// <returns></returns>
private string perShankDepthIDs(int shank)
{
// Create a list of range, acronym color
Expand Down Expand Up @@ -524,6 +529,8 @@ private string perShankDepthIDs(int shank)

/// <summary>
/// Get a serialized representation of the channel ID data
///
/// (OpenEphys format)
/// </summary>
/// <returns></returns>
public string GetChannelAnnotationIDs(bool collapsed = true)
Expand Down
7 changes: 5 additions & 2 deletions Assets/Scripts/Pinpoint/TP_SliceRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<MeshFilter>().mesh.vertices = newCoronalVerts;
Expand Down

0 comments on commit 1ec2223

Please sign in to comment.