Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: switch from IJ1 plugins to IJ2 plugins #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/main/java/bdv/ij/ApplyBigwarpPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
import org.janelia.saalfeldlab.n5.imglib2.N5Utils;
import org.janelia.saalfeldlab.n5.metadata.N5CosemMetadata;
import org.janelia.saalfeldlab.n5.metadata.N5CosemMetadataParser;
import org.scijava.command.Command;
import org.scijava.plugin.Plugin;

import bdv.export.ProgressWriter;
import bdv.gui.TransformTypeSelectDialog;
Expand All @@ -63,7 +65,6 @@
import ij.ImageJ;
import ij.ImagePlus;
import ij.WindowManager;
import ij.plugin.PlugIn;
import mpicbg.spim.data.sequence.VoxelDimensions;
import net.imglib2.FinalInterval;
import net.imglib2.Interval;
Expand All @@ -87,7 +88,10 @@
* Apply a bigwarp transform to a 2d or 3d ImagePlus
*
*/
public class ApplyBigwarpPlugin implements PlugIn
@Plugin(type= Command.class,
menuPath = "Plugins>BigDataViewer>Big Warp Apply"
)
public class ApplyBigwarpPlugin implements Command
{
public static final String TARGET = "Target";
public static final String MOVING = "Moving";
Expand All @@ -103,7 +107,7 @@ public class ApplyBigwarpPlugin implements PlugIn
public static void main( String[] args ) throws IOException
{
new ImageJ();
new ApplyBigwarpPlugin().run( "" );
new ApplyBigwarpPlugin().run();
}

public static boolean validateInput(
Expand Down Expand Up @@ -954,7 +958,7 @@ public static <S, T extends NativeType<T> & NumericType<T>> void runN5Export(
}

@Override
public void run( String arg )
public void run()
{
if ( IJ.versionLessThan( "1.40" ) )
return;
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/bdv/ij/BigWarpImagePlusPlugIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import java.io.IOException;

import org.janelia.utility.ui.RepeatingReleasedEventsFixer;
import org.scijava.command.Command;
import org.scijava.plugin.Plugin;

import bdv.ij.util.ProgressWriterIJ;
import bigwarp.BigWarp;
Expand All @@ -35,7 +37,6 @@
import ij.ImageJ;
import ij.ImagePlus;
import ij.WindowManager;
import ij.plugin.PlugIn;
import mpicbg.spim.data.SpimData;
import mpicbg.spim.data.SpimDataException;

Expand All @@ -46,7 +47,10 @@
* @author Tobias Pietzsch &lt;tobias.pietzsch@gmail.com&gt;
* @author Stephan Saalfeld &lt;saalfelds@janelia.hhmi.org&gt;
*/
public class BigWarpImagePlusPlugIn implements PlugIn
@Plugin(type = Command.class,
menuPath = "Plugins>BigDataViewer>Big Warp"
)
public class BigWarpImagePlusPlugIn implements Command
{

private ImagePlus movingIp;
Expand All @@ -56,11 +60,11 @@ public static void main( final String[] args ) throws IOException
{
new ImageJ();
IJ.run("Boats (356K)");
new BigWarpImagePlusPlugIn().run( null );
new BigWarpImagePlusPlugIn().run();
}

@Override
public void run( final String arg )
public void run()
{
if ( IJ.versionLessThan( "1.40" ) ) return;

Expand Down
12 changes: 8 additions & 4 deletions src/main/java/bdv/ij/BigWarpToDeformationFieldPlugIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import org.janelia.saalfeldlab.n5.ij.N5Exporter;
import org.janelia.saalfeldlab.n5.ij.N5Factory;
import org.janelia.saalfeldlab.n5.imglib2.N5DisplacementField;
import org.scijava.command.Command;
import org.scijava.plugin.Plugin;

import bdv.viewer.SourceAndConverter;
import bigwarp.BigWarpExporter;
Expand All @@ -51,7 +53,6 @@
import ij.ImageJ;
import ij.ImagePlus;
import ij.WindowManager;
import ij.plugin.PlugIn;
import jitk.spline.ThinPlateR2LogRSplineKernelTransform;
import mpicbg.spim.data.sequence.VoxelDimensions;
import net.imglib2.Cursor;
Expand Down Expand Up @@ -85,7 +86,10 @@
* @author Tobias Pietzsch &lt;tobias.pietzsch@gmail.com&gt;
* @author Stephan Saalfeld &lt;saalfelds@janelia.hhmi.org&gt;
*/
public class BigWarpToDeformationFieldPlugIn implements PlugIn
@Plugin(type= Command.class,
menuPath = "Plugins>BigDataViewer>Big Warp to Displacement field"
)
public class BigWarpToDeformationFieldPlugIn implements Command
{
public static final String[] compressionOptions = new String[] {
N5Exporter.RAW_COMPRESSION,
Expand All @@ -103,7 +107,7 @@ public static void main( final String[] args )
// imp.show();

WindowManager.getActiveWindow();
new BigWarpToDeformationFieldPlugIn().run( null );
new BigWarpToDeformationFieldPlugIn().run();
}

public <T> void runFromBigWarpInstance(
Expand Down Expand Up @@ -165,7 +169,7 @@ public <T> void runFromBigWarpInstance(
}

@Override
public void run( final String arg )
public void run()
{
if ( IJ.versionLessThan( "1.40" ) )
return;
Expand Down
35 changes: 0 additions & 35 deletions src/main/resources/plugins.config

This file was deleted.