public SWCStackData(LocationNode node, SWCType type, long ParentID) { this.node = node; this.Type = type; this.ParentID = ParentID; }
private int WriteLocationEntry(StringBuilder sb, LocationNode node, SWCType Type, long parent) { const string FormatString = "{0} {1} {2} {3} {4} {5} {6}"; string outString = string.Format(FormatString, new object[] {NextLineNumber, Type.ToString("D"), node.Location.VolumePosition.X * 2.18, node.Location.VolumePosition.Y * 2.18, node.Location.VolumePosition.Z * 90, node.Location.Radius, parent}); sb.AppendLine(outString); NextLineNumber++; return NextLineNumber - 1; }
private void AddLinks(StructureGraph graph, LocationNode loc, SWCType Type, long SWCID) { foreach(long locID in loc.Location.Links) { if (MasterKnownLocationList.Contains(locID)) continue; LocationNode node = graph.Nodes[locID]; queue.Enqueue(new SWCStackData(node, Type, SWCID)); } }
private void TraceLocation(StructureGraph graph, LocationNode loc, SWCType Type, long ParentID) { MasterKnownLocationList.Add(loc.Location.ID); int SWCID; if (loc.Edges.Count == 1) { SWCID = WriteLocationEntry(sb, loc, SWCType.END_POINT, ParentID); } else if (loc.Edges.Count == 2) { SWCID = WriteLocationEntry(sb, loc, Type, ParentID); AddLinks(graph, loc, Type, SWCID); } else { SWCID = WriteLocationEntry(sb, loc, SWCType.FORK_POINT, ParentID); List<long> NewAddedLocations = AddKnownBranchesToList(loc); AddLinks(graph, loc, SWCType.AXON, SWCID); } }
public SWCStackData(LocationNode node, SWCType type, long ParentID, List<long> KnownLocations) { this.node = node; this.Type = type; this.ParentID = ParentID; this.KnownLocations = KnownLocations; }