Skip to content

Commit

Permalink
Per Martin's suggestion, add support for more generic "include" trans…
Browse files Browse the repository at this point in the history
…form label that identifies transforms to be included in point match derivation. This fixes #140
  • Loading branch information
trautmane committed May 2, 2023
1 parent 9ca3fc9 commit 8d17532
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class TransformSpecMetaData implements Serializable {
/** The default label for a lens correction transform. */
public static final String LENS_CORRECTION_LABEL = "lens";

/** Indicates that the transform should be included when rendering tiles for point match derivation. */
public static final String INCLUDE_LABEL = "include";

private Set<String> labels;

public TransformSpecMetaData() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.janelia.render.service;

import java.net.UnknownHostException;
import java.util.Collections;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -331,10 +332,13 @@ static RenderParameters getCoreTileRenderParameters(final Integer xOffset,

} else if (useLegacyNormalization) {

if (tileSpec.hasTransformWithLabel(TransformSpecMetaData.LENS_CORRECTION_LABEL)) {
if (tileSpec.hasTransformWithLabel(TransformSpecMetaData.LENS_CORRECTION_LABEL) ||
tileSpec.hasTransformWithLabel(TransformSpecMetaData.INCLUDE_LABEL)) {

// Handle a legacy client request for a stack that has labelled transforms ...
tileSpec.flattenAndFilterTransforms(null, EXCLUDE_AFTER_LENS, null);
tileSpec.flattenAndFilterTransforms(null,
EXCLUDE_AFTER_LENS_OR_INCLUDE,
null);

} else {

Expand Down Expand Up @@ -457,6 +461,7 @@ private RenderParameters getRawTileRenderParameters(final String owner,

private static final Logger LOG = LoggerFactory.getLogger(TileDataService.class);

private static final Set<String> EXCLUDE_AFTER_LENS =
Collections.singleton(TransformSpecMetaData.LENS_CORRECTION_LABEL);
private static final Set<String> EXCLUDE_AFTER_LENS_OR_INCLUDE =
new HashSet<>(Arrays.asList(TransformSpecMetaData.LENS_CORRECTION_LABEL,
TransformSpecMetaData.INCLUDE_LABEL));
}

0 comments on commit 8d17532

Please sign in to comment.