Skip to content

Commit

Permalink
adjusted SWC export to be compliant with new specification
Browse files Browse the repository at this point in the history
  • Loading branch information
olbris committed Nov 14, 2024
1 parent 6f2d8b2 commit 93c1f15
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// 9.20.1
// 9.21

Horta
* Added "deeplink" functionality, that allows the creation of a positional cross-sample bookmark in Horta3D
* Added protections for Null Zarr Actors in Horta3D
* Removed stable branch to simplify deployment
* Adjusted SWC export to be compliant with new specification
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// 9.20.1

Horta
* Added "deeplink" functionality, that allows the creation of a positional cross-sample bookmark in Horta3D
* Added protections for Null Zarr Actors in Horta3D
* Removed stable branch to simplify deployment

// 9.19.1

Horta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,12 @@ private List<SWCNode> nodesFromSubtrees(TmNeuronMetadata neuron, double xcenter,
}

private static SWCNode.SegmentType getSegmentType(TmGeoAnnotation ann) {
SWCNode.SegmentType segmentType;
// only marking "fork" and "end, as that's
// all we can surmise from geometry
if (ann.getChildIds().size() == 0) {
segmentType = SWCNode.SegmentType.end_point;
} else if (ann.getChildIds().size() > 1) {
segmentType = SWCNode.SegmentType.fork_point;
} else {
segmentType = SWCNode.SegmentType.undefined;
}
return segmentType;
// historical note: before the spec linked at top existed, we marked
// branches and endpoints as type 5 and 6; we currently
// do not classify nodes at all, but I'm leaving this method here in
// case we decide to add that capability back in the future

return SWCNode.SegmentType.undefined;
}

private double[] calcDefaultCenterOfMass(double[] rtnVal) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@
/**
* used by the SWCData class to hold each point in the neuron
*
* see http://research.mssm.edu/cnic/swc.html; node holds info
* see https://swc-specification.readthedocs.io/en/latest/; node holds info
* from one line in SWC file
*/
public class SWCNode {

private static final Map<Integer,SegmentType> decodeToSegment = new HashMap<>();
public static enum SegmentType {
undefined(0), soma(1), axon(2), dendrite(3), apical_dendrite(4), fork_point(5), end_point(6), custom(7);
undefined(0),
soma(1),
axon(2),
basal_dendrite(3),
apical_dendrite(4),
custom(5),
unspecified_neurite(6),
glia_process(7);

private int decodeNum;
public static SegmentType getSegmentType( String typeName ) {
Expand Down

0 comments on commit 93c1f15

Please sign in to comment.