Error opening Bdv xml/hdf5 files in QuPath

Hi!

Since Bioformats can open xml/hdf5 datasets from Bigdataviewer, I’ve decided to have a look at such a dataset on QuPath. To do that:

  • I added the latest (28th Nov 2019) bioformats_package.jar from bioformats website in QuPath extensions folder. However, when I try to import a xml/hdf5 dataset, QuPath gives me an error (not informative : just cannot open file).
  • Since Fiji and the Bioformats importer can open my bdv dataset, in Fiji, I copy-pasted all jars in the Bioformats folder into QuPath extensions directory:
    image

This time, QuPath is not displaying an error message… but it hangs forever.

Has any of you got any luck with QuPath and Xml/Hdf5 files ?

More info:

I get two images like this in 0.2.0m7.
image
Both images only show up if opened in a project. Dragging and dropping into a non-project only gets the first image. This is fairly standard now for files that include multiple files.

It likely has to do with some of the changes made during the updated milestone versions.
The full error message for 0.1.3 listed below.

ERROR: Unable to open C:\Users\Downloads\TestBdvExport\TestBdvExport\test.h5
    at loci.formats.ImageReader.getReader(ImageReader.java:197)
    at loci.formats.ImageReader.setId(ImageReader.java:839)
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
    at loci.formats.Memoizer.setId(Memoizer.java:690)
    at qupath.lib.images.servers.BioFormatsImageServer$BioFormatsReaderManager.createReader(BioFormatsImageServer.java:1312)
    at qupath.lib.images.servers.BioFormatsImageServer$BioFormatsReaderManager.createReader(BioFormatsImageServer.java:1253)
    at qupath.lib.images.servers.BioFormatsImageServer$BioFormatsReaderManager.getPrimaryReader(BioFormatsImageServer.java:1167)
    at qupath.lib.images.servers.BioFormatsImageServer.<init>(BioFormatsImageServer.java:258)
    at qupath.lib.images.servers.BioFormatsImageServer.<init>(BioFormatsImageServer.java:230)
    at qupath.lib.images.servers.BioFormatsServerBuilder.buildServer(BioFormatsServerBuilder.java:54)
    at qupath.lib.images.servers.ImageServerProvider.buildServer(ImageServerProvider.java:115)
    at qupath.lib.gui.QuPathGUI.openImage(QuPathGUI.java:2262)
    at qupath.lib.gui.viewer.DragDropFileImportListener.handleFileDrop(DragDropFileImportListener.java:265)
    at qupath.lib.gui.viewer.DragDropFileImportListener.handle(DragDropFileImportListener.java:117)
    at qupath.lib.gui.viewer.DragDropFileImportListener.handle(DragDropFileImportListener.java:61)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.Scene$DnDGesture.fireEvent(Scene.java:2933)
    at javafx.scene.Scene$DnDGesture.processTargetDrop(Scene.java:3159)
    at javafx.scene.Scene$DnDGesture.access$6400(Scene.java:2909)
    at javafx.scene.Scene$DropTargetListener.drop(Scene.java:2873)
    at com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.lambda$handleDragDrop$308(GlassSceneDnDEventHandler.java:95)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.quantum.GlassSceneDnDEventHandler.handleDragDrop(GlassSceneDnDEventHandler.java:92)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleDragDrop$362(GlassViewEventHandler.java:745)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleDragDrop(GlassViewEventHandler.java:744)
    at com.sun.glass.ui.View.handleDragDrop(View.java:712)
    at com.sun.glass.ui.View.notifyDragDrop(View.java:1037)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177)
    at java.lang.Thread.run(Thread.java:748)
ERROR: Unable to build whole slide server - check your classpath for a suitable library (e.g. OpenSlide, BioFormats)
3 Likes

Throughout the v0.2.0 milestones I made numerous improvements to how QuPath uses BioFormats as I grew to understand it better. I’d recommend trying v0.2.0-m7 and adding your image to a project To see if it works.

(Also, there is no official v0.1.4 that I know of - so I guess you’re using a fork from someone else.)

2 Likes

Great, thank you. I tried with the latest version of QuPath and it worked!

Indeed we branched the v0.1.3 to make some customizations. (https://github.com/BIOP/qupath/tree/biop/dev-v0.1.4)

We plan to move to more recent versions but that’s a lot of work, and we need stability because we have many users with customized scripts for their workflows. So far only v0.1.2 is written as stable on this page : https://qupath.github.io/.

Thanks for your help and advice.

The next issue for this file is that the two ‘channels’ are shown as two series. I’ll check whether it’s an issue on my side when I save the bdv file or if it’s somethings that needs to be handled by BioFormats. Maybe there’s a fix that could be done on QuPath side, but I don’t think it’s a good idea at the moment.

Best,

Nicolas

2 Likes

Yeah, that makes sense - for now i need instability to be able to make changes needed to support new features required over the next few years, while still trying to make distributions available for testing and feedback :slight_smile:

There are hacks in the (milestone) versions of QuPath to handle merging separate images as channels… QuPath multiple channel in separate files - how to merge them?
But I agree it’s much better to solve it elsewhere if possible.

2 Likes

My fault! I need to declare two channels in the xml file:

  <ViewSetups>
      <ViewSetup>
        <id>0</id>
        <name>10x_02-FL FITC</name>
        <size>17089 10955 1</size>
        <voxelSize>
          <unit>mm</unit>
          <size>6.441754665378626E-4 6.441938750865264E-4 1.0</size>
        </voxelSize>
        <attributes>
          <channel>1</channel>
        </attributes>
      </ViewSetup>
      <ViewSetup>
        <id>1</id>
        <name>10x_01-FL FITC_xfm_1_ResampledLike_10x_02-FL DAPI</name>
        <size>17089 10955 1</size>
        <voxelSize>
          <unit>mm</unit>
          <size>6.441754665378626E-4 6.441938750865264E-4 1.0</size>
        </voxelSize>
        <attributes>
          <channel>2</channel>
        </attributes>
      </ViewSetup>
      <Attributes name="channel">
        <Channel>
          <id>1</id>
          <name>1</name>
        </Channel>
        <Channel>
          <id>2</id>
          <name>2</name>
        </Channel>
      </Attributes>
    </ViewSetups>
2 Likes