Commit 3ae3cafd authored by Luc Deschenaux's avatar Luc Deschenaux

set codec default options for tiffsaver

parent e69ea295
...@@ -285,7 +285,7 @@ public class EyesisCorrectionParameters { ...@@ -285,7 +285,7 @@ public class EyesisCorrectionParameters {
gd.addCheckbox ("Save chroma denoise mask (white - use hi-res, black - low-res)", this.saveChromaDenoiseMask); gd.addCheckbox ("Save chroma denoise mask (white - use hi-res, black - low-res)", this.saveChromaDenoiseMask);
gd.addCheckbox ("Rotate result image", this.rotate); gd.addCheckbox ("Rotate result image", this.rotate);
gd.addCheckbox ("Crop result image to the original size", this.crop); gd.addCheckbox ("Crop result image to the original size", this.crop);
String [] tiffCompressionChoices={"UNCOMPRESSED","LZW","JPEG_2000","ALT_JPEG2000"}; String [] tiffCompressionChoices={"UNCOMPRESSED","LZW","JPEG", "JPEG_2000","ALT_JPEG2000"};
int tiffCompressionIndex=0; int tiffCompressionIndex=0;
String [] equirectangularFormatChoices={"RGBA 8-bit","RGBA 16-bit","RGBA 32-bit integer","RGBA 32-bit float","ImageJ stack"}; String [] equirectangularFormatChoices={"RGBA 8-bit","RGBA 16-bit","RGBA 32-bit integer","RGBA 32-bit float","ImageJ stack"};
int [] equirectangularFormats={0,1,2,3,4}; int [] equirectangularFormats={0,1,2,3,4};
......
...@@ -34,6 +34,7 @@ import java.util.Arrays; ...@@ -34,6 +34,7 @@ import java.util.Arrays;
//import org.apache.log4j.Logger; //import org.apache.log4j.Logger;
import ij.IJ; import ij.IJ;
import ij.ImagePlus; import ij.ImagePlus;
import ij.WindowManager; import ij.WindowManager;
...@@ -42,6 +43,7 @@ import loci.common.RandomAccessInputStream; ...@@ -42,6 +43,7 @@ import loci.common.RandomAccessInputStream;
import loci.common.services.DependencyException; import loci.common.services.DependencyException;
import loci.common.services.ServiceException; import loci.common.services.ServiceException;
import loci.formats.FormatException; import loci.formats.FormatException;
import loci.formats.codec.CodecOptions;
import loci.formats.tiff.IFD; import loci.formats.tiff.IFD;
import loci.formats.tiff.IFDList; import loci.formats.tiff.IFDList;
import loci.formats.tiff.TiffParser; import loci.formats.tiff.TiffParser;
...@@ -222,6 +224,7 @@ public EyesisTiff(String codec){ ...@@ -222,6 +224,7 @@ public EyesisTiff(String codec){
TiffSaver tiffSaver = new TiffSaver(path); TiffSaver tiffSaver = new TiffSaver(path);
tiffSaver.setWritingSequentially(true); tiffSaver.setWritingSequentially(true);
tiffSaver.setLittleEndian(false); tiffSaver.setLittleEndian(false);
tiffSaver.setCodecOptions(TiffCompression.valueOf(codec).getCompressionCodecOptions(ifd));
tiffSaver.writeHeader(); tiffSaver.writeHeader();
// tiffSaver.writeIFD(ifd,0); //* SHould not write here, some fields are calculated during writeImage, that writes IFD too // tiffSaver.writeIFD(ifd,0); //* SHould not write here, some fields are calculated during writeImage, that writes IFD too
// System.out.println("bytes.length="+bytes.length); // System.out.println("bytes.length="+bytes.length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment