<div dir="ltr">Hi Michael,<div><div><br></div><div>> I’m curious though because I didn’t think PNG files could handle</div><div>> anything other than 2D images.</div></div><div><br></div><div>SCIFIO writes the APNG format [1] when there are multiple planes.</div><div><div><br></div><div>> So I try to open the SCIFIOTutorial.png in ImageJ and I see only a</div><div>> single plane image.</div></div><div><br></div><div>Standard PNG readers (including ImageJ 1.x's built-in PNG reader) will read only the first plane. Did you try with File > Import > Image... which uses SCIFIO when opening?</div><div><br></div><div><div>> I change SCIFIOTutorial.png to SCIFIOTutorial.tif and run the program.</div><div>> I get the following exception:</div><div>> </div><div>> Exception in thread "main" io.scif.FormatException: Buffer too small</div><div>> (got 2500, expected 12500).</div></div><div><br></div><div>Thanks for the report. I can confirm this bug. I filed an issue for it:</div><div> <a href="https://github.com/scifio/scifio/issues/236" target="_blank">https://github.com/scifio/scifio/issues/236</a></div><div><br></div><div><div>> So how do I save a X,Y,Channels image in TIFF format with SCIFIO?</div></div><div><br></div><div>Once that issue is resolved, things should work!</div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div><div>[1] <a href="https://en.wikipedia.org/wiki/APNG" target="_blank">https://en.wikipedia.org/wiki/APNG</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 3, 2014 at 5:20 AM, Michael Ellis <span dir="ltr"><<a href="mailto:michael.ellis@dsuk.biz" target="_blank">michael.ellis@dsuk.biz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">T1dSavingImagePlanes saves a fake image “8bit-signed&pixelType=int8&lengths=50,50,3,5,7&axes=X,Y,Z,Channel,Time.fake” as a png file.<br>
<br>
I run the program and it completes without errors.<br>
<br>
I’m curious though because I didn’t think PNG files could handle anything other than 2D images. So I try to open the SCIFIOTutorial.png<br>
in ImageJ and I see only a single plane image. There are no warnings or errors when saving the file to suggest that there is any loss of fidelity. Is<br>
that the intention?<br>
<br>
Anyway, I know TIFF files can support multiple channels, so I change SCIFIOTutorial.png to SCIFIOTutorial.tif and run the program. I get the following exception:<br>
<br>
Exception in thread "main" io.scif.FormatException: Buffer too small (got 2500, expected 12500).<br>
at io.scif.util.FormatTools.checkBufferSize(FormatTools.java:665)<br>
at io.scif.util.FormatTools.checkPlaneForWriting(FormatTools.java:610)<br>
at io.scif.AbstractWriter.checkParams(AbstractWriter.java:121)<br>
at io.scif.formats.TIFFFormat$Writer.savePlane(TIFFFormat.java:1291)<br>
at io.scif.formats.TIFFFormat$Writer.writePlane(TIFFFormat.java:1399)<br>
at io.scif.AbstractWriter.savePlane(AbstractWriter.java:168)<br>
at io.scif.AbstractWriter.savePlane(AbstractWriter.java:159)<br>
at io.scif.tutorials.core.T1dSavingImagePlanes.main(T1dSavingImagePlanes.java:75)<br>
<br>
Now this is most unexpected, because I would have assumed the TIFF format was able to store the images with at least the same fidelity as PNG.<br>
<br>
OK I know TIFF can save files of 3 dimensions, so I change the fake images to “8bit-signed&pixelType=int8&lengths=50,50,7&axes=X,Y,Channel.fake”<br>
<br>
Again I get and exception.<br>
<br>
OK, how about a 2D image, “8bit-signed&pixelType=int8&lengths=50,50&axes=X,Y.fake”?<br>
<br>
And that finally works.<br>
<br>
So how do I save a X,Y,Channels image in TIFF format with SCIFIO?<br>
<br>
Thanks for any help.<br>
<br>
— Michael Ellis<br>
Digital Scientific UK Ltd.<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
SCIFIO mailing list<br>
<a href="mailto:SCIFIO@scif.io" target="_blank">SCIFIO@scif.io</a><br>
<a href="http://scif.io/mailman/listinfo/scifio" target="_blank">http://scif.io/mailman/listinfo/scifio</a><br>
</blockquote></div><br></div></div>