Skip to content

Instantly share code, notes, and snippets.

🤓
💻 🏚 🧰 🚧 ⚠️ 💭 🎶 🔬 💖

Curtis Rueden ctrueden

🤓
💻 🏚 🧰 🚧 ⚠️ 💭 🎶 🔬 💖
Block or report user

Report or block ctrueden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ctrueden
ctrueden / scifio.py
Last active Oct 30, 2019
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.
@ctrueden
ctrueden / automatic-module-names.log
Created Mar 1, 2019
Fiji dependencies Automatic-Module-Name entries
View automatic-module-names.log
$ for jar in $(mvn dependency:build-classpath | grep -A1 'Dependencies classpath' | tail -n1 | gsed 's/:/\n/g') # C 1 {2019-03-01 16:41:33}
do
if [ -f "$jar" ]
then
autoModule=$(unzip -q -c "$jar" META-INF/MANIFEST.MF | grep 'Automatic-Module')
if [ "$autoModule" ]
then
echo "$jar: $autoModule"
# else
# echo "$jar: Automatic-Module ENTRY IS MISSING"
You can’t perform that action at this time.