Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving hyperstack as .ims fails #2

Open
imagejan opened this issue Dec 19, 2019 · 1 comment
Open

Saving hyperstack as .ims fails #2

imagejan opened this issue Dec 19, 2019 · 1 comment

Comments

@imagejan
Copy link
Member

When trying the following script:

#@ DatasetIOService io
#@ Dataset img
#@ File (style="save") file

io.save(img, file.getAbsolutePath())

with the Mitosis sample image (2C x 5Z x 51T) and a file name ending on ".ims", I get the following stack trace:

java.io.IOException: io.scif.img.ImgIOException: io.scif.FormatException: SCIFIO exception when writing to file FileLocation:file:/E:/eglijan/temp-debug/testSavingSCIFIO.ims:
Channels * Frames * Z Slices must equal number of planes
	at io.scif.services.DefaultDatasetIOService.save(DefaultDatasetIOService.java:259)
	at io.scif.services.DefaultDatasetIOService.save(DefaultDatasetIOService.java:231)
	at io.scif.services.DatasetIOService$save.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
	at Script3.run(Script3.groovy:5)
	at org.scijava.plugins.scripting.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:303)
	at org.scijava.plugins.scripting.groovy.GroovyScriptEngine.eval(GroovyScriptEngine.java:122)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:228)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: io.scif.img.ImgIOException: io.scif.FormatException: SCIFIO exception when writing to file FileLocation:file:/E:/eglijan/temp-debug/testSavingSCIFIO6.ims:
Channels * Frames * Z Slices must equal number of planes
	at io.scif.img.ImgSaver.writeImg(ImgSaver.java:437)
	at io.scif.img.ImgSaver.writeImg(ImgSaver.java:414)
	at io.scif.img.ImgSaver.writeImg(ImgSaver.java:390)
	at io.scif.img.ImgSaver.saveImg(ImgSaver.java:175)
	at io.scif.img.ImgSaver.saveImg(ImgSaver.java:158)
	at io.scif.services.DefaultDatasetIOService.save(DefaultDatasetIOService.java:256)
	... 18 more

(tested with scifio-hdf5-0.2.0 and scifio-0.38.3-SNAPSHOT on the classpath)

@imagejan
Copy link
Member Author

After changing this line to include the actual numbers:

"Channels * Frames * Z Slices must equal number of planes");

- 					"Channels * Frames * Z Slices must equal number of planes");
+ 					"Channels (" + sizeC + ") * Frames (" + sizeT + ") * Z Slices (" + sizeZ + ") must equal number of planes (" + meta.get(0).getPlaneCount() + ")");

I observed that meta.get(0).getPlaneCount() returns 255 in this case, whereas the Mitosis dataset contains 510 planes (CZT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant