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
/* | |
* IJ BAR: https://github.com/tferr/Scripts#scripts | |
* | |
* Performs a t-test between two open images (http://thread.gmane.org/gmane.comp.java.imagej/35266) using | |
* commons-math: | |
* http://commons.apache.org/proper/commons-math/userguide/stat.html | |
* http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/stat/inference/TTest.html | |
* | |
*/ |
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
// yet another multichannel profile plotter | |
// with smart(?) lookuptables | |
Stack.getDimensions(w, h, c, z, t); | |
p = getProfile(); | |
getStatistics(null, null, min, max); | |
Plot.create("Multi-Channel Profile Plot", "Distance (pixels)", "Value"); | |
Plot.setLimits(0,p.length,min,max); | |
for (i=1;i<=c;i++) { | |
Stack.setChannel(i); |
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
// 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); | |
} |
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.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 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 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 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 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 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 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 |
OlderNewer