Skip to content

Commit

Permalink
Move OpenCVTypeAdapters to core-processing
Browse files Browse the repository at this point in the history
Addresses qupath#961
  • Loading branch information
petebankhead committed May 31, 2022
1 parent 6784de7 commit 42ffe78
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
import qupath.lib.roi.RoiTools;
import qupath.lib.roi.interfaces.ROI;
import qupath.opencv.dnn.DnnTools;
import qupath.opencv.io.OpenCVTypeAdapters;
import qupath.opencv.ml.objects.OpenCVMLClassifier;
import qupath.opencv.ml.objects.features.FeatureExtractors;
import qupath.opencv.ml.pixel.PixelClassifierTools;
Expand Down Expand Up @@ -216,6 +217,7 @@ public class QP {
.registerTypeAdapterFactory(PixelClassifiers.getTypeAdapterFactory())
.registerTypeAdapterFactory(FeatureExtractors.getTypeAdapterFactory())
.registerTypeAdapterFactory(ObjectClassifiers.getTypeAdapterFactory())
.registerTypeAdapterFactory(OpenCVTypeAdapters.getOpenCVTypeAdaptorFactory())
.registerTypeAdapter(ColorTransforms.ColorTransform.class, new ColorTransforms.ColorTransformTypeAdapter());

// Currently, the type adapters are registered within the class... so we need to initialize the class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* #L%
*/

package qupath.lib.io;
package qupath.opencv.io;

import java.io.IOException;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

import qupath.lib.common.GeneralTools;
import qupath.lib.io.GsonTools;
import qupath.lib.io.OpenCVTypeAdapters;
import qupath.lib.plugins.parameters.ParameterList;
import qupath.opencv.io.OpenCVTypeAdapters;
import qupath.opencv.tools.OpenCVTools;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import qupath.lib.analysis.stats.RunningStatistics;
import qupath.lib.classifiers.Normalization;
import qupath.lib.io.OpenCVTypeAdapters;
import qupath.opencv.io.OpenCVTypeAdapters;

/**
* Helper class for preprocessing input for machine learning algorithms using OpenCV Mats.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* #L%
*/

package qupath.lib.io;
package qupath.opencv.io;

import static org.junit.jupiter.api.Assertions.*;

Expand All @@ -38,6 +38,8 @@

import com.google.gson.GsonBuilder;

import qupath.opencv.io.OpenCVTypeAdapters;


@SuppressWarnings("javadoc")
public class TypeAdaptersCVTest {
Expand Down
1 change: 0 additions & 1 deletion qupath-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ description = "Core QuPath module containing the main classes and datastructures

configurations {
implementation.extendsFrom guava
implementation.extendsFrom opencv
}

dependencies {
Expand Down
1 change: 0 additions & 1 deletion qupath-core/src/main/java/qupath/lib/io/GsonTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public class GsonTools {
.serializeSpecialFloatingPointValues()
.setLenient()
.registerTypeAdapterFactory(new QuPathTypeAdapterFactory())
.registerTypeAdapterFactory(OpenCVTypeAdapters.getOpenCVTypeAdaptorFactory())
.registerTypeAdapter(AffineTransform.class, AffineTransformTypeAdapter.INSTANCE);
//.create();

Expand Down

0 comments on commit 42ffe78

Please sign in to comment.