Skip to content

Instantly share code, notes, and snippets.

View ctrueden's full-sized avatar
🛸
Experiencing technical difficulties

Curtis Rueden ctrueden

🛸
Experiencing technical difficulties
View GitHub Profile
@ctrueden
ctrueden / SolidColors.java
Created April 12, 2012 15:31
An example of stepwise color tables with VisAD
//
// SolidColors.java
//
// An example of stepwise color tables with VisAD.
import java.awt.Color;
import java.awt.Component;
import java.rmi.RemoteException;
@ctrueden
ctrueden / output.txt
Created May 29, 2012 20:00
Example POM for use with versions:display-plugin-updates
$ mvn versions:display-plugin-updates
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:1.3.1:display-plugin-updates (default-cli) @ test ---
[INFO]
[INFO] The following plugin updates are available:
@ctrueden
ctrueden / exec.bsh
Created September 20, 2012 14:30
Simple Beanshell to execute command in ImageJ
import java.io.BufferedReader;
import java.io.InputStreamReader;
IJ.log("Executing command");
Process p = Runtime.getRuntime().exec("pwd");
p.waitFor();
IJ.log("Execution complete.");
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = in.readLine();
in.close();
IJ.log("Output: " + line);
@ctrueden
ctrueden / maven-cp.pl
Created September 21, 2012 16:14
Simple Perl script to obtain classpath for a given Maven GAV
#!/usr/bin/perl
#
# maven-cp.pl
#
# A script to output a Java classpath for the given Maven GAVs,
# including their dependencies.
# Requires command line mvn to be installed.
@ctrueden
ctrueden / ImageJ2Modules.java
Last active October 12, 2015 01:07
Fun with ImageJ2 modules
import imagej.ImageJ;
import imagej.core.commands.app.AboutImageJ;
import imagej.module.ModuleInfo;
import imagej.module.ModuleItem;
import imagej.module.ModulePreprocessor;
import imagej.plugin.InitPreprocessor;
import imagej.plugin.ServicePreprocessor;
import imagej.plugin.ValidityPreprocessor;
import java.util.ArrayList;
IJ=/Applications/Science/Fiji.app/Contents/MacOS/ImageJ-macosx
PATH=/Users/curtis/Desktop
$IJ -macro $PATH/macro1.ijm
read -n1 -r -p "Press any key to continue..." key
$IJ -macro $PATH/macro2.ijm
@ctrueden
ctrueden / github-pr-comments.pl
Created November 27, 2012 20:06
Recent comments for open PRs
#!/usr/bin/perl
use strict;
# github-pr-comments.pl: Proof of concept for listing recent
# comments for open PRs of a given repo.
# NB: Remember to authenticate first before running, or else you will
# quickly hit the API rate limit of 60 unauthenticated requests per hour.
@ctrueden
ctrueden / KeepDataStructureInSyncWithCurrentState.java
Last active December 12, 2015 00:39
Demonstrates how to keep a data structure in sync with the current state of ImageJ, both initially, and responding to later events.
import imagej.ImageJ;
import imagej.display.Display;
import imagej.display.event.DisplayCreatedEvent;
import imagej.event.EventHandler;
public class KeepDataStructureInSyncWithCurrentState {
private ImageJ ij;
public KeepDataStructureInSyncWithCurrentState(final ImageJ ij) {
@ctrueden
ctrueden / DialogScreenshot.png
Last active May 15, 2017 18:23
A demonstration of multiple choice parameters in ImageJ2.
DialogScreenshot.png
@ctrueden
ctrueden / actual-output.txt
Last active December 14, 2015 23:18
Localizing a ROI to a specific (C, Z, T) position
ROI #1: x=139 y=43 c=0 z=2 t=0
ROI #2: x=37 y=152 c=0 z=4 t=0