Skip to content

Commit

Permalink
InCell: allow mix of 2D and 3D channels to be treated as a Z stack
Browse files Browse the repository at this point in the history
  • Loading branch information
melissalinkert committed Jan 28, 2025
1 parent a56cf00 commit c7e5138
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions components/formats-gpl/src/loci/formats/in/InCellReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ protected void initFile(String id) throws FormatException, IOException {
}
int expectedSeries = totalImages / (getSizeZ() * getSizeC() * getSizeT());
if (expectedSeries > 0) {
seriesCount = (int) Math.min(seriesCount, expectedSeries);
LOGGER.warn("Using series count {} but plane count indicates {}",
seriesCount, expectedSeries);
}
}
else seriesCount = totalImages / (getSizeZ() * getSizeC() * getSizeT());
Expand Down Expand Up @@ -791,7 +792,7 @@ class MinimalInCellHandler extends BaseHandler {
private int wellRow, wellCol;
private int nChannels = 0;
private boolean doT = true;
private boolean doZ = true;
private Boolean doZ = null;
private Image lastImage = null;

@Override
Expand Down Expand Up @@ -908,7 +909,11 @@ else if (qName.equals("Wavelength")) {
String fusion = attributes.getValue("fusion_wave");
if (fusion.equals("false")) ms0.sizeC++;
String mode = attributes.getValue("imaging_mode");
if (mode != null) {

// different wavelengths (channels) may have different imaging modes
// we want to allow a Z stack if one or more "3-D" imaging modes
// are encountered, even if some are variations on "2-D"
if (mode != null && (doZ == null || !doZ)) {
doZ = mode.equals("3-D");
}
}
Expand Down

0 comments on commit c7e5138

Please sign in to comment.