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
from sc.fiji.snt.analysis import SNTTable | |
from sc.fiji.snt.io import MouseLightQuerier, MouseLightLoader | |
""" | |
Jython script for bulk export of soma coordinates of MouseLight Neurons to a CSV file. | |
To Run this script: | |
- Download Fiji and install SNT (by subscribing to Fiji's Neuroanatomy update site) | |
- Edit the 'destination' variable and run this script from Fiji's Script Editor | |
(using Python as language) | |
- For instructions on how to run SNT from a native python environment have a look at |
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
ImageJ 2.1.0/1.53j; Java 1.8.0_202 [x86_64] | |
-- Application: ImageJ -- | |
Title = ImageJ | |
Version = 2.1.0/1.53j | |
groupId = net.imagej | |
artifactId = imagej | |
Automatic-Module-Name = net.imagej | |
Build-Jdk-Spec = 1.8 | |
Class-Path = imagej-common-0.33.0.jar imglib2-5.10.0.jar imglib2-roi-0.10.3.jar scijava-table-0.5.0.jar udunits-4.3.18.jar imagej-launcher-5.0.3.jar imagej-notebook-0.7.1.jar commons-text-1.8.jar xchart-3.5.4.jar VectorGraphics2D-0.13.jar imagej-ops-0.45.5.jar imagej-mesh-0.8.0.jar imglib2-algorithm-0.11.2.jar imglib2-algorithm-fft-0.2.0.jar mines-jtk-20151125.jar imglib2-realtransform-3.0.0.jar jitk-tps-3.0.1.jar ejml-0.24.jar log4j-1.2.17.jar parsington-2.0.0.jar scijava-search-0.7.0.jar prettytime-4.0.1.Final.jar scripting-javascript-0.5.0.jar commons-math3-3.6.1.jar joml-1.9.25.jar ojalgo-45.1.1.jar jama-1.0.3.jar imagej-updater-0.10.5.jar commons-lang-2.6.jar scifio-0.41.0.jar scifio-jai-imageio-1.1.1.jar imglib2-cache-1.0.0-beta-13.jar caffeine-2.4.0.jar scijava-common-2.83.3.jar eventbus-1.4.jar image |
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
import java.io.File; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Map; | |
import org.scijava.ItemVisibility; | |
import org.scijava.command.Command; | |
import org.scijava.command.DynamicCommand; |
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
from sc.fiji.snt.io import MouseLightLoader, MouseLightQuerier | |
from sc.fiji.snt.analysis import NodeStatistics, TreeStatistics | |
from sc.fiji.snt.annotation import AllenUtils | |
soma_area = AllenUtils.getCompartment("MOs") | |
target_area = AllenUtils.getCompartment("ACA") | |
input_ids = MouseLightQuerier.getIDs(soma_area) | |
output_ids = [] | |
for in_id in input_ids: |
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
#@File(style="directory", label="Input directory containing H5 files") inDir | |
#@File(style="directory", label="Output directory for saving converted TIFFs") outDir | |
import static groovy.io.FileType.FILES | |
import sc.fiji.hdf5.HDF5ImageJ | |
import ij.IJ | |
inDir.eachFileRecurse(FILES) { file -> | |
if (file.name.endsWith(".h5")) { | |
println("Converting "+ file) |
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
import sc.fiji.snt.io.MouseLightLoader | |
import sc.fiji.snt.annotation.AllenCompartment | |
import sc.fiji.snt.annotation.AllenUtils | |
import java.text.DecimalFormat | |
// The name of the compartment to extract somas from | |
compartmentOfInterest = AllenUtils.getCompartment("Cerebral cortex") | |
/* | |
If MouseLightQuerier is available one could simply do: |
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
#@File(style="directory", label="Output directory") destinationDirectory | |
#@String(label="CCF Compartment (acronym, id, or label)", value="Isocortex") compartmentName | |
#@String(label="What to save?", choices={"dendrites", "axons", "all"}) subTreeName | |
import sc.fiji.snt.io.MouseLightLoader | |
import sc.fiji.snt.annotation.AllenCompartment | |
import sc.fiji.snt.annotation.AllenUtils | |
import sc.fiji.snt.Tree | |
import java.text.DecimalFormat |
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
#@ImageJ ij | |
import sc.fiji.snt.analysis.MultiTreeColorMapper | |
import sc.fiji.snt.annotation.AllenCompartment | |
import sc.fiji.snt.annotation.AllenUtils | |
import sc.fiji.snt.io.MouseLightLoader | |
import sc.fiji.snt.viewer.Viewer3D | |
import sc.fiji.snt.util.SNTColor | |
import net.imagej.display.ColorTables | |
import java.text.DecimalFormat |
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
# @ImageJ ij | |
# @LUTService lut | |
import java.text.DecimalFormat | |
import net.imglib2.display.ColorTable | |
import org.scijava.util.Colors; | |
import sc.fiji.snt.* | |
import sc.fiji.snt.io.* | |
import sc.fiji.snt.analysis.* | |
import sc.fiji.snt.annotation.* |
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
# @ImageJ ij | |
# @LUTService lut | |
import java.text.DecimalFormat | |
import net.imglib2.display.ColorTable | |
import sc.fiji.snt.* | |
import sc.fiji.snt.io.* | |
import sc.fiji.snt.analysis.* | |
import sc.fiji.snt.annotation.* | |
import sc.fiji.snt.viewer.* |
NewerOlder