Skip to content

Commit

Permalink
remove artifacts used for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Oct 27, 2023
1 parent 3a71e9a commit da48ed2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 37 deletions.
19 changes: 1 addition & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,7 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>
</properties>
<!--
<repositories>
<repository>
<id>scijava.public</id>
<url>https://maven.scijava.org/content/groups/public</url>
</repository>
</repositories>
-->

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand All @@ -138,15 +131,5 @@
<artifactId>jackson-dataformat-msgpack</artifactId>
<version>0.9.5</version>
</dependency>
<!--
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-ij</artifactId>
</dependency>
<dependency>
<groupId>net.imagej</groupId>
<artifactId>imagej</artifactId>
</dependency>
-->
</dependencies>
</project>
19 changes: 1 addition & 18 deletions src/main/java/io/bioimage/modelrunner/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import java.util.stream.IntStream;
import java.util.stream.LongStream;

import ij.IJ;
import ij.ImagePlus;
import io.bioimage.modelrunner.bioimageio.bioengine.BioEngineAvailableModels;
import io.bioimage.modelrunner.bioimageio.bioengine.BioengineInterface;
import io.bioimage.modelrunner.bioimageio.description.ModelDescriptor;
Expand All @@ -58,7 +56,6 @@
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgs;
import net.imglib2.img.display.imagej.ImageJFunctions;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;
import net.imglib2.type.numeric.real.FloatType;
Expand Down Expand Up @@ -645,27 +642,13 @@ void doTiling(List<Tensor<R>> inputTensors, List<Tensor<T>> outputTensors, Patch
public static <T extends NativeType<T> & RealType<T>> void main(String[] args) throws IOException, ModelSpecsException, LoadEngineException, RunModelException, LoadModelException {
String mm = "C:\\Users\\angel\\OneDrive\\Documentos\\pasteur\\git\\model-runner-java\\models\\\\EnhancerMitochondriaEM2D_22092023_133921\\";
Img<FloatType> im = ArrayImgs.floats(new long[] {1, 1, 512, 512});
ImagePlus imp = IJ.openImage(mm + File.separator + "sample_input_0.tif");
imp.show();
RandomAccessibleInterval<FloatType> wrapImg = ImageJFunctions.convertFloat(imp);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.addDimension(wrapImg, 0, 0);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.addDimension(wrapImg, 0, 0);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.permute(wrapImg, 2, 3);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.permute(wrapImg, 1, 2);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.permute(wrapImg, 0, 1);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.permute(wrapImg, 2, 3);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.permute(wrapImg, 1, 2);
List<Tensor<T>> l = new ArrayList<Tensor<T>>();
l.add((Tensor<T>) Tensor.build("input0", "bcyx", wrapImg));
l.add((Tensor<T>) Tensor.build("input0", "bcyx", im));
Model model = createBioimageioModel(mm);
model.loadModel();
Map<String, int[]> tilingList = new LinkedHashMap<String, int[]>();
tilingList.put("input0", new int[] {1, 1, 256, 256});
List<Tensor<T>> out = model.runBioimageioModelOnImgLib2WithTiling(l, tilingList);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.dropSingletonDimensions(out.get(0).getData());
wrapImg = (RandomAccessibleInterval<FloatType>) Views.permute(wrapImg, 0, 2);
wrapImg = (RandomAccessibleInterval<FloatType>) Views.permute(wrapImg, 0, 1);
ImageJFunctions.show(wrapImg);
System.out.println(false);
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/bioimage/modelrunner/tensor/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import net.imglib2.Point;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.img.display.imagej.ImageJFunctions;
import net.imglib2.transform.integer.MixedTransform;
import net.imglib2.type.numeric.NumericType;
import net.imglib2.type.numeric.RealType;
Expand Down

0 comments on commit da48ed2

Please sign in to comment.