Skip to content

Commit

Permalink
Exporter plugin: remove any extra Channel elements
Browse files Browse the repository at this point in the history
Fixes ome#3539.
  • Loading branch information
melissalinkert committed Aug 9, 2023
1 parent 19d7fb9 commit 10980fe
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,15 @@ else if (store.getImageCount() > 1) {
store.setPixelsSizeC(new PositiveInteger(channels*imp.getNChannels()), 0);
store.setPixelsSizeT(new PositiveInteger(imp.getNFrames()), 0);

try {
// if a subset of the data was opened, the number of Channels
// in the OME-XML may not match the ImagePlus channel count
// channel count mismatches can cause problems when actually writing pixels
service.removeChannels(service.getOMEMetadata(store), 0, imp.getNChannels());
}
catch (ServiceException e) {
}

if (store.getImageID(0) == null) {
store.setImageID(MetadataTools.createLSID("Image", 0), 0);
}
Expand Down

0 comments on commit 10980fe

Please sign in to comment.