diff --git a/src/main/java/com/indago/tr2d/plugins/seg/LabkitPanel.java b/src/main/java/com/indago/tr2d/plugins/seg/LabkitPanel.java index 72cffd1..71f8741 100644 --- a/src/main/java/com/indago/tr2d/plugins/seg/LabkitPanel.java +++ b/src/main/java/com/indago/tr2d/plugins/seg/LabkitPanel.java @@ -1,3 +1,4 @@ + package com.indago.tr2d.plugins.seg; import com.indago.tr2d.ui.model.Tr2dModel; @@ -21,14 +22,17 @@ public class LabkitPanel { public LabkitPanel(Context context, Tr2dModel model, Logger log) { this.log = log; boolean isTimeSeries = true; - segmentation = createSegmentationComponent( context, model, isTimeSeries ); + segmentation = createSegmentationComponent(context, model, isTimeSeries); } - private SegmentationComponent createSegmentationComponent( Context context, Tr2dModel model, boolean isTimeSeries ) + private SegmentationComponent createSegmentationComponent(Context context, + Tr2dModel model, boolean isTimeSeries) { try { - return new SegmentationComponent( context, null, model.getRawData(), isTimeSeries ); - } catch ( NoClassDefFoundError e ) { + return new SegmentationComponent(context, null, model.getRawData(), + isTimeSeries); + } + catch (NoClassDefFoundError e) { return null; } } @@ -38,16 +42,15 @@ public JPanel getPanel() { JButton store = new JButton("recalculate"); store.addActionListener(l -> this.calculateOutputs()); panel.setLayout(new BorderLayout()); - if( isUsable() ) - panel.add( segmentation.getComponent()); + if (isUsable()) panel.add(segmentation.getComponent()); panel.add(store, BorderLayout.PAGE_END); return panel; } private void calculateOutputs() { - outputs = isUsable() && segmentation.isTrained() ? - Collections.singletonList( segmentation.getSegmentation(new IntType())) : - Collections.emptyList(); + outputs = isUsable() && segmentation.isTrained() ? Collections + .singletonList(segmentation.getSegmentation(new IntType())) : Collections + .emptyList(); } public boolean isUsable() { @@ -55,8 +58,7 @@ public boolean isUsable() { } public List> getOutputs() { - if(outputs == null || outputs.isEmpty()) - calculateOutputs(); + if (outputs == null || outputs.isEmpty()) calculateOutputs(); return outputs; } } diff --git a/src/main/java/com/indago/tr2d/plugins/seg/LabkitPlugin.java b/src/main/java/com/indago/tr2d/plugins/seg/LabkitPlugin.java index 8f55f00..25e0ca4 100644 --- a/src/main/java/com/indago/tr2d/plugins/seg/LabkitPlugin.java +++ b/src/main/java/com/indago/tr2d/plugins/seg/LabkitPlugin.java @@ -1,6 +1,7 @@ /** * */ + package com.indago.tr2d.plugins.seg; import com.indago.IndagoLog; @@ -18,7 +19,7 @@ /** * @author Matthias Arzt */ -@Plugin( type = Tr2dSegmentationPlugin.class, name = "Tr2d Labkit Segmentation" ) +@Plugin(type = Tr2dSegmentationPlugin.class, name = "Tr2d Labkit Segmentation") public class LabkitPlugin implements Tr2dSegmentationPlugin { @Parameter @@ -34,12 +35,12 @@ public JPanel getInteractionPanel() { } @Override - public List< RandomAccessibleInterval< IntType > > getOutputs() { + public List> getOutputs() { return panel.getOutputs(); } @Override - public void setTr2dModel( final Tr2dModel model ) { + public void setTr2dModel(final Tr2dModel model) { this.panel = new LabkitPanel(context, model, log); } diff --git a/src/test/java/com/indago/tr2d/plugins/seg/LabkitPluginDemo.java b/src/test/java/com/indago/tr2d/plugins/seg/LabkitPluginDemo.java index 3fa4d28..14f3f2b 100644 --- a/src/test/java/com/indago/tr2d/plugins/seg/LabkitPluginDemo.java +++ b/src/test/java/com/indago/tr2d/plugins/seg/LabkitPluginDemo.java @@ -1,3 +1,4 @@ + package com.indago.tr2d.plugins.seg; import com.indago.io.ProjectFolder; @@ -53,7 +54,7 @@ private static Tr2dModel getTr2dModel() throws IOException { } private static JFrame setupFrame() { - JFrame frame = new JFrame("Tr2d Labkit Segmentation Plugin Demo") ; + JFrame frame = new JFrame("Tr2d Labkit Segmentation Plugin Demo"); frame.setSize(1000, 1000); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); return frame; diff --git a/src/test/java/com/indago/tr2d/plugins/seg/Main.java b/src/test/java/com/indago/tr2d/plugins/seg/Main.java index d9206cf..4ff5d3c 100644 --- a/src/test/java/com/indago/tr2d/plugins/seg/Main.java +++ b/src/test/java/com/indago/tr2d/plugins/seg/Main.java @@ -1,3 +1,4 @@ + package com.indago.tr2d.plugins.seg; import net.imagej.ops.OpService; @@ -5,17 +6,18 @@ import net.imagej.ops.thread.chunker.CursorBasedChunk; import org.scijava.Context; - public class Main { public static void main(String... args) { Context context = new Context(); - context.service(OpService.class).run(ChunkerOp.class, new CursorBasedChunk() { - @Override - public void execute(final int startIndex, final int stepSize, - final int numSteps) + context.service(OpService.class).run(ChunkerOp.class, + new CursorBasedChunk() { - } - }, 100); + + @Override + public void execute(final int startIndex, final int stepSize, + final int numSteps) + {} + }, 100); } }