Skip to content

Conversation

melissalinkert
Copy link
Member

Expected to fix #258.

This does a few things:

  • removes the assumption that the first referenced pyramid is the full resolution slide; that fixes the channel count and complete lack of image data
  • detects the StitchingLevelForHWCoord section, and if present, ignores the stored positions for each tile and instead places each tile in a regular grid with no overlap
  • adds a bunch of TRACE and DEBUG logging, in case similar issues come up again

In all test data available, converting to OME-TIFF with this change and latest raw2ometiff then opening in QuPath 0.6.0 does not show any obvious tile boundaries or other stitching errors. More eyes would definitely be useful though.

I have not bothered to clean up the commit history here, in case intermediate commits are useful in future for seeing what was tried and rejected.

@sbesson sbesson requested review from muhanadz and sbesson August 12, 2025 10:06
for (int i=0; i<listOffsets.length; i++) {
listOffsets[i] = indexData.readInt();
//int depth = Integer.parseInt(hierarchy.get("HIER_" + i + "_COUNT"));
int depth = pyramidDepth;
Copy link
Member

Choose a reason for hiding this comment

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

As the depth is identical for all hierarchies and set to pyramidDepth, what is the rationale for
1- defining a separate variable and
2- using a long[][] rather than a long [] as previously

Or is this effectively kept over from the investigation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Partly left over from investigation, partly so that less arithmetic is required to index into listOffsets. Can clean up the commented-out line and separate variable though.

}

// read offsets to pyramid pixel data tiles
for (int h=0; h<nHierarchies; h++) {
for (int i=0; i<pyramidDepth; i++) {
for (int h=0; h<1; h++) { // TODO
Copy link
Member

Choose a reason for hiding this comment

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

Is this still TODO and what is the impact of not reading the offset for all hierarchies?

Copy link
Member Author

Choose a reason for hiding this comment

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

Cleaned up in a790719.

@melissalinkert
Copy link
Member Author

Note I have not reconverted all of the data for this issue with the last 2 commits, but have spot-checked with a couple of the relevant datasets together with https://openslide.cs.cmu.edu/download/openslide-testdata/Mirax/CMU-1.zip (to make sure older data is still OK). That means it is extra important to double-check conversions with whichever commit is the last to pass code review.

@melissalinkert melissalinkert requested a review from sbesson August 13, 2025 18:24
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

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

From a code review, the latest commits address the few cleanup suggestions.

Given the nature of the changes proposed here, I suggest the functional testing should not be limited to the datasets that prompted this work but also cover some historical MRXS datasets to make sure there is no regression in terms of either data integrity or conversion performance.

@melissalinkert
Copy link
Member Author

5a38975 should be specific to FL data, so should not affect the previous test data for this PR as that was all BF. Relevant test data for this last commit is https://zenodo.org/records/16962727, see #285.

@melissalinkert melissalinkert linked an issue Aug 29, 2025 that may be closed by this pull request
@melissalinkert melissalinkert added this to the 0.11.0 milestone Sep 3, 2025
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.

MRXS: conversion is incorrect when multiple pyramids are present Wrong number of channels
2 participants