Skip to content

Instantly share code, notes, and snippets.

View imagejan's full-sized avatar

Jan Eglinger imagejan

  • Friedrich Miescher Institute for Biomedical Research (FMI)
  • Basel, Switzerland
  • X @jan_eglinger
View GitHub Profile
Verifying that +imagejan is my blockchain ID. https://onename.com/imagejan
@imagejan
imagejan / Dialog_Test.java
Created December 2, 2014 17:38
Slider and DialogListener demo
import ij.IJ;
import ij.gui.GenericDialog;
import ij.gui.DialogListener;
import ij.ImagePlus;
import ij.plugin.PlugIn;
import java.awt.AWTEvent;
import java.awt.Scrollbar;
public class Dialog_Test implements PlugIn, DialogListener {
private static GenericDialog gd;
# shamelessly hacked for Albert Cardona's example
from ij import WindowManager
from ij.plugin.frame import RoiManager
from ij.gui import PointRoi
from script.imglib.analysis import DoGPeaks
from script.imglib.color import Red
from script.imglib.algorithm import Scale3D
from script.imglib.math import Compute
from script.imglib import ImgLib

Keybase proof

I hereby claim:

  • I am imagejan on github.
  • I am imagejan (https://keybase.io/imagejan) on keybase.
  • I have a public key whose fingerprint is 1567 736C EB9C 249A F1B9 01AC 5C71 7F9B 3563 4393

To claim this, I am signing this object:

import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import java.awt.geom.*;
import java.util.*;
import ij.plugin.*;
import ij.measure.*;
public class Grid2_ implements PlugIn, DialogListener {
import ij.IJ
import ij.ImageStack
import ij.ImagePlus
import ij.gui.Line
import ij.gui.OvalRoi
import ij.gui.PolygonRoi
import java.awt.Polygon
import sc.fiji.analyzeSkeleton.AnalyzeSkeleton_
imp = IJ.createImage("Untitled", "8-bit black", 100, 100, 1)
@imagejan
imagejan / DotBlotMeasure.js
Created October 27, 2016 10:32
A javascript to measure a grid-like spot pattern in ImageJ
importClass(Packages.ij.IJ);
importClass(Packages.ij.measure.Measurements);
importClass(Packages.ij.measure.ResultsTable);
importClass(Packages.ij.plugin.filter.ParticleAnalyzer);
importClass(Packages.ij.plugin.frame.RoiManager);
importClass(Packages.java.lang.Double);
var diameter = 6000.0;
@imagejan
imagejan / Get_modules_and_scripts.groovy
Last active June 26, 2018 08:30
How to filter the list of available modules and scripts by input type
#@ ModuleService ms
#@ ScriptService ss
ms.getModules().each { module ->
module.inputs().each { input ->
if (input.getType() == java.io.File) {
println "Module $module"
}
}
}
@imagejan
imagejan / Run_TrackMate_Headless.groovy
Created September 19, 2017 07:39
Groovy script to start TrackMate without the UI wizard
#@ ImagePlus imp
#@ File (style = "directory", label = "Output folder") outputFolder
#@ String (label = "Output file name") filename
#@ double (label = "Spot radius", stepSize=0.1) radius
#@ double (label = "Quality threshold") threshold
#@ int (label = "Max frame gap") frameGap
#@ double (label = "Linking max distance") linkingMax
#@ double (label = "Gap-closing max distance") closingMax
import fiji.plugin.trackmate.Model
@imagejan
imagejan / IJ1_Snippets.groovy
Created April 19, 2018 12:42
Small Groovy code snippets useful when working with ImagePlus and other IJ1 classes
import ij.WindowManager
/**
* Get all open images as list of {@code ImagePlus}
*/
def getImagesAsList() {
count = WindowManager.getImageCount()
return (1..count).collect { WindowManager.getImage(it) }
}