Skip to content

Commit

Permalink
Merge pull request #106 from melissalinkert/mrxs-position-metadata
Browse files Browse the repository at this point in the history
mrxs: store tile position adjustment values as Plane.PositionX and Plane.PositionY
  • Loading branch information
chris-allan authored Jun 29, 2021
2 parents b1485d4 + 1f35bf8 commit 64983d5
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ protected void initFile(String id) throws FormatException, IOException {

int nonHierCount = Integer.parseInt(hierarchy.get("NONHIER_COUNT"));
int totalCount = 0;
int originX = 0;
int originY = 0;
int metadataWidth = 0;
int metadataHeight = 0;
for (int i=0; i<nonHierCount; i++) {
Expand Down Expand Up @@ -619,12 +621,12 @@ else if (name.equals("StitchingIntensityLayer")) {
}
}

minX -= (minX % 256);
minY -= (minY % 256);
originX = minX - (minX % 256);
originY = minY - (minY % 256);

for (int t=0; t<nTiles; t++) {
tilePositions[t][0] -= minX;
tilePositions[t][1] -= minY;
tilePositions[t][0] -= originX;
tilePositions[t][1] -= originY;
}

stream.close();
Expand Down Expand Up @@ -942,6 +944,9 @@ else if (name.equals("VIMSLIDE_POSITION_BUFFER")) {
}
}

store.setPlanePositionX(new Length(originX, UNITS.PIXEL), 0, 0);
store.setPlanePositionY(new Length(originY, UNITS.PIXEL), 0, 0);

// parse channel data

for (int c=0; c<getSizeC(); c++) {
Expand Down

0 comments on commit 64983d5

Please sign in to comment.