diff --git a/colormipsearch-api/src/main/java/org/janelia/colormipsearch/model/PublishedLMImageFields.java b/colormipsearch-api/src/main/java/org/janelia/colormipsearch/model/PublishedLMImageFields.java index 8b068b73..ec670697 100644 --- a/colormipsearch-api/src/main/java/org/janelia/colormipsearch/model/PublishedLMImageFields.java +++ b/colormipsearch-api/src/main/java/org/janelia/colormipsearch/model/PublishedLMImageFields.java @@ -87,6 +87,10 @@ public void setObjective(String objective) { this.objective = objective; } + public boolean hasObjective() { + return StringUtils.isNotBlank(objective); + } + public String getAlignmentSpace() { return alignmentSpace; } diff --git a/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/ColorDepthMIP.java b/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/ColorDepthMIP.java index 9706a437..fb46c4b7 100644 --- a/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/ColorDepthMIP.java +++ b/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/ColorDepthMIP.java @@ -104,6 +104,10 @@ public String lmObjective() { return objective; } + public boolean hasLmObjective() { + return StringUtils.isNotBlank(objective); + } + public boolean lmIsNotStaged() { if (sample == null) { // really cannot tell if the sample has been published to staging diff --git a/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/PublishedDataGetter.java b/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/PublishedDataGetter.java index c9bf5742..e9de4d11 100644 --- a/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/PublishedDataGetter.java +++ b/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/jacsdata/PublishedDataGetter.java @@ -81,6 +81,7 @@ private PublishedLMImage findPublishedImage(ColorDepthMIP colorDepthMIP, List pi.getAlignmentSpace().equals(colorDepthMIP.alignmentSpace) || (CollectionUtils.isNotEmpty(aliasesForAlignmentSpace) && aliasesForAlignmentSpace.contains(pi.getAlignmentSpace()))) + .filter(pi -> !pi.hasObjective() || !colorDepthMIP.hasLmObjective() || pi.getObjective().equals(colorDepthMIP.objective)) .findFirst() .orElseGet(() -> { LOG.warn("No published image found for {}:sample={}:as={}",