BIOP / ijp-kheops

GNU General Public License v2.0
13 stars 2 forks source link

Conversion gives up in pyimagej linux setup. #29

Open ohkio opened 4 months ago

ohkio commented 4 months ago

Hello ijp-kheops team! I'm helping out a team close to me with slide digitization, I'm trying to incorporate this library into a script and workflow. I'm starting with a sequence of tiff images that have been stitched together using the Imagej stitching algorithm. My setup is on a dell laptop, kubuntu os, installed pyimagej using mamba, and I am trying to call the kheops command on a single stitched plane, not the whole set of images. I have been working at the problem for a while and am having trouble determining where the issue is happening. This is the log+error that I get when I run the code:

Operating in headless mode - the original ImageJ will have limited functionality.
Operating in headless mode - the IJ class will not be fully functional.
TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
[java.lang.Enum.toString] TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
Reading IFDs
[java.lang.Enum.toString] Reading IFDs
Populating metadata
[java.lang.Enum.toString] Populating metadata
Checking comment style
[java.lang.Enum.toString] Checking comment style
Populating OME metadata
[java.lang.Enum.toString] Populating OME metadata
TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
[java.lang.Enum.toString] TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
Reading IFDs
[java.lang.Enum.toString] Reading IFDs
Populating metadata
[java.lang.Enum.toString] Populating metadata
Checking comment style
[java.lang.Enum.toString] Checking comment style
Populating OME metadata
[java.lang.Enum.toString] Populating OME metadata
TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
[java.lang.Enum.toString] TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
Reading IFDs
[java.lang.Enum.toString] Reading IFDs
Populating metadata
[java.lang.Enum.toString] Populating metadata
Checking comment style
[java.lang.Enum.toString] Checking comment style
Populating OME metadata
[java.lang.Enum.toString] Populating OME metadata
[WARN] Could not access omeMeta.getPlanePosition serie 0
[java.lang.Enum.toString] [WARN] Could not access omeMeta.getPlanePosition serie 0
[WARN] No name found for serie 0 ch 0 setting name to ch_0
[java.lang.Enum.toString] [WARN] No name found for serie 0 ch 0 setting name to ch_0
TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
[java.lang.Enum.toString] TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
Reading IFDs
[java.lang.Enum.toString] Reading IFDs
Populating metadata
[java.lang.Enum.toString] Populating metadata
Checking comment style
[java.lang.Enum.toString] Checking comment style
Populating OME metadata
[java.lang.Enum.toString] Populating OME metadata
TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
[java.lang.Enum.toString] TiffDelegateReader initializing /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/GC100953A_40x_BF_15z_Z01.tif
Reading IFDs
[java.lang.Enum.toString] Reading IFDs
Populating metadata
[java.lang.Enum.toString] Populating metadata
Checking comment style
[java.lang.Enum.toString] Checking comment style
Populating OME metadata
[java.lang.Enum.toString] Populating OME metadata
Error with /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/temp/GC100953A_40x_BF_15z_Z01.ome.tiff export: null
[java.lang.Enum.toString] Error with /home/kio/Pictures/slide-test/GC100953A_40x_BF_15z/GC100953A_40x_BF_15z_Z01/temp/GC100953A_40x_BF_15z_Z01.ome.tiff export: null[java.lang.Enum.toString] 
GC100953A_40x_BF_15z_Z01.tif     OME TIFF conversion (Kheops)    Run time=      1        s       parallel =      false       nProcessors =  7
[java.lang.Enum.toString] GC100953A_40x_BF_15z_Z01.tif   OME TIFF conversion (Kheops)    Run time=      1        s  parallel =       false   nProcessors =  7[java.lang.Enum.toString] 
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:74)
        at bdv.img.cache.VolatileCachedCellImg$VolatileCachedCells.get(VolatileCachedCellImg.java:177)
        at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:262)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:87)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:52)
        at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
        at net.imglib2.view.FullSourceMapSlicingRandomAccess.get(FullSourceMapSlicingRandomAccess.java:310)
        at net.imglib2.util.Util.getTypeFromInterval(Util.java:811)
        at net.imglib2.view.Views.flatIterable(Views.java:868)
        at ch.epfl.biop.kheops.ometiff.SourceToByteArray.raiToByteArray(SourceToByteArray.java:70)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.getBytesFromRAIs(OMETiffExporter.java:306)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeTile(OMETiffExporter.java:324)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeNextTile(OMETiffExporter.java:401)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.lambda$export$0(OMETiffExporter.java:484)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:141)
        at net.imglib2.cache.ref.BoundedSoftRefLoaderCache.get(BoundedSoftRefLoaderCache.java:87)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
        at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
        at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
        at net.imglib2.cache.ref.WeakRefVolatileCache.get(WeakRefVolatileCache.java:205)
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:70)
        ... 18 more
Caused by: java.lang.InterruptedException: The pool has been closed
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:119)
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:76)
        at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:135)
        ... 24 more
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:74)
        at bdv.img.cache.VolatileCachedCellImg$VolatileCachedCells.get(VolatileCachedCellImg.java:177)
        at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:262)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:87)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:52)
        at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
        at net.imglib2.view.FullSourceMapSlicingRandomAccess.get(FullSourceMapSlicingRandomAccess.java:310)
        at net.imglib2.util.Util.getTypeFromInterval(Util.java:811)
        at net.imglib2.view.Views.flatIterable(Views.java:868)
        at ch.epfl.biop.kheops.ometiff.SourceToByteArray.raiToByteArray(SourceToByteArray.java:70)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.getBytesFromRAIs(OMETiffExporter.java:306)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeTile(OMETiffExporter.java:324)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeNextTile(OMETiffExporter.java:401)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.lambda$export$0(OMETiffExporter.java:484)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:141)
        at net.imglib2.cache.ref.BoundedSoftRefLoaderCache.get(BoundedSoftRefLoaderCache.java:87)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
        at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
        at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
        at net.imglib2.cache.ref.WeakRefVolatileCache.get(WeakRefVolatileCache.java:205)
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:70)
        ... 18 more
Caused by: java.lang.InterruptedException: The pool has been closed
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:119)
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:76)
        at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:135)
        ... 24 more
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:74)
        at bdv.img.cache.VolatileCachedCellImg$VolatileCachedCells.get(VolatileCachedCellImg.java:177)
        at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:262)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:87)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:52)
        at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
        at net.imglib2.view.FullSourceMapSlicingRandomAccess.get(FullSourceMapSlicingRandomAccess.java:310)
        at net.imglib2.util.Util.getTypeFromInterval(Util.java:811)
        at net.imglib2.view.Views.flatIterable(Views.java:868)
        at ch.epfl.biop.kheops.ometiff.SourceToByteArray.raiToByteArray(SourceToByteArray.java:70)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.getBytesFromRAIs(OMETiffExporter.java:306)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeTile(OMETiffExporter.java:324)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeNextTile(OMETiffExporter.java:401)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.lambda$export$0(OMETiffExporter.java:484)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:141)
        at net.imglib2.cache.ref.BoundedSoftRefLoaderCache.get(BoundedSoftRefLoaderCache.java:87)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
        at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
        at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
        at net.imglib2.cache.ref.WeakRefVolatileCache.get(WeakRefVolatileCache.java:205)
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:70)
        ... 18 more
Caused by: java.lang.InterruptedException: The pool has been closed
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:119)
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:76)
        at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:135)
        ... 24 more
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:74)
        at bdv.img.cache.VolatileCachedCellImg$VolatileCachedCells.get(VolatileCachedCellImg.java:177)
        at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:262)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:87)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:52)
        at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
        at net.imglib2.view.FullSourceMapSlicingRandomAccess.get(FullSourceMapSlicingRandomAccess.java:310)
        at net.imglib2.util.Util.getTypeFromInterval(Util.java:811)
        at net.imglib2.view.Views.flatIterable(Views.java:868)
        at ch.epfl.biop.kheops.ometiff.SourceToByteArray.raiToByteArray(SourceToByteArray.java:70)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.getBytesFromRAIs(OMETiffExporter.java:306)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeTile(OMETiffExporter.java:324)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeNextTile(OMETiffExporter.java:401)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.lambda$export$0(OMETiffExporter.java:484)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:141)
        at net.imglib2.cache.ref.BoundedSoftRefLoaderCache.get(BoundedSoftRefLoaderCache.java:87)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
        at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
        at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
        at net.imglib2.cache.ref.WeakRefVolatileCache.get(WeakRefVolatileCache.java:205)
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:70)
        ... 18 more
Caused by: java.lang.InterruptedException: The pool has been closed
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:119)
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:76)
        at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:135)
        ... 24 more
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:74)
        at bdv.img.cache.VolatileCachedCellImg$VolatileCachedCells.get(VolatileCachedCellImg.java:177)
        at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:262)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:87)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:52)
        at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
        at net.imglib2.view.FullSourceMapSlicingRandomAccess.get(FullSourceMapSlicingRandomAccess.java:310)
        at net.imglib2.util.Util.getTypeFromInterval(Util.java:811)
        at net.imglib2.view.Views.flatIterable(Views.java:868)
        at ch.epfl.biop.kheops.ometiff.SourceToByteArray.raiToByteArray(SourceToByteArray.java:70)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.getBytesFromRAIs(OMETiffExporter.java:306)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeTile(OMETiffExporter.java:324)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeNextTile(OMETiffExporter.java:401)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.lambda$export$0(OMETiffExporter.java:484)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:141)
        at net.imglib2.cache.ref.BoundedSoftRefLoaderCache.get(BoundedSoftRefLoaderCache.java:87)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
        at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
        at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
        at net.imglib2.cache.ref.WeakRefVolatileCache.get(WeakRefVolatileCache.java:205)
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:70)
        ... 18 more
Caused by: java.lang.InterruptedException: The pool has been closed
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:119)
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:76)
        at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:135)
        ... 24 more
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:74)
        at bdv.img.cache.VolatileCachedCellImg$VolatileCachedCells.get(VolatileCachedCellImg.java:177)
        at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:262)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:87)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:52)
        at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
        at net.imglib2.view.FullSourceMapSlicingRandomAccess.get(FullSourceMapSlicingRandomAccess.java:310)
        at net.imglib2.util.Util.getTypeFromInterval(Util.java:811)
        at net.imglib2.view.Views.flatIterable(Views.java:868)
        at ch.epfl.biop.kheops.ometiff.SourceToByteArray.raiToByteArray(SourceToByteArray.java:70)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.getBytesFromRAIs(OMETiffExporter.java:306)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeTile(OMETiffExporter.java:324)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeNextTile(OMETiffExporter.java:401)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.lambda$export$0(OMETiffExporter.java:484)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:141)
        at net.imglib2.cache.ref.BoundedSoftRefLoaderCache.get(BoundedSoftRefLoaderCache.java:87)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
        at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
        at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
        at net.imglib2.cache.ref.WeakRefVolatileCache.get(WeakRefVolatileCache.java:205)
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:70)
        ... 18 more
Caused by: java.lang.InterruptedException: The pool has been closed
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:119)
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:76)
        at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:135)
        ... 24 more
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:74)
        at bdv.img.cache.VolatileCachedCellImg$VolatileCachedCells.get(VolatileCachedCellImg.java:177)
        at net.imglib2.img.list.AbstractLongListImg$LongListRandomAccess.get(AbstractLongListImg.java:262)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:128)
        at net.imglib2.img.cell.CellRandomAccess.getCell(CellRandomAccess.java:52)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:87)
        at net.imglib2.img.cell.AbstractCellImg.update(AbstractCellImg.java:52)
        at net.imglib2.type.numeric.integer.GenericByteType.updateContainer(GenericByteType.java:100)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:137)
        at net.imglib2.img.cell.CellRandomAccess.get(CellRandomAccess.java:52)
        at net.imglib2.view.FullSourceMapSlicingRandomAccess.get(FullSourceMapSlicingRandomAccess.java:310)
        at net.imglib2.util.Util.getTypeFromInterval(Util.java:811)
        at net.imglib2.view.Views.flatIterable(Views.java:868)
        at ch.epfl.biop.kheops.ometiff.SourceToByteArray.raiToByteArray(SourceToByteArray.java:70)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.getBytesFromRAIs(OMETiffExporter.java:306)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeTile(OMETiffExporter.java:324)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.computeNextTile(OMETiffExporter.java:401)
        at ch.epfl.biop.kheops.ometiff.OMETiffExporter.lambda$export$0(OMETiffExporter.java:484)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.InterruptedException: The pool has been closed
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:141)
        at net.imglib2.cache.ref.BoundedSoftRefLoaderCache.get(BoundedSoftRefLoaderCache.java:87)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.get(LoaderCacheKeyAdapter.java:53)
        at net.imglib2.cache.util.LoaderCacheAsCacheAdapter.get(LoaderCacheAsCacheAdapter.java:76)
        at net.imglib2.cache.ref.WeakRefVolatileCache.getBlocking(WeakRefVolatileCache.java:484)
        at net.imglib2.cache.ref.WeakRefVolatileCache.get(WeakRefVolatileCache.java:205)
        at net.imglib2.cache.util.VolatileCacheAsUncheckedVolatileCacheAdapter.get(VolatileCacheAsUncheckedVolatileCacheAdapter.java:70)
        ... 18 more
Caused by: java.lang.InterruptedException: The pool has been closed
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:119)
        at ch.epfl.biop.bdv.img.bioformats.BioFormatsArrayLoaders$BioFormatsUnsignedByteArrayLoader.loadArray(BioFormatsArrayLoaders.java:76)
        at bdv.img.cache.VolatileGlobalCellCache.lambda$createImg$0(VolatileGlobalCellCache.java:196)
        at net.imglib2.cache.util.LoaderCacheKeyAdapter.lambda$get$0(LoaderCacheKeyAdapter.java:55)
        at net.imglib2.cache.ref.WeakRefLoaderCache.get(WeakRefLoaderCache.java:135)
        ... 24 more

Here's the way that I called the function:

    config = [
        f"input_path=[{file_location}]",
        f"output_dir=[{temp_dir}]",
        "compression=JPEG-2000",
        "override_voxel_size=false"
        ]
    ij.IJ.run(
        "Kheops - Convert File to Pyramidal OME TIFF",
        ' '.join(config))

and here's how I initialized Imagej

        ij = imagej.init([
            'ch.epfl.biop:ijp-kheops',
            'sc.fiji:Stitching_'
            ])

Again, I've already got the stitching part to work so I know that my setup is decent, but any insights you can offer around what might be happening with the kheops part would be much appreciated.

Thank you!

NicoKiaru commented 4 months ago

Ah, there's something fishy here:

java.lang.InterruptedException: The pool has been closed

I need to try to use kheops like you, headless in pyimagej. Maybe this is what triggers the issue. Have you tried directly in ImageJ / Fiji ? Can you potentially share a small example tiff you use in case the problem is data specific ?

NicoKiaru commented 4 months ago

Can you please try with this initialisation ?

import imagej
ij = imagej.init(['ch.epfl.biop:ijp-kheops:0.5.0'])

And then, if you want to keep 'stitching' to still specify the kheops version ?

(I couldn't reproduce your issue in pyimagej launching Kheops the way you did)

NicoKiaru commented 4 months ago

I observed a similar behaviour recently. Most probably it is because your original file is not calibrated. You can directly fix this by calling kheops and specifying the pixel size and using the checkbox 'override pixel size' in the kheops command. Alternatively you have a put a calibration in the original file to convert