Skip to content

Instantly share code, notes, and snippets.

Avatar
🛸
Technology!

Curtis Rueden ctrueden

🛸
Technology!
View GitHub Profile
@ctrueden
ctrueden / adoptopenjdk-11-1-JVMCI.log
Last active Jun 16, 2020
net.imglib2.img.DirtyVolatileBenchmark
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 java.io.PrintStream.charOut
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
ctrueden / scifio.py
Last active Mar 1, 2022
Open images as numpy arrays using SCIFIO and Bio-Formats
View scifio.py
#!/usr/bin/env python
#
# scifio.py - Open images as numpy arrays using SCIFIO and Bio-Formats.
#
# -- Settings --
max_mem_mb = '6144'
scifio_lifesci = False
@ctrueden
ctrueden / apidiff.sh
Created Sep 22, 2019
How to diff the API of two JAR files
View apidiff.sh
#!/bin/sh
# TODO: Why doesn't this work
trap "exit" INT
die() {
echo "$1" 2>&1
exit 1
}
@ctrueden
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="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ij-env-test</groupId>
<artifactId>charting-extension</artifactId>
<packaging>pom</packaging>
<version>1</version>
<name>Charting Plugin</name>
@ctrueden
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
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
ctrueden / SCIFIO_Import_Region.py
Last active May 21, 2019
Import a cropped region of a 2D image using SCIFIO
View SCIFIO_Import_Region.py
#@ 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
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
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
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.