Skip to content

Commit

Permalink
update interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 25, 2024
1 parent 1a300eb commit 07cef6c
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions src/main/java/ai/nets/samj/communication/model/EfficientSAM.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.List;
Expand All @@ -35,6 +34,7 @@

import ai.nets.samj.models.AbstractSamJ;
import ai.nets.samj.models.EfficientSamJ;
import ai.nets.samj.annotation.Mask;
import ai.nets.samj.install.EfficientSamEnvManager;
import ai.nets.samj.install.SamEnvManagerAbstract;
import ai.nets.samj.ui.SAMJLogger;
Expand Down Expand Up @@ -159,7 +159,7 @@ public void setInstalled(boolean installed) {
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
throws IOException, InterruptedException, RuntimeException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -178,7 +178,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
Rectangle zoomedRectangle) throws IOException, RuntimeException, InterruptedException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -197,7 +197,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
public List<Mask> fetch2dSegmentation(Interval boundingBox2D)
throws IOException, InterruptedException, RuntimeException {
try {
//order to processBox() should be: x0,y0, x1,y1
Expand All @@ -218,7 +218,7 @@ public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
/**
* {@inheritDoc}
*/
public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
public <T extends RealType<T> & NativeType<T>> List<Mask> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
throws IOException, InterruptedException, RuntimeException {
try {
return efficientSamJ.processMask(rai, !onlyBiggest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.List;
Expand All @@ -35,6 +34,7 @@

import ai.nets.samj.models.AbstractSamJ;
import ai.nets.samj.models.EfficientViTSamJ;
import ai.nets.samj.annotation.Mask;
import ai.nets.samj.install.EfficientViTSamEnvManager;
import ai.nets.samj.install.SamEnvManagerAbstract;
import ai.nets.samj.ui.SAMJLogger;
Expand Down Expand Up @@ -158,7 +158,7 @@ public EfficientViTSAML0() throws IOException, RuntimeException, InterruptedExce
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
throws IOException, InterruptedException, RuntimeException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -174,7 +174,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
}

@Override
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
Rectangle zoomedRectangle) throws IOException, RuntimeException, InterruptedException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -193,7 +193,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
public List<Mask> fetch2dSegmentation(Interval boundingBox2D)
throws IOException, InterruptedException, RuntimeException {
try {
//order to processBox() should be: x0,y0, x1,y1
Expand All @@ -214,7 +214,7 @@ public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
/**
* {@inheritDoc}
*/
public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
public <T extends RealType<T> & NativeType<T>> List<Mask> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
throws IOException, InterruptedException, RuntimeException {
try {
return efficientSamJ.processMask(rai, !onlyBiggest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

import ai.nets.samj.annotation.Mask;
import ai.nets.samj.install.EfficientViTSamEnvManager;
import ai.nets.samj.install.SamEnvManagerAbstract;
import ai.nets.samj.models.AbstractSamJ;
Expand Down Expand Up @@ -158,7 +158,7 @@ public EfficientViTSAML1() throws IOException, RuntimeException, InterruptedExce
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
throws IOException, InterruptedException, RuntimeException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -174,7 +174,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
}

@Override
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
Rectangle zoomedRectangle) throws IOException, RuntimeException, InterruptedException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -193,7 +193,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
public List<Mask> fetch2dSegmentation(Interval boundingBox2D)
throws IOException, InterruptedException, RuntimeException {
try {
//order to processBox() should be: x0,y0, x1,y1
Expand All @@ -214,7 +214,7 @@ public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
/**
* {@inheritDoc}
*/
public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
public <T extends RealType<T> & NativeType<T>> List<Mask> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
throws IOException, InterruptedException, RuntimeException {
try {
return efficientSamJ.processMask(rai, !onlyBiggest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.List;
Expand All @@ -35,6 +34,7 @@

import ai.nets.samj.models.AbstractSamJ;
import ai.nets.samj.models.EfficientViTSamJ;
import ai.nets.samj.annotation.Mask;
import ai.nets.samj.install.EfficientViTSamEnvManager;
import ai.nets.samj.install.SamEnvManagerAbstract;
import ai.nets.samj.ui.SAMJLogger;
Expand Down Expand Up @@ -157,7 +157,7 @@ public EfficientViTSAML2() throws IOException, RuntimeException, InterruptedExce
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
throws IOException, InterruptedException, RuntimeException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -173,7 +173,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
}

@Override
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
Rectangle zoomedRectangle) throws IOException, RuntimeException, InterruptedException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -192,7 +192,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
public List<Mask> fetch2dSegmentation(Interval boundingBox2D)
throws IOException, InterruptedException, RuntimeException {
try {
//order to processBox() should be: x0,y0, x1,y1
Expand All @@ -213,7 +213,7 @@ public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
/**
* {@inheritDoc}
*/
public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
public <T extends RealType<T> & NativeType<T>> List<Mask> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
throws IOException, InterruptedException, RuntimeException {
try {
return efficientSamJ.processMask(rai, !onlyBiggest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.List;
Expand All @@ -35,6 +34,7 @@

import ai.nets.samj.models.AbstractSamJ;
import ai.nets.samj.models.EfficientViTSamJ;
import ai.nets.samj.annotation.Mask;
import ai.nets.samj.install.EfficientViTSamEnvManager;
import ai.nets.samj.install.SamEnvManagerAbstract;
import ai.nets.samj.ui.SAMJLogger;
Expand Down Expand Up @@ -157,7 +157,7 @@ public EfficientViTSAMXL0() throws IOException, RuntimeException, InterruptedExc
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
throws IOException, InterruptedException, RuntimeException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -173,7 +173,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
}

@Override
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
Rectangle zoomedRectangle) throws IOException, RuntimeException, InterruptedException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -192,7 +192,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
public List<Mask> fetch2dSegmentation(Interval boundingBox2D)
throws IOException, InterruptedException, RuntimeException {
try {
//order to processBox() should be: x0,y0, x1,y1
Expand All @@ -213,7 +213,7 @@ public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
/**
* {@inheritDoc}
*/
public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
public <T extends RealType<T> & NativeType<T>> List<Mask> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
throws IOException, InterruptedException, RuntimeException {
try {
return efficientSamJ.processMask(rai, !onlyBiggest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.List;
Expand All @@ -35,6 +34,7 @@

import ai.nets.samj.models.AbstractSamJ;
import ai.nets.samj.models.EfficientViTSamJ;
import ai.nets.samj.annotation.Mask;
import ai.nets.samj.install.EfficientViTSamEnvManager;
import ai.nets.samj.install.SamEnvManagerAbstract;
import ai.nets.samj.ui.SAMJLogger;
Expand Down Expand Up @@ -159,7 +159,7 @@ public EfficientViTSAMXL1() throws IOException, RuntimeException, InterruptedExc
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
throws IOException, InterruptedException, RuntimeException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -175,7 +175,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
}

@Override
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
Rectangle zoomedRectangle) throws IOException, RuntimeException, InterruptedException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -194,7 +194,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
public List<Mask> fetch2dSegmentation(Interval boundingBox2D)
throws IOException, InterruptedException, RuntimeException {
try {
//order to processBox() should be: x0,y0, x1,y1
Expand All @@ -215,7 +215,7 @@ public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
/**
* {@inheritDoc}
*/
public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
public <T extends RealType<T> & NativeType<T>> List<Mask> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
throws IOException, InterruptedException, RuntimeException {
try {
return efficientSamJ.processMask(rai, !onlyBiggest);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/ai/nets/samj/communication/model/SAM2Large.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import net.imglib2.type.numeric.RealType;
import net.imglib2.util.Cast;

import java.awt.Polygon;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.List;
Expand All @@ -35,6 +34,7 @@

import ai.nets.samj.models.AbstractSamJ;
import ai.nets.samj.models.Sam2;
import ai.nets.samj.annotation.Mask;
import ai.nets.samj.install.Sam2EnvManager;
import ai.nets.samj.install.SamEnvManagerAbstract;
import ai.nets.samj.ui.SAMJLogger;
Expand Down Expand Up @@ -158,7 +158,7 @@ public void setInstalled(boolean installed) {
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D)
throws IOException, InterruptedException, RuntimeException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -177,7 +177,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
public List<Mask> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<Localizable> listOfNegPoints2D,
Rectangle zoomedRectangle) throws IOException, RuntimeException, InterruptedException {
try {
List<int[]> list = listOfPoints2D.stream()
Expand All @@ -196,7 +196,7 @@ public List<Polygon> fetch2dSegmentation(List<Localizable> listOfPoints2D, List<
/**
* {@inheritDoc}
*/
public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
public List<Mask> fetch2dSegmentation(Interval boundingBox2D)
throws IOException, InterruptedException, RuntimeException {
try {
//order to processBox() should be: x0,y0, x1,y1
Expand All @@ -217,7 +217,7 @@ public List<Polygon> fetch2dSegmentation(Interval boundingBox2D)
/**
* {@inheritDoc}
*/
public <T extends RealType<T> & NativeType<T>> List<Polygon> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
public <T extends RealType<T> & NativeType<T>> List<Mask> fetch2dSegmentationFromMask(RandomAccessibleInterval<T> rai)
throws IOException, InterruptedException, RuntimeException {
try {
return efficientSamJ.processMask(rai, !onlyBiggest);
Expand Down
Loading

0 comments on commit 07cef6c

Please sign in to comment.