Created
March 19, 2019 15:45
-
-
Save tferr/6377d81db7a3a32bbe08dbf8be85b877 to your computer and use it in GitHub Desktop.
SNT script that checks for the presence of an unknown ARA ID detected on manually downloaded MouseLight reconstructions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SNT script that checks for the presence of a misterious ARA ID that | |
* somehow was detected on manually downloaded MouseLight reconstructions. | |
*/ | |
import tracing.io.MouseLightLoader; | |
import org.json.* | |
ids = ["AA0189", "AA0360", "AA0362"] | |
unknowCompartmentID = 484682464 | |
for (id in ids) { | |
println("Parsing id "+ id) | |
jsonData = new MouseLightLoader(id).getJSON() | |
neurons = jsonData.getJSONObject("contents").getJSONArray("neurons") | |
for (neuron in neurons) { | |
somaCompartment = neuron.getJSONObject("soma").getInt("allenId"); | |
println("\tSoma in unknown compartment? "+ somaCompartment) | |
for (dendriteNode in neuron.getJSONArray("dendrite")) { | |
allenId = dendriteNode.getInt("allenId") | |
found = allenId == unknowCompartmentID | |
println("\tDendrite node in ARA compartment "+ allenId + "\tUnknown? " + found) | |
if (found) return; | |
} | |
for (axonNode in neuron.getJSONArray("axon")) { | |
allenId = axonNode.getInt("allenId") | |
found = allenId == unknowCompartmentID | |
println("\tAxon node in ARA compartment "+ allenId + "\tUnknown? " + found) | |
if (found) return; | |
} | |
} | |
println("Parsing of id "+ id + " completed") | |
} | |
println("All ids parsed") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment