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

Buffer too small error - Opening .nd2 file with Bioformats + BigStitcher #4256

Closed
Eddymorphling opened this issue Dec 3, 2024 · 3 comments
Closed

Comments

@Eddymorphling
Copy link

I am trying to stich an Nikon .nd2 multi-point dataset but get the error below when trying to use BigStitcher to open and read metadata using Bioformats. I am currently running on Bioformats 8.0. I saw folks have also reported similar errors in the past on the ImageJ forums and BigStitcher github pages but I was not able to find a fix to the issue yet. Not sure if this is a Bioformats error or a BigStitcher issue to be honest.. Any suggestions?


loci.formats.FormatException: Buffer too small (got 1572864, expected 2097152).
	at loci.formats.FormatTools.checkBufferSize(FormatTools.java:1048)
	at loci.formats.FormatTools.checkPlaneParameters(FormatTools.java:1004)
	at loci.formats.in.ND2Reader.openBytes(ND2Reader.java:244)
	at loci.formats.FormatReader.openBytes(FormatReader.java:901)
	at loci.formats.ImageReader.openBytes(ImageReader.java:458)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:343)
	at net.preibisch.mvrecon.fiji.spimdata.imgloaders.LegacyFileMapImgLoaderLOCI.openImg(LegacyFileMapImgLoaderLOCI.java:270)
	at net.preibisch.mvrecon.fiji.spimdata.imgloaders.LegacyFileMapImgLoaderLOCI.getImage(LegacyFileMapImgLoaderLOCI.java:153)
	at mpicbg.spim.data.legacy.LegacyImgLoaderWrapper$SetupImgLoaderWrapper.getImage(LegacyImgLoaderWrapper.java:79)
	at bdv.export.WriteSequenceToHdf5.writeViewToHdf5PartitionFile(WriteSequenceToHdf5.java:556)
	at bdv.export.WriteSequenceToHdf5.writeHdf5PartitionFile(WriteSequenceToHdf5.java:440)
	at bdv.export.WriteSequenceToHdf5.writeHdf5File(WriteSequenceToHdf5.java:159)
	at net.preibisch.mvrecon.fiji.plugin.resave.Generic_Resave_HDF5.writeHDF5(Generic_Resave_HDF5.java:261)
	at net.preibisch.mvrecon.fiji.datasetmanager.FileListDatasetDefinition.createDataset(FileListDatasetDefinition.java:1280)
	at net.preibisch.mvrecon.fiji.plugin.Define_Multi_View_Dataset.defineDataset(Define_Multi_View_Dataset.java:144)
	at net.preibisch.mvrecon.fiji.plugin.queryXML.LoadParseQueryXML.queryXML(LoadParseQueryXML.java:123)
	at net.preibisch.mvrecon.fiji.plugin.queryXML.LoadParseQueryXML.queryXML(LoadParseQueryXML.java:110)
	at net.preibisch.stitcher.plugin.BigStitcher.run(BigStitcher.java:97)
	at org.scijava.command.CommandModule.run(CommandModule.java:196)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:125)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)
	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:750)
java.lang.RuntimeException: Could not load '/home/mvn/Desktop/hp-276090.nd2' viewId=0, tpId=0
	at net.preibisch.mvrecon.fiji.spimdata.imgloaders.LegacyFileMapImgLoaderLOCI.getImage(LegacyFileMapImgLoaderLOCI.java:156)
	at mpicbg.spim.data.legacy.LegacyImgLoaderWrapper$SetupImgLoaderWrapper.getImage(LegacyImgLoaderWrapper.java:79)
	at bdv.export.WriteSequenceToHdf5.writeViewToHdf5PartitionFile(WriteSequenceToHdf5.java:556)
	at bdv.export.WriteSequenceToHdf5.writeHdf5PartitionFile(WriteSequenceToHdf5.java:440)
	at bdv.export.WriteSequenceToHdf5.writeHdf5File(WriteSequenceToHdf5.java:159)
	at net.preibisch.mvrecon.fiji.plugin.resave.Generic_Resave_HDF5.writeHDF5(Generic_Resave_HDF5.java:261)
	at net.preibisch.mvrecon.fiji.datasetmanager.FileListDatasetDefinition.createDataset(FileListDatasetDefinition.java:1280)
	at net.preibisch.mvrecon.fiji.plugin.Define_Multi_View_Dataset.defineDataset(Define_Multi_View_Dataset.java:144)
	at net.preibisch.mvrecon.fiji.plugin.queryXML.LoadParseQueryXML.queryXML(LoadParseQueryXML.java:123)
	at net.preibisch.mvrecon.fiji.plugin.queryXML.LoadParseQueryXML.queryXML(LoadParseQueryXML.java:110)
	at net.preibisch.stitcher.plugin.BigStitcher.run(BigStitcher.java:97)
	at org.scijava.command.CommandModule.run(CommandModule.java:196)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:125)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)
	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:750)
[ERROR] Command errored: BigStitcher
java.lang.RuntimeException: Could not load /home/mvn/Desktop/hp-276090.nd2' viewId=0, tpId=0: java.lang.RuntimeException: Could not load /home/mvn/Desktop/hp-276090.nd2' viewId=0, tpId=0
	at net.preibisch.mvrecon.fiji.spimdata.imgloaders.LegacyFileMapImgLoaderLOCI.getImage(LegacyFileMapImgLoaderLOCI.java:164)
	at mpicbg.spim.data.legacy.LegacyImgLoaderWrapper$SetupImgLoaderWrapper.getImage(LegacyImgLoaderWrapper.java:79)
	at bdv.export.WriteSequenceToHdf5.writeViewToHdf5PartitionFile(WriteSequenceToHdf5.java:556)
	at bdv.export.WriteSequenceToHdf5.writeHdf5PartitionFile(WriteSequenceToHdf5.java:440)
	at bdv.export.WriteSequenceToHdf5.writeHdf5File(WriteSequenceToHdf5.java:159)
	at net.preibisch.mvrecon.fiji.plugin.resave.Generic_Resave_HDF5.writeHDF5(Generic_Resave_HDF5.java:261)
	at net.preibisch.mvrecon.fiji.datasetmanager.FileListDatasetDefinition.createDataset(FileListDatasetDefinition.java:1280)
	at net.preibisch.mvrecon.fiji.plugin.Define_Multi_View_Dataset.defineDataset(Define_Multi_View_Dataset.java:144)
	at net.preibisch.mvrecon.fiji.plugin.queryXML.LoadParseQueryXML.queryXML(LoadParseQueryXML.java:123)
	at net.preibisch.mvrecon.fiji.plugin.queryXML.LoadParseQueryXML.queryXML(LoadParseQueryXML.java:110)
	at net.preibisch.stitcher.plugin.BigStitcher.run(BigStitcher.java:97)
	at org.scijava.command.CommandModule.run(CommandModule.java:196)
	at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:125)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)
	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:750)

@melissalinkert
Copy link
Member

Thanks for reporting this, @Eddymorphling. Probably the first thing to try is whether you are able to open every image in the .nd2 file using just the Bio-Formats plugin for ImageJ (i.e. Plugins > Bio-Formats > Bio-Formats Importer). If that works without errors, then that likely rules out a problem with Bio-Formats itself. In that case, PreibischLab/BigStitcher#107 may be related.

If you do see a problem when trying to open with just the Bio-Formats plugin, then it would be very helpful if you could upload an example file to https://zenodo.org/communities/bio-formats/ so that we can investigate.

@Eddymorphling
Copy link
Author

Thanks @melissalinkert. The files open in Fiji without any issues. I have commented on BigStitcher post that you had shared, waiting for a response.

@melissalinkert
Copy link
Member

Closing this based on PreibischLab/BigStitcher#107 (comment), but we can always re-open if this ends up requiring any changes in Bio-Formats itself.

@melissalinkert melissalinkert closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2024
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

2 participants