Skip to content

Instantly share code, notes, and snippets.

View tinevez's full-sized avatar

Jean-Yves Tinevez tinevez

View GitHub Profile
Exception in thread "main" java.lang.IllegalArgumentException: Invalid service: net.imagej.legacy.LegacyService
at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:278)
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:229)
at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:192)
at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:164)
at org.scijava.Context.<init>(Context.java:285)
at org.scijava.Context.<init>(Context.java:234)
at org.scijava.Context.<init>(Context.java:130)
at org.scijava.Context.<init>(Context.java:117)
at org.scijava.Context.<init>(Context.java:106)
@tinevez
tinevez / TestDriveBinningOp.java
Created January 29, 2019 14:47
Demo for the binning op.
public class TestDriveBinningOp
{
@SuppressWarnings( "unchecked" )
public static < T extends RealType< T > > void main( final String[] args ) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException, IOException
{
Locale.setDefault( Locale.ROOT );
UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
final ImageJ ij = new ImageJ();
ij.launch( args );
@tinevez
tinevez / BinnerOp.java
Last active January 29, 2019 14:45
A binning op based on Image-Ops.
@Plugin( type = BinningOp.class )
public class BinningOp< T extends RealType< T > > extends AbstractUnaryFunctionOp< RandomAccessibleInterval< T >, Img< T > >
{
@Parameter( type = ItemIO.INPUT )
private int[] binfactors;
@Parameter( type = ItemIO.INPUT, required = false )
private Class< ? extends Op > ocClass = Ops.Stats.Mean.class;
@tinevez
tinevez / MaMuTExportExample.java
Last active December 28, 2017 16:32
Example of a two way export - reimport of a Model via MaMuT.
public static void main( final String[] args ) throws IOException, JDOMException, SpimDataException
{
/*
* 1. Load a regular Mastodon project.
*/
final String bdvFile = "samples/datasethdf5.xml";
final String modelFile = "samples/model_revised.raw";
final MamutProject project = new MamutProject( new File( "." ), new File( bdvFile ), new File( modelFile ) );
final Model model = new Model();
@tinevez
tinevez / gist:faba62f3ad4b678a21e27eaf9c725365
Created November 8, 2017 13:25
Hough circle demo error.
[ERROR] Exception during event handling:
[Event] org.scijava.module.event.ModulesAddedEvent
context = org.scijava.Context@5386659f
consumed = false
items[0] = class='org.scijava.plugins.commands.io.OpenFile', menu='File > Open Recent > ../../trax-MP-matlab...DH2_CAL_001-1.tif', priority=0.0, enabled=true, pluginType=Command, inputFile='../../trax-MP-matlab/trax-MP-test/2017-1-30_Vu_Sample/DH2_CAL_001-1.tif'
items[1] = class='org.scijava.plugins.commands.io.OpenFile', menu='File > Open Recent > samples/ca-01.lsm', priority=0.0, enabled=true, pluginType=Command, inputFile='samples/ca-01.lsm'
items[2] = class='org.scijava.plugins.commands.io.OpenFile', menu='File > Open Recent > ../../TrackMate/samples/FakeTracks.tif', priority=0.0, enabled=true, pluginType=Command, inputFile='../../TrackMate/samples/FakeTracks.tif'
items[3] = class='org.scijava.plugins.commands.io.OpenFile', menu='File > Open Recent > ...18-6_1.49_100x_zstack_3um_10z_002.tif', priority=0.0, enabled=true, pluginType=Command, inputFile='..
@tinevez
tinevez / CallTrackMateMultiChannel.py
Created October 30, 2017 13:44
Fiji Jython script to call TrackMate with the multi-channel analyser extra jar.
#@ ImagePlus imp
#@ 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
# This Python/ImageJ2 script shows how to use TrackMate for multi-channel
# analysis. It is derived from a Groovy script by Jan Eglinger, and uses