Skip to content

feature/thomas-intensity-changes-b - #243

Open
trautmane wants to merge 35 commits into
newsolverfrom
feature/thomas-intensity-changes-b
Open

feature/thomas-intensity-changes-b#243
trautmane wants to merge 35 commits into
newsolverfrom
feature/thomas-intensity-changes-b

Conversation

@trautmane

@trautmane trautmane commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

This pull request involves changing tile identifiers to improve render order, adding beam intensity correction as a spark pipeline step, and persisting/reusing within-MFOV match data during beam intensity correction and MFOV-as-tile processing.

trautmane added 30 commits July 31, 2026 13:29
…separate BeamCorrectionParameters class that can be more easily reused by spark pipelines
…CorrectionType parameter with possible values: OVERWRITE_SOURCE, WRITE_TO_TARGET, or SKIP
…sWithDifferentMFOVs method to removeMatchPairsThatReferenceTilesOutsideThisCollection
…service since we generate that match data in an earlier intensity correction step. The MFOVAsTileParameters deriveSfovMatchData field determines whether matches are simply read or are generated during the pre-alignment process. In "small" tests using 5 Google nodes with two w61_s140_r00 z layers, the run with deriveSfovMatchData=false took 61 minutes and the run with deriveSfovMatchData=true took 79 minutes.
…ive. This makes it a little clearer that you are excluding cross MFOV match pair patching when you specify a negative weight (rather than leaving the weight unspecified).
@trautmane
trautmane requested a review from minnerbe August 11, 2026 16:13
…hat wasted compute time (e.g. 15 minutes of a 90-minute run)

@minnerbe minnerbe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together, @trautmane! I have skimmed the code and only dug into a few targeted spots. All looks good to me. As always, my review comments are mostly just suggestions.

Comment on lines +204 to +211
if (pTileSpec == null) {
if (qTileSpec == null) {
sb.append("s ").append(pair.getpId()).append(" and ").append(pair.getqId());
}
sb.append(" ").append(pair.getpId());
} else {
sb.append(" ").append(pair.getqId());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pTileSpec == null) {
if (qTileSpec == null) {
sb.append("s ").append(pair.getpId()).append(" and ").append(pair.getqId());
}
sb.append(" ").append(pair.getpId());
} else {
sb.append(" ").append(pair.getqId());
}
if (qTileSpec == null) {
if (pTileSpec == null) {
sb.append("s ").append(pair.getpId()).append(" and ");
}
sb.append(" ").append(pair.getqId());
} else {
sb.append(" ").append(pair.getpId());
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current formulation, pId is printed twice if both tile specs are null. This change should print p, q, or s p and q` correctly, depending on the situation.


if (excludeSameMfovNeighbors && (pMfov.equals(MultiSemUtilities.getMagcMfovForTileId(qTileId)))) {
continue;
} else if (excludeDifferentMfovNeighbors && (! pMfov.equals(MultiSemUtilities.getMagcMfovForTileId(qTileId)))) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability, consider declaring final boolean isSameMfov = pMfov.equals(MultiSemUtilities.getMagcMfovForTileId(qTileId)).

*
* @return the parsed resource or null if it is not present in the container.
*/
private static JsonObject readDatasetJson(final ZarrKeyValueReader reader,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a general comment on this file: I've had to read the metadata as plain json instead of going through N5's key-value reader because it cannot deal with some of the values that are written by python. This is fixed in a newer N5 version, which is pulled in in #239. This file is also significantly simplified there.

* Spark client for updating the tileId for all tiles in the stack
* to use the new wafer 60 and 61 render order.
*/
public class TileIdHackClient

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer something like TileIdUpdateClient or ChangeTileIdClient. "Hack" sounds like we're doing something wrong.. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants