Skip to content
Snippets Groups Projects
Commit 898ed3c2 authored by Thomas  MUSSET's avatar Thomas MUSSET
Browse files

updated to v2.0.0-a.2, updated to Java 23

parent 5a11be25
No related branches found
Tags v2.0.0-a.2
No related merge requests found
......@@ -7,18 +7,11 @@
<parent>
<groupId>org.bioimageanalysis.icy</groupId>
<artifactId>pom-icy</artifactId>
<version>3.0.0-a.1</version>
<version>3.0.0-a.3</version>
</parent>
<artifactId>spot-detection-utilities</artifactId>
<version>2.0.0-a.1</version>
<version>2.0.0-a.2</version>
<name>Detection Utilities</name>
<repositories>
<repository>
<id>icy</id>
<url>https://nexus-icy.pasteur.cloud/repository/icy/</url>
</repository>
</repositories>
</project>
\ No newline at end of file
/*
* Copyright (c) 2010-2023. Institut Pasteur.
* Copyright (c) 2010-2024. Institut Pasteur.
*
* This file is part of Icy.
* Icy is free software: you can redistribute it and/or modify
......@@ -22,7 +22,7 @@ import org.bioimageanalysis.icy.common.reflect.ClassUtil;
import org.bioimageanalysis.icy.io.xml.XMLPersistent;
import org.bioimageanalysis.icy.io.xml.XMLUtil;
import org.bioimageanalysis.icy.model.overlay.Overlay;
import org.bioimageanalysis.icy.system.IcyExceptionHandler;
import org.bioimageanalysis.icy.system.logging.IcyLogger;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
......@@ -36,10 +36,8 @@ import java.lang.reflect.Constructor;
*/
public class Detection extends Overlay implements Cloneable, XMLPersistent {
@Override
public Object clone() throws CloneNotSupportedException {
final Detection clone = (Detection) super.clone();
clone.x = x;
......@@ -53,7 +51,6 @@ public class Detection extends Overlay implements Cloneable, XMLPersistent {
clone.originalColor = new Color(originalColor.getRGB());
return clone;
}
/**
......@@ -209,7 +206,6 @@ public class Detection extends Overlay implements Cloneable, XMLPersistent {
*/
@Override
public boolean loadFromXML(final Node node) {
final Element detectionElement = (Element) node;
x = XMLUtil.getAttributeDoubleValue(detectionElement, "x", 0);
......@@ -228,7 +224,6 @@ public class Detection extends Overlay implements Cloneable, XMLPersistent {
*/
@Override
public boolean saveToXML(final Node node) {
final Element detectionElement = (Element) node;
XMLUtil.setAttributeDoubleValue(detectionElement, "x", x);
......@@ -263,27 +258,18 @@ public class Detection extends Overlay implements Cloneable, XMLPersistent {
}
}
catch (final Exception e) {
System.err.println("********* TrackManager.createDetection('" + className + "', ...) error :");
IcyExceptionHandler.showErrorMessage(e, false);
System.err.println("The object is maybe not compatible (should have a default constructor with no arguments and extends Detection)");
System.err.println("Loading as a the default Detection object.");
IcyLogger.error(
Detection.class,
e,
"TrackManager.createDetection('" + className + "', ...)",
"The object is maybe not compatible (should have a default constructor with no arguments and extends Detection)"
);
IcyLogger.warn(Detection.class, "Loading as the default Detection object.");
// Load as a default detection.
result = new Detection();
}
return result;
}
}
/*
* Copyright (c) 2010-2023. Institut Pasteur.
* Copyright (c) 2010-2024. Institut Pasteur.
*
* This file is part of Icy.
* Icy is free software: you can redistribute it and/or modify
......@@ -25,7 +25,6 @@ import org.bioimageanalysis.icy.model.sequence.Sequence;
import java.util.TreeMap;
import java.util.Vector;
/**
* A class to manage detection results
*
......@@ -76,11 +75,11 @@ public class DetectionResult extends Plugin {
this.sourceSequence = seq;
}
@Override
/*@Override
protected void finalize() throws Throwable {
results.clear();
super.finalize();
}
}*/
public DetectionResult() {
results = new TreeMap<>();
......
/*
* Copyright (c) 2010-2023. Institut Pasteur.
* Copyright (c) 2010-2024. Institut Pasteur.
*
* This file is part of Icy.
* Icy is free software: you can redistribute it and/or modify
......@@ -18,10 +18,12 @@
package plugins.nchenouard.spot;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import java.awt.geom.Point2D;
public class Point3D {
@Override
public String toString() {
return "Point3D[" + x + "," + y + "," + z + "]";
......@@ -29,7 +31,9 @@ public class Point3D {
public double x, y, z;
@Contract(pure = true)
public Point3D() {
//
}
public Point3D(final double x, final double y, final double z) {
......@@ -44,7 +48,7 @@ public class Point3D {
this.z = 0;
}
public Point3D(final double[] coord) {
public Point3D(final double @NotNull [] coord) {
this.x = coord[0];
this.y = coord[1];
if (coord.length > 2)
......
/*
* Copyright (c) 2010-2023. Institut Pasteur.
* Copyright (c) 2010-2024. Institut Pasteur.
*
* This file is part of Icy.
* Icy is free software: you can redistribute it and/or modify
......@@ -18,7 +18,9 @@
package plugins.nchenouard.spot;
import org.bioimageanalysis.icy.system.IcyExceptionHandler;
import org.bioimageanalysis.icy.system.logging.IcyLogger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.PrintStream;
import java.text.NumberFormat;
......@@ -26,7 +28,6 @@ import java.text.ParseException;
import java.util.ArrayList;
public class Spot {
public Point3D mass_center;
public double minIntensity;
public double maxIntensity;
......@@ -60,7 +61,7 @@ public class Spot {
this.point3DList = new ArrayList<>(point3DList);
}
public static Spot load(String line) {
public static @Nullable Spot load(@NotNull String line) {
if (line.startsWith("detection")) {
String[] tmpTab = line.split("\\[");
tmpTab = tmpTab[1].split("]");
......@@ -75,7 +76,7 @@ public class Spot {
s.mass_center.z = nf.parse(coordinates[2]).intValue();
}
catch (final ParseException e) {
IcyExceptionHandler.showErrorMessage(e, true);
IcyLogger.error(Spot.class, e);
return null;
}
return s;
......@@ -84,7 +85,7 @@ public class Spot {
return null;
}
public void save(final PrintStream printOut, final int num) {
public void save(final @NotNull PrintStream printOut, final int num) {
printOut.print("detection{" + num + "} = [");
printOut.print(mass_center.x + ",");
printOut.print(mass_center.y + ",");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment