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 / exclusions.xml
Created December 10, 2014 16:31
Fiji's Maven Enforcer banDuplicateClasses exclusions
<dependencies>
<dependency>
<artifactId>VIB-lib</artifactId>
<ignoreClasses>
<ignoreClass>javax/media/j3d/*</ignoreClass>
</ignoreClasses>
</dependency>
<dependency>
<artifactId>j3d-core</artifactId>
<ignoreClasses>
@ctrueden
ctrueden / gist:cd739ae1c9e34efc72ed
Created January 23, 2015 11:59
What uses net.imglib2.roi?
: curtis@sirius ~/code »
ag net.imglib2.roi
cellprofiler/CellProfiler/imagej/tests/test_imagej2.py:347: "()Lnet/imglib2/roi/RegionOfInterest;")
cellprofiler/CellProfiler/imagej/imagej2.py:777: "net/imglib2/roi/BinaryMaskRegionOfInterest",
cellprofiler/CellProfiler/imagej/imagej2.py:781: "(Lorg/scijava/Context;Lnet/imglib2/roi/BinaryMaskRegionOfInterest;)V",
cellprofiler/CellProfiler/java/src/main/java/org/cellprofiler/ijutils/OverlayUtils.java:30:import net.imglib2.roi.IterableRegionOfInterest;
cellprofiler/CellProfiler/java/src/main/java/org/cellprofiler/ijutils/OverlayUtils.java:31:import net.imglib2.roi.RegionOfInterest;
cellprofiler/CellProfiler/java/src/test/java/org/cellprofiler/ijutils/TestOverlayUtils.java:36:import net.imglib2.roi.AbstractRegionOfInterest;
cellprofiler/CellProfiler/java/src/test/java/org/cellprofiler/ijutils/TestOverlayUtils.java:37:import net.imglib2.roi.RegionOfInterest;
fiji/Colocalisation_Analysis/src/main/java/algorithms/CostesSignificanceTest.
@ctrueden
ctrueden / GenericTyping.java
Created January 24, 2015 16:56
A demonstration of some challenges of recursive typing.
/** A demonstration of some challenges of recursive typing. */
public class GenericTyping {
// -- "Low-level" classes with generic parameters --
public static interface Generic<T> {
// Object with a non-recursive generic parameter.
}
public static interface Recursive<T extends Recursive<T>> {
@ctrueden
ctrueden / ImgTyping.java
Created January 24, 2015 17:03
How to have a list of Imgs of mixed type
import java.util.ArrayList;
import java.util.List;
import net.imglib2.img.Img;
import net.imglib2.type.numeric.RealType;
/** How to have a list of {@link Img}s of mixed type. */
public class ImgTyping {
public void go() {
@ctrueden
ctrueden / javas.txt
Created January 26, 2015 00:06
My Java installations
java-info === Which versions of Java are installed? ===
+ /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
54M /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
+ /Library/Java/JavaVirtualMachines/1.6.0_45-b06-451.jdk/Contents/Home/bin/java -version
java version "1.6.0_45"
@ctrueden
ctrueden / edges.ijm
Created February 9, 2015 22:00
Really hacky border analysis macro
setBatchMode(true);
run("ROI Map");
roiMap = getImageID();
run("Duplicate...", " ");
run("8-bit");
run("Find Edges");
edgeMap = getImageID();
// convert edges image to array
edges = newArray(getWidth() * getHeight());
@ctrueden
ctrueden / batch-process-multi-series.ijm
Created February 17, 2015 17:36
A example of how to batch process image files with multiple image series each.
// A macro template for batch processing multi-series images.
function processImage(path, series) {
IJ.log("Processing " + path + "...");
run("Bio-Formats Importer",
"open=[" + path + "] " +
"autoscale " +
"color_mode=Grayscale " +
"view=Hyperstack " +
"stack_order=XYCZT " +
@ctrueden
ctrueden / find-interface-impls.sh
Created February 20, 2015 16:39
A script to find Java classes which implement a particular interface
# Finds Java classes that implement the given interface.
#
# E.g.: find-interface-impls.sh ij.plugin.PlugIn ij-1.49m.jar
usage() {
echo "Usage: find-interface-impls.sh interface jar1 [jar2 ...]"
}
iface="$1"
shift
@ctrueden
ctrueden / stack-trace.txt
Created March 5, 2015 20:48
Transformation of large OME-XML can take awhile
"main" #1 prio=5 os_prio=31 tid=0x00007fd10c801000 nid=0xf07 runnable [0x00000001041c2000]
java.lang.Thread.State: RUNNABLE
at org.apache.xpath.patterns.NodeTest.execute(NodeTest.java:576)
at org.apache.xpath.axes.PredicatedNodeTest.acceptNode(PredicatedNodeTest.java:470)
at org.apache.xpath.axes.AxesWalker.nextNode(AxesWalker.java:372)
at org.apache.xpath.axes.WalkingIterator.nextNode(WalkingIterator.java:195)
at org.apache.xpath.axes.NodeSequence.nextNode(NodeSequence.java:335)
at org.apache.xpath.axes.NodeSequence.runTo(NodeSequence.java:494)
at org.apache.xpath.axes.NodeSequence.setRoot(NodeSequence.java:270)
at org.apache.xpath.axes.LocPathIterator.asIterator(LocPathIterator.java:269)
@ctrueden
ctrueden / Indexer-0.log
Created March 11, 2015 19:06
Unhappy OMERO indexer
2015-03-11 14:06:00,019 ERROR [ org.quartz.core.JobRunShell] (2-thread-3) Job DEFAULT.fullTextThreadRun threw an unhandled Exception:
org.springframework.scheduling.quartz.JobMethodInvocationFailedException: Invocation of method 'run' on target class [class ome.services.fulltext.FullTextThread] failed; nested exception is ome.conditions.ApiUsageException: PreparedStatementCallback; bad SQL grammar [SELECT distinct last_value(id) over w as eid, entitytype, entityid, last_value(action) over w, count(id) over w as series FROM eventlog WHERE id > ? and action in (?, ?, ?, ?) AND entitytype in (?, ?, ?, ?, ?) WINDOW w AS ( PARTITION BY entitytype, entityid ORDER BY id range between unbounded preceding and unbounded following ) ORDER BY eid asc limit ?]; nested exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near "over"
Position: 32
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBe