Skip to content

Commit

Permalink
adapt until Fiji moves to the next scijava
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 4, 2024
1 parent b305e21 commit f3b5ceb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/ai/nets/samj/gui/MainGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.imglib2.type.numeric.IntegerType;
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;
import net.imglib2.util.Util;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
Expand Down Expand Up @@ -518,7 +519,7 @@ private < T extends RealType< T > & NativeType< T > > void batchSAMize() {
if (pointPrompts.size() == 0 && rectPrompts.size() == 0 && rai == null) {
lyt.show(cardPanel2_2, VISIBLE_STR);
return;
} else if (pointPrompts.size() == 0 && rectPrompts.size() == 0 && !(rai.getType() instanceof IntegerType)){
} else if (pointPrompts.size() == 0 && rectPrompts.size() == 0 && !(Util.getTypeFromInterval(rai) instanceof IntegerType)){
lyt.show(cardPanel2_2, VISIBLE_STR);
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ai/nets/samj/models/AbstractSamJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import net.imglib2.type.numeric.IntegerType;
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;
import net.imglib2.util.Util;
import net.imglib2.view.Views;

/**
Expand Down Expand Up @@ -582,7 +583,7 @@ void checkPrompts(List<int[]> pointsList, List<Rectangle> rects, RandomAccessibl
long[] dims;
if ((pointsList == null || pointsList.size() == 0)
&& (rects == null || rects.size() == 0)
&& rai != null && !(rai.getType() instanceof IntegerType)) {
&& rai != null && !(Util.getTypeFromInterval(rai) instanceof IntegerType)) {
throw new IllegalArgumentException("The mask provided should be of any integer type.");
} else if ((pointsList == null || pointsList.size() == 0)
&& (rects == null || rects.size() == 0)
Expand Down

0 comments on commit f3b5ceb

Please sign in to comment.