This file contains hidden or 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
| //@LogService log | |
| //@UIService ui | |
| import ij.IJ | |
| import ij.gui.Overlay | |
| import features.ComputeCurvatures | |
| import tracing.TracerThread | |
| import tracing.Path | |
This file contains hidden or 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
| //@ImagePlus imp | |
| // Obtains the 2D Convex Hull ROI from a 2D binary image | |
| // TODO: Use imagej.ops / net.imglib2.roi.geometric.Polygon | |
| import ij.process.ImageProcessor; | |
| import ij.gui.PolygonRoi; | |
| def run(ImageProcessor ip) { |
This file contains hidden or 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.0.0-rc-56/1.51j; Java 1.8.0_66 [x86_64] | |
| -- Application: ImageJ -- | |
| Title = ImageJ | |
| Version = 2.0.0-rc-56/1.51j | |
| groupId = net.imagej | |
| artifactId = imagej | |
| Archiver-Version = Plexus Archiver | |
| Build-Jdk = 1.8.0_111 | |
| Built-By = jenkins-maven |
This file contains hidden or 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 | |
| # @Dataset data | |
| # @String(label="Projection Type",choices={"Max","Mean","Median","Min", "StdDev", "Sum"}) proj_type | |
| from net.imagej.axis import Axes | |
| from net.imagej.ops import Ops | |
| def proj_method(method): |
This file contains hidden or 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 os | |
| import re | |
| from tracing import PathAndFillManager | |
| # An example script showing how to convert all the .traces | |
| # files in a directory to SWC files. (The .traces format | |
| # is the native file format of Simple Neurite Tracer.) | |
| def run(): | |
| d = IJ.getDirectory("Choose your directory of .traces files...") |
This file contains hidden or 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
| /* Polar_Plot_Demo.bsh | |
| * IJ BAR: https://github.com/tferr/Scripts#scripts | |
| * | |
| * Beanshell implementation of JFreeChart[1] PolarChartDemo[2] | |
| * | |
| * [1] http://www.jfree.org/jfreechart/api/javadoc/ | |
| * [2] http://www.java2s.com/Code/Java/Chart/JFreeChartPolarChartDemo.htm | |
| */ | |
| import ij.gui.GUI; |
This file contains hidden or 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
| /** | |
| * Retrieves the Checkbox of a RadioButtonGroup() in an ImageJ1 | |
| * GenericDialog associated with the specified label. | |
| */ | |
| Checkbox getRadioCheckbox(ij.gui.GenericDialog gd, String label) { | |
| Component[] gdComponents = gd.getComponents(); | |
| for (Component c1 : gdComponents) { | |
| if (c1 instanceof Panel) { | |
| Component[] c1Components = ((Panel) c1).getComponents(); | |
| for (Component c2 : c1Components) { |
This file contains hidden or 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
| function randomString(length, spacers) { | |
| template = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| nChars = lengthOf(template); | |
| string = ""; | |
| for (i=0; i<length; i++) { | |
| idx = maxOf(0, round(random()*nChars-1)); | |
| string += substring(template, idx, idx+1); | |
| if (spacers && i%5==0) string += "_"; | |
| } | |
| return string; |
This file contains hidden or 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.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| boolean validFile(String filename) { | |
| String FILE_PATTERN = "(.*(\\.(?i)(stk|tif))$)"; | |
| Pattern pattern = Pattern.compile(FILE_PATTERN); | |
| Matcher matcher = pattern.matcher(filename); | |
| return matcher.matches(); | |
| } |
This file contains hidden or 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
| // ImageJ1 macros that create X/Y mirrors of the active ROI | |
| // http://thread.gmane.org/gmane.comp.java.imagej/35570 | |
| macro "Contralateral in X [F1]" { | |
| mirrorROI(-1, 1); | |
| } | |
| macro "Contralateral in Y [F2]" { | |
| mirrorROI(1, -1); | |
| } |