<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
As mentioned on a related thread, using ome.tif as the extension for the generated
<div class="">file should solve the dimensionality issue.</div>
<div class="">See <a href="http://lists.openmicroscopy.org.uk/pipermail/ome-devel/2015-June/003373.html" class="">http://lists.openmicroscopy.org.uk/pipermail/ome-devel/2015-June/003373.html</a>.</div>
<div class=""><br class="">
</div>
<div class="">Sebastien</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 29 Jun 2015, at 17:31, Jean Ollion <<a href="mailto:jean.ollion@gmail.com" class="">jean.ollion@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">Hello, <br class="">
</div>
I'm having troubles in basic I/O. When I read a file I just wrote, i get the wrong number of timepoints and Zslices (they are inverted).
<br class="">
<br class="">
</div>
<div class="">Here is a minimal test example written for JUint, inspired from the website documentation:
<br class="">
</div>
<div class="">@Rule<br class="">
public TemporaryFolder testFolder = new TemporaryFolder();<br class="">
@org.junit.Test<br class="">
public void testIOImageDimensions() {<br class="">
String id = testFolder.newFolder("imageTest").getAbsolutePath()+File.separator+"imageTest.tif";<br class="">
int w = 512, h = 512, c = 1, z = 2;<br class="">
int pixelType = FormatTools.UINT16;<br class="">
byte[] img = new byte[w * h * c * FormatTools.getBytesPerPixel(pixelType)];<br class="">
for (int i = 0; i < img.length; i++) {<br class="">
img[i] = (byte) (256 * Math.random());<br class="">
}<br class="">
try {<br class="">
ServiceFactory factory = new ServiceFactory();<br class="">
OMEXMLService service = factory.getInstance(OMEXMLService.class);<br class="">
IMetadata meta = service.createOMEXMLMetadata();<br class="">
MetadataTools.populateMetadata(meta, 0, null, false, "XYZCT", FormatTools.getPixelTypeString(pixelType), w, h, z, c, 1, c);
<br class="">
IFormatWriter writer = new loci.formats.ImageWriter();<br class="">
writer.setMetadataRetrieve(meta);<br class="">
writer.setId(id);<br class="">
writer.saveBytes(0, img);<br class="">
writer.saveBytes(1, img);<br class="">
writer.close();<br class="">
} catch (Exception e) {<br class="">
fail("problem writing image to disk");<br class="">
}<br class="">
<br class="">
ImageProcessorReader r = new ImageProcessorReader(new ChannelSeparator(LociPrefs.makeImageReader()));<br class="">
try {<br class="">
r.setId(id);<br class="">
Assert.assertEquals("testing file series number", 1, r.getSeriesCount());<br class="">
//Assert.assertEquals("testing file timePoints number", 1, r.getSizeT());<br class="">
Assert.assertEquals("testing file channels number", 1, r.getSizeC());<br class="">
Assert.assertEquals("testing image width", w, r.getSizeX());<br class="">
Assert.assertEquals("testing image heigth", h, r.getSizeY());<br class="">
//Assert.assertEquals("testing image depth", z, r.getSizeZ());<br class="">
<br class="">
r.close();<br class="">
} catch (FormatException exc) {<br class="">
fail("error reading image");<br class="">
} catch (IOException exc) {<br class="">
fail("error reading image");<br class="">
} <br class="">
}<br class="">
<br class="">
</div>
<div class="">The commented Assertions fail. <br class="">
<br class="">
</div>
in maven i have the following dependencies related to bioformats:<br class="">
<dependency><br class="">
<groupId>ome</groupId><br class="">
<artifactId>formats-gpl</artifactId><br class="">
<version>5.1.2</version><br class="">
<scope>compile</scope><br class="">
</dependency><br class="">
<dependency><br class="">
<groupId>ome</groupId><br class="">
<artifactId>loci_tools</artifactId><br class="">
<version>5.1.2</version><br class="">
<scope>compile</scope><br class="">
</dependency><br class="">
<br class="">
</div>
Could you point me out the problem? <br class="">
</div>
Thanks, <br class="">
</div>
Jean<br class="">
</div>
_______________________________________________<br class="">
ome-devel mailing list<br class="">
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" class="">ome-devel@lists.openmicroscopy.org.uk</a><br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>