diff --git a/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java b/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java index cb7ae5c0a..b8aa92b4b 100755 --- a/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java +++ b/dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java @@ -30,6 +30,7 @@ import pt.ua.dicoogle.sdk.datastructs.Report; import pt.ua.dicoogle.sdk.datastructs.SearchResult; import pt.ua.dicoogle.sdk.datastructs.dim.DimLevel; +import pt.ua.dicoogle.sdk.imageworker.ImageWorkerInterface; import pt.ua.dicoogle.sdk.settings.ConfigurationHolder; import pt.ua.dicoogle.sdk.task.JointQueryTask; import pt.ua.dicoogle.sdk.task.Task; @@ -344,6 +345,19 @@ public Collection getServletPlugins() { return this.getServletPlugins(true); } + public Collection getImageWorkerPlugins(boolean onlyEnabled) { + List plugins = new ArrayList<>(); + for (PluginSet pSet : pluginSets) { + for (ImageWorkerInterface i : pSet.getImageWorkerPlugins()) { + if (!i.isEnabled() && onlyEnabled) { + continue; + } + plugins.add(i); + } + } + return plugins; + } + public Collection getPluginSetNames() { Collection l = new ArrayList<>(); for (PluginSet s : this.pluginSets) { @@ -512,6 +526,17 @@ public StorageInterface getStorageByName(String name, boolean onlyEnabled) { return null; } + public ImageWorkerInterface getImageWorkerInterfaceByName(String name, boolean onlyEnabled) { + Collection plugins = getImageWorkerPlugins(onlyEnabled); + for (ImageWorkerInterface p : plugins) { + if (p.getName().equalsIgnoreCase(name)) { + // logger.info("Retrived Query Provider: "+name); + return p; + } + } + logger.debug("No image worker matching name {} for onlyEnabled = {}", name, onlyEnabled); + return null; + } public JointQueryTask queryAll(JointQueryTask holder, final String query, final Object... parameters) { List providers = this.getQueryProvidersName(true); diff --git a/sdk/pom.xml b/sdk/pom.xml index 57c6c3d1c..a2e3e4f4f 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -174,6 +174,12 @@ ${dcm4che.version} + + dcm4che-core + org.dcm4che + 3.3.7 + + dcm4che dcm4che-net diff --git a/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageROI.java b/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageROI.java index 8f5222d3f..4ac85de70 100644 --- a/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageROI.java +++ b/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageROI.java @@ -10,4 +10,33 @@ public class ImageROI { private URI roi; + public ImageROI(int width, int height, URI roi) { + this.width = width; + this.height = height; + this.roi = roi; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + + public URI getRoi() { + return roi; + } + + public void setRoi(URI roi) { + this.roi = roi; + } } diff --git a/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageWorkerInterface.java b/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageWorkerInterface.java index c25c46832..b0e4b62eb 100644 --- a/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageWorkerInterface.java +++ b/sdk/src/main/java/pt/ua/dicoogle/sdk/imageworker/ImageWorkerInterface.java @@ -1,11 +1,11 @@ package pt.ua.dicoogle.sdk.imageworker; -import org.dcm4che2.io.DicomInputStream; +import pt.ua.dicoogle.sdk.DicooglePlugin; +import pt.ua.dicoogle.sdk.datastructs.SearchResult; import pt.ua.dicoogle.sdk.datastructs.dim.BulkAnnotation; -public abstract class ImageWorkerInterface { +public interface ImageWorkerInterface extends DicooglePlugin { + public abstract ImageROI extractROI(SearchResult sr, BulkAnnotation annotation); - public abstract ImageROI extractROI(DicomInputStream is, BulkAnnotation annotation); - - public abstract Iterable extractROIs(DicomInputStream is, Iterable annotations); + public abstract Iterable extractROIs(SearchResult sr, Iterable annotations); }