BDV: store relative path instead of absolute - #4440
Open
melissalinkert wants to merge 1 commit into
Open
Conversation
sbesson
requested changes
Aug 17, 2026
sbesson
left a comment
Member
There was a problem hiding this comment.
Using this change, I can still reproduce the original issue by creating a cache file, renaming the directory and reinitializing the reader
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv % ../bftools/showinf -version
Version: 8.5.0
Build date: 18 March 2026
VCS revision: 877c317e4e396381dc76e56c1539b24947f71dce
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv % ../bftools/showinf -nopix -cache drosophila.xml | grep memo
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv % ../bftools/showinf -nopix -cache drosophila.xml | grep memo
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv % cd ../
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % mv bdv bdv2
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % cd bdv2
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv2 % ../bftools/showinf -nopix -cache drosophila.xml | grep memo
Exception in thread "main" ch.systemsx.cisd.hdf5.exceptions.HDF5FileNotFoundException: Path does not exit. (/Users/sbesson/Downloads/bdv/drosophila.h5)
at ch.systemsx.cisd.hdf5.HDF5BaseReader.openFile(HDF5BaseReader.java:221)
at ch.systemsx.cisd.hdf5.HDF5BaseReader.<init>(HDF5BaseReader.java:177)
at ch.systemsx.cisd.hdf5.HDF5BaseReader.<init>(HDF5BaseReader.java:155)
at ch.systemsx.cisd.hdf5.HDF5ReaderConfigurator.reader(HDF5ReaderConfigurator.java:81)
at ch.systemsx.cisd.hdf5.HDF5FactoryProvider$HDF5Factory.openForReading(HDF5FactoryProvider.java:55)
at ch.systemsx.cisd.hdf5.HDF5Factory.openForReading(HDF5Factory.java:62)
at loci.formats.services.JHDFServiceImpl.setFile(JHDFServiceImpl.java:92)
at loci.formats.in.BDVReader.initializeJHDFService(BDVReader.java:378)
at loci.formats.in.BDVReader.reopenFile(BDVReader.java:365)
at loci.formats.ImageReader.reopenFile(ImageReader.java:870)
at loci.formats.Memoizer.setId(Memoizer.java:712)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:692)
at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:1054)
at loci.formats.tools.ImageInfo.main(ImageInfo.java:1165)
With this PR included the workflow above is fixed
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv2 % rm .drosophila.xml.bfmemo
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv2 % ~/Documents/GitHub/bioformats/tools/showinf -version
Version: 8.6.0-SNAPSHOT
Build date: 17 August 2026
VCS revision: 2803431bd9d4bb9779eaf3f3792c983497657928
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv2 % ~/Documents/GitHub/bioformats/tools/showinf -nopix -cache -debug drosophila.xml | grep memo
saved to temp file: /Users/sbesson/Downloads/bdv2/.drosophila.xml.bfmemo2740089922917667026
saved memo file: /Users/sbesson/Downloads/bdv2/.drosophila.xml.bfmemo (53141 bytes)
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv2 % ~/Documents/GitHub/bioformats/tools/showinf -nopix -cache -debug drosophila.xml | grep memo
loaded memo file: /Users/sbesson/Downloads/bdv2/.drosophila.xml.bfmemo (53141 bytes)
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv2 % cd ../
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % mv bdv2 bdv
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % cd bdv
sbesson@Sebastien-GS-MacBook-Pro-2025 bdv % ~/Documents/GitHub/bioformats/tools/showinf -nopix -cache -debug drosophila.xml | grep memo
loaded memo file: /Users/sbesson/Downloads/bdv/.drosophila.xml.bfmemo (53141 bytes)
However, initializing the file from one directory above still fails with HDF5FileNotFoundException
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % rm bdv/.drosophila.xml.bfmemo
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % ~/Documents/GitHub/bioformats/tools/showinf -nopix -cache -debug bdv/drosophila.xml | grep memo
saved to temp file: /Users/sbesson/Downloads/bdv/.drosophila.xml.bfmemo2581172668934219037
saved memo file: /Users/sbesson/Downloads/bdv/.drosophila.xml.bfmemo (53144 bytes)
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % ~/Documents/GitHub/bioformats/tools/showinf -nopix -cache -debug bdv/drosophila.xml | grep memo
loaded memo file: /Users/sbesson/Downloads/bdv/.drosophila.xml.bfmemo (53144 bytes)
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % mv bdv bdv2
sbesson@Sebastien-GS-MacBook-Pro-2025 Downloads % ~/Documents/GitHub/bioformats/tools/showinf -nopix -cache -debug bdv2/drosophila.xml | grep memo
loaded memo file: /Users/sbesson/Downloads/bdv2/.drosophila.xml.bfmemo (53144 bytes)
Exception in thread "main" ch.systemsx.cisd.hdf5.exceptions.HDF5FileNotFoundException: Path does not exit. (/Users/sbesson/Downloads/bdv/drosophila.h5)
at ch.systemsx.cisd.hdf5.HDF5BaseReader.openFile(HDF5BaseReader.java:221)
at ch.systemsx.cisd.hdf5.HDF5BaseReader.<init>(HDF5BaseReader.java:177)
at ch.systemsx.cisd.hdf5.HDF5BaseReader.<init>(HDF5BaseReader.java:155)
at ch.systemsx.cisd.hdf5.HDF5ReaderConfigurator.reader(HDF5ReaderConfigurator.java:81)
at ch.systemsx.cisd.hdf5.HDF5FactoryProvider$HDF5Factory.openForReading(HDF5FactoryProvider.java:55)
at ch.systemsx.cisd.hdf5.HDF5Factory.openForReading(HDF5Factory.java:62)
at loci.formats.services.JHDFServiceImpl.setFile(JHDFServiceImpl.java:92)
at loci.formats.in.BDVReader.initializeJHDFService(BDVReader.java:387)
at loci.formats.in.BDVReader.reopenFile(BDVReader.java:374)
at loci.formats.ImageReader.reopenFile(ImageReader.java:870)
at loci.formats.Memoizer.setId(Memoizer.java:712)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:692)
at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:1054)
at loci.formats.tools.ImageInfo.main(ImageInfo.java:1165)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3957.
I could easily reproduce the original issue in #3957 with
curated/bdv/public/samples/:This fix does not make it so that a pre-existing memo file will work, but does make it so that newly generated memo files no longer exhibit this problem.
I have not tried to address any more structural concerns about relative vs absolute paths in memo files that were mentioned in #3957. We likely need to discuss that internally first, given the potential impact on OMERO.