use of ij.io.TiffEncoder in project GDSC-SMLM by aherbert.
the class SeriesImageSourceTest method saveAsTiff.
private static void saveAsTiff(ImagePlus imp, String path, boolean intelByteOrder) throws IOException {
// IJ.saveAsTiff(imp, path);
final FileInfo fi = imp.getFileInfo();
fi.nImages = imp.getStackSize();
ij.Prefs.intelByteOrder = intelByteOrder;
try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path)))) {
final TiffEncoder file = new TiffEncoder(fi);
file.write(out);
}
}
Aggregations