Skip to content

Instantly share code, notes, and snippets.


Curtis Rueden ctrueden

View GitHub Profile
ctrueden / adoptopenjdk-11-1-JVMCI.log
Last active Jun 16, 2020
View adoptopenjdk-11-1-JVMCI.log
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/Users/curtis/code/imglib/imglib2/target/dependency/jmh-core-1.19.jar) to field
WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
# JMH version: 1.19
# VM version: JDK 11.0.2, VM 11.0.2+9
# VM invoker: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java
# VM options: -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler
# Warmup: 4 iterations, 200 ms each
ctrueden /
Last active Mar 1, 2022
Open images as numpy arrays using SCIFIO and Bio-Formats
#!/usr/bin/env python
# - Open images as numpy arrays using SCIFIO and Bio-Formats.
# -- Settings --
max_mem_mb = '6144'
scifio_lifesci = False
ctrueden /
Created Sep 22, 2019
How to diff the API of two JAR files
# TODO: Why doesn't this work
trap "exit" INT
die() {
echo "$1" 2>&1
exit 1
ctrueden / charting-extension.pom
Last active Sep 20, 2019
Unifying multiple POMs at different BOM versions
View charting-extension.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<name>Charting Plugin</name>
ctrueden / Vertical_Stacker.groovy
Created Sep 11, 2019
Create a vertical stack of images, each horizontally centered
View Vertical_Stacker.groovy
#@ ImageJ ij
#@ File[] imageFiles
#@ File(style = "save") outFile
#@ boolean showStack
import java.util.Arrays
import net.imglib2.FinalInterval
import net.imglib2.type.numeric.integer.UnsignedByteType
import net.imglib2.util.Intervals
ctrueden / Generative_Image.groovy
Created Jun 18, 2019
Generate an image from a function in ImageJ
View Generative_Image.groovy
#@ Long(value = 3000) size
import java.util.function.BiConsumer
import net.imglib2.img.display.imagej.ImageJFunctions
import net.imglib2.position.FunctionRandomAccessible
import net.imglib2.type.numeric.integer.UnsignedByteType
import net.imglib2.view.Views
// Define a function in 2-space.
ndim = 2
ctrueden /
Last active May 21, 2019
Import a cropped region of a 2D image using SCIFIO
#@ DatasetIOService dio
#@ File imageFile
#@ long x
#@ long y
#@ long width
#@ long height
#@output Dataset dataset
from io.scif.config import SCIFIOConfig
from io.scif.img import ImageRegion, Range
ctrueden / boofcv-seeded-watershed.groovy
Last active Mar 25, 2019
Seeded watershed in ImageJ using BoofCV
View boofcv-seeded-watershed.groovy
#@dependency(group="org.boofcv", module="boofcv-core", version="0.33")
#@dependency(group="org.boofcv", module="boofcv-swing", version="0.32")
#@both ImagePlus imp
#@output ImagePlus (label="Watersheds") watersheds
#@output ImagePlus (label="Regions") regions
#@output ImagePlus (label="Seeds") seeds
import boofcv.alg.filter.binary.BinaryImageOps
import boofcv.alg.filter.binary.ThresholdImageOps
ctrueden / ImageJ1-with-Jython-via-BeakerX.ipynb
Last active Mar 22, 2019
Use Jython to invoke ImageJ 1.x API in a BeakerX Groovy notebook
View ImageJ1-with-Jython-via-BeakerX.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ctrueden / Open-as-numpy-array-via-Bio-Formats.ipynb
Last active Apr 20, 2019
Open an image with Bio-Formats as a numpy array via pyimagej
View Open-as-numpy-array-via-Bio-Formats.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.