Skip to content

Commit

Permalink
expose stack with z build methods from multi project object
Browse files Browse the repository at this point in the history
  • Loading branch information
trautmane committed Jul 20, 2023
1 parent 129e6fe commit 212b38f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ public void deriveAndSaveMatchesForAllUnconnectedPairs()

final MultiProjectParameters multiProject = parameters.multiProject;
final RenderDataClient defaultDataClient = multiProject.getDataClient();
final List<StackWithZValues> stackWithZList = multiProject.buildListOfStackWithAllZ();

final List<StackWithZValues> stackWithZList =
multiProject.stackIdWithZ.buildListOfStackWithAllZ(defaultDataClient);
for (final StackWithZValues stackWithZ : stackWithZList) {
final StackMFOVWithZValues stackMFOVWithZValues =
new StackMFOVWithZValues(stackWithZ, parameters.patch.multiFieldOfViewId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public List<UnconnectedMFOVPairsForStack> findUnconnectedMFOVs()
throws IOException {

final RenderDataClient renderDataClient = parameters.multiProject.getDataClient();
final List<StackWithZValues> stackWithZList =
parameters.multiProject.stackIdWithZ.buildListOfStackWithAllZ(renderDataClient);
final List<StackWithZValues> stackWithZList = parameters.multiProject.buildListOfStackWithAllZ();

final List<UnconnectedMFOVPairsForStack> unconnectedMFOVsForAllStacks = new ArrayList<>();
for (final StackWithZValues stackWithZ : stackWithZList) {
final UnconnectedMFOVPairsForStack unconnectedMFOVPairsForStack =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,24 @@ public RenderDataClient getDataClient() {
public MultiProjectParameters() {
}

public String getBaseDataUrl() {
return baseDataUrl;
}

public MatchCollectionId getMatchCollectionIdForStack(final StackId stackId) {
return matchCollection == null ?
stackId.getDefaultMatchCollectionId(deriveMatchCollectionNamesFromProject) :
new MatchCollectionId(owner, matchCollection);
}

public List<StackWithZValues> buildBatchedListOfStackWithZ()
public List<StackWithZValues> buildListOfStackWithBatchedZ()
throws IOException, IllegalArgumentException {
return stackIdWithZ.buildListOfStackWithBatchedZ(this.getDataClient());
}

public List<StackWithZValues> buildListOfStackWithAllZ()
throws IOException, IllegalArgumentException {
final RenderDataClient renderDataClient = getDataClient();
return stackIdWithZ.buildListOfStackWithBatchedZ(renderDataClient);
return stackIdWithZ.buildListOfStackWithAllZ(this.getDataClient());
}

private synchronized void buildDataClient() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ public void patchPairs(final JavaSparkContext sparkContext,

final MultiProjectParameters multiProject = parameters.multiProject;
final RenderDataClient sourceDataClient = multiProject.getDataClient();
final String baseDataUrl = sourceDataClient.getUrls().getBaseDataUrl();

final List<StackWithZValues> stackWithZValuesList =
multiProject.stackIdWithZ.buildListOfStackWithAllZ(sourceDataClient);
final String baseDataUrl = multiProject.getBaseDataUrl();
final List<StackWithZValues> stackWithZValuesList = multiProject.buildListOfStackWithAllZ();

final List<StackMFOVWithZValues> stackMFOVWithZValuesList = new ArrayList<>();
for (final StackWithZValues stackWithZValues : stackWithZValuesList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ public List<UnconnectedMFOVPairsForStack> findUnconnectedMFOVs(final JavaSparkCo
LOG.info("findUnconnectedMFOVs: entry");

final MultiProjectParameters multiProject = parameters.multiProject;
final RenderDataClient sourceDataClient = multiProject.getDataClient();
final String baseDataUrl = sourceDataClient.getBaseDataUrl();

final List<StackWithZValues> stackWithZValuesList =
multiProject.stackIdWithZ.buildListOfStackWithAllZ(sourceDataClient);
final String baseDataUrl = multiProject.getBaseDataUrl();
final List<StackWithZValues> stackWithZValuesList = multiProject.buildListOfStackWithAllZ();

LOG.info("findUnconnectedMFOVs: distributing tasks for {} stacks", stackWithZValuesList.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void runWithContext(final JavaSparkContext sparkContext,
MultiStagePointMatchClient.Parameters.fromPipeline(alignmentPipelineParameters);
final MultiStagePointMatchClient matchClient = new MultiStagePointMatchClient(p);
final MultiProjectParameters multiProject = alignmentPipelineParameters.getMultiProject();
final List<StackWithZValues> batchedList = multiProject.buildBatchedListOfStackWithZ();
final List<StackWithZValues> batchedList = multiProject.buildListOfStackWithBatchedZ();
matchClient.generatePairsAndMatchesForRunList(sparkContext,
batchedList,
alignmentPipelineParameters.getMatchRunList());
Expand Down

0 comments on commit 212b38f

Please sign in to comment.