Skip to content

Commit

Permalink
remove obsolete all pairs count check that was causing same layer mon…
Browse files Browse the repository at this point in the history
…tage patch pairs to get dropped
  • Loading branch information
trautmane committed Jul 24, 2023
1 parent 7aa1140 commit 6762595
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ public void updatePositionPairDataForZ(final String stack,
final RenderDataClient matchClient)
throws IOException {

LOG.info("updatePositionPairDataForZ: entry, stack={}, z={}", stack, z);
LOG.info("updatePositionPairDataForZ: entry, stack={}, z={}, sectionIds={}, pTileIdPrefixForRun={}, qTileIdPrefixForRun={}",
stack, z, sectionIds, patch.pTileIdPrefixForRun, patch.qTileIdPrefixForRun);

final ResolvedTileSpecCollection resolvedTiles = renderDataClient.getResolvedTiles(stack, z);

Expand Down Expand Up @@ -288,7 +289,15 @@ public void updatePositionPairDataForZ(final String stack,
final String indexPairName = Utilities.getSFOVIndexPairName(p.getGroupId(),
p.getId(),
unconnectedPair.getQ().getId());
positionPairMatchData.addSameLayerPair(sameLayerPairsFromOtherMFOVs.get(indexPairName));
final OrderedCanvasIdPair sameLayerPair = sameLayerPairsFromOtherMFOVs.get(indexPairName);
if (sameLayerPair == null) {
LOG.info("updatePositionPairDataForZ: no same layer pair found for unconnected pair {}",
unconnectedPair);
} else {
LOG.info("updatePositionPairDataForZ: using same layer pair {} for unconnected pair {}",
sameLayerPair, unconnectedPair);
positionPairMatchData.addSameLayerPair(sameLayerPair);
}
}

LOG.info("updatePositionPairDataForZ: exit, found {} unconnected tile pairs within mFOV {} in z {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,29 +119,28 @@ public List<CanvasMatches> deriveMatchesForUnconnectedPairs(final RenderDataClie

final List<CanvasMatches> derivedMatchesList = new ArrayList<>();

if ((unconnectedPairsForPosition.size() == 0) ||
(allPairsForPosition.size() <= unconnectedPairsForPosition.size())) {
LOG.warn("nothing to derive for " + this);
return derivedMatchesList;
}
if (unconnectedPairsForPosition.size() > 0) {

// if same layer matching is requested, first try to patch with same layer matches
final Set<OrderedCanvasIdPair> unconnectedPairsWithSameLayerSubstitute;
if (sameLayerDerivedMatchWeight != null) {
unconnectedPairsWithSameLayerSubstitute =
deriveMatchesUsingDataFromSameLayer(matchClient,
sameLayerDerivedMatchWeight,
derivedMatchesList);
} else {
unconnectedPairsWithSameLayerSubstitute = new HashSet<>();
}

// if same layer matching is requested, first try to patch with same layer matches
final Set<OrderedCanvasIdPair> unconnectedPairsWithSameLayerSubstitute;
if (sameLayerDerivedMatchWeight != null) {
unconnectedPairsWithSameLayerSubstitute =
deriveMatchesUsingDataFromSameLayer(matchClient,
sameLayerDerivedMatchWeight,
derivedMatchesList);
// then patch any remaining unconnected pairs with cross layer data
if (unconnectedPairsForPosition.size() > unconnectedPairsWithSameLayerSubstitute.size()) {
deriveMatchesUsingDataFromOtherLayers(matchClient,
crossLayerDerivedMatchWeight,
derivedMatchesList,
unconnectedPairsWithSameLayerSubstitute);
}
} else {
unconnectedPairsWithSameLayerSubstitute = new HashSet<>();
}

// then patch any remaining unconnected pairs with cross layer data
if (unconnectedPairsForPosition.size() > unconnectedPairsWithSameLayerSubstitute.size()) {
deriveMatchesUsingDataFromOtherLayers(matchClient,
crossLayerDerivedMatchWeight,
derivedMatchesList,
unconnectedPairsWithSameLayerSubstitute);
LOG.info("all pairs for {} are connected, nothing to derive", this);
}

LOG.info("deriveMatchesForUnconnectedPairs: exit, returning matches for {}", this);
Expand Down

0 comments on commit 6762595

Please sign in to comment.