From f3b5cebaff6c1bae9b7f8d15ae52b2f1ddc2d629 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Wed, 4 Dec 2024 12:29:42 +0100 Subject: [PATCH] adapt until Fiji moves to the next scijava --- src/main/java/ai/nets/samj/gui/MainGUI.java | 3 ++- src/main/java/ai/nets/samj/models/AbstractSamJ.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/ai/nets/samj/gui/MainGUI.java b/src/main/java/ai/nets/samj/gui/MainGUI.java index 6d61c2d..9602bff 100644 --- a/src/main/java/ai/nets/samj/gui/MainGUI.java +++ b/src/main/java/ai/nets/samj/gui/MainGUI.java @@ -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; @@ -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; } diff --git a/src/main/java/ai/nets/samj/models/AbstractSamJ.java b/src/main/java/ai/nets/samj/models/AbstractSamJ.java index 8d63db5..365950c 100644 --- a/src/main/java/ai/nets/samj/models/AbstractSamJ.java +++ b/src/main/java/ai/nets/samj/models/AbstractSamJ.java @@ -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; /** @@ -582,7 +583,7 @@ void checkPrompts(List pointsList, List 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)