We're Hiring!

64-bit LegacyND2Reader.dll

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

64-bit LegacyND2Reader.dll

Postby jborbely » Wed Nov 25, 2015 9:38 am

I have installed the 64-bit version of Nikon’s ND2 reader plugin for ImageJ (http://rsb.info.nih.gov/ij/plugins/nd2-reader.html) to read the ND2 file format.

I have downloaded the LegacyND2Reader.dll file from https://www.openmicroscopy.org/site/support/bio-formats5.1/formats/nikon-nis-elements-nd2.html.

The LegacyND2Reader.dll is found in my java.library.path, but loading this library throws an UnsatisfiedLinkError exception. Here is the relevant stack trace

Code: Select all
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\code\git\AFIB\LegacyND2Reader.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(Unknown Source)
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)


Is there a 64-bit version of LegacyND2Reader.dll available to download?

Thanks,
Joe
jborbely
 
Posts: 4
Joined: Wed Nov 25, 2015 7:52 am

Re: 64-bit LegacyND2Reader.dll

Postby dgault » Fri Nov 27, 2015 3:11 pm

Hi Joe,

Thank you for getting in contact and providing the stack trace. We have 2 separate readers for ND2 files within Bio-Formats, the Legacy ND2 reader will only be used under specific circumstances. We do not currently have a 64 bit version of this dll but it may not be necessary for you to use the legacy reader in this scenario.

If you remove the LegacyND2Reader.dll are you able to successfully import your files ok?
Alternatively are you able to open the files if imported via the Bio-Formats plugin?

With Thanks,
David
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: 64-bit LegacyND2Reader.dll

Postby jborbely » Fri Nov 27, 2015 9:19 pm

Hi David,

Thanks for your reply.

Yes, if I remove LegacyND2Reader.dll from java.library.path then the NativeND2Reader is able to import the ND2 file.

I was looking for a way to improve the import performance when we load an ND2 file into Fiji. We find that it can take > 10 minutes to import some of our ND2 files into Fiji. While the file is being imported Fiji does not provide any indication that it is still processing the import command and so the students give up and assume that Fiji is not doing anything. Our group only uses Windows x64 and so I am only looking for a Windows 64-bit solution.

Is there any plan for the bioformats development team to build a 64-bit DLL to correspond with the ImageJ-ND-Viewer-Plugin-64bit.msi (http://rsb.info.nih.gov/ij/plugins/nd2-reader.html)?

If not, would you be able to point me to where I could get the jp2sdk.h header file that is needed to compile the cpp file (https://github.com/openmicroscopy/bioformats/blob/v5.1.6/components/formats-gpl/src/loci/formats/in/loci_formats_in_LegacyND2Reader.cpp) that is found in the bioformats github repository?

Thanks for any help.

Best,
Joe
jborbely
 
Posts: 4
Joined: Wed Nov 25, 2015 7:52 am

Re: 64-bit LegacyND2Reader.dll

Postby mlinkert » Mon Nov 30, 2015 10:55 pm

Hi Joe,

Is there any plan for the bioformats development team to build a 64-bit DLL to correspond with the ImageJ-ND-Viewer-Plugin-64bit.msi (http://rsb.info.nih.gov/ij/plugins/nd2-reader.html)?

If not, would you be able to point me to where I could get the jp2sdk.h header file that is needed to compile the cpp file (https://github.com/openmicroscopy/biofo ... Reader.cpp) that is found in the bioformats github repository?


We unfortunately don't have a 64-bit DLL, nor do we currently have plans to distribute one (see https://trello.com/c/ezNfoTIL/56-clarif ... ary-status). Demand for this particular feature has been fairly minimal to date.

jp2sdk.h is part of v6_gnr_imageformat_jp2.dll, which is installed by the ND Viewer .msi linked above. It should work to compile loci_formats_in_LegacyND2Reader.* against that one .dll. You may wish to first try the existing 32-bit DLL on a 32-bit JVM though, to see if the DLL-based reader will actually be faster with your data - past experience and feedback suggest that is often not the case.

If you do find that the DLL-based reader is faster, please do let us know and we'll make it a higher priority to update documentation and better support this feature.

Regards,
-Melissa
User avatar
mlinkert
Team Member
 
Posts: 353
Joined: Fri May 29, 2009 2:12 pm
Location: Southwest Wisconsin

Re: 64-bit LegacyND2Reader.dll

Postby jborbely » Tue Dec 01, 2015 11:53 am

You may wish to first try the existing 32-bit DLL on a 32-bit JVM though

Thanks for your suggestion Melissa. I installed a 32-bit version of Fiji and ImageJ-ND-Viewer-Plugin-32bit.msi (installing it to the Fiji directory as instructed in the PDF http://rsb.info.nih.gov/ij/plugins/docs/ND2Reader.pdf) and added LegacyND2Reader.dll to Fiji's plugin folder. The importing performance in Fiji/Bioformats with the DLL-based reader is indeed the same, however, I am not 100% convinced that Fiji is using the DLL-based reader of Bioformats and not falling back on the NativeND2Reader upon getting an UnsatisfiedLinkError.

Here is the reason behind my suspicion.

1) I created a new folder call D:\nd2test, copied LegacyND2Reader.dll into this folder and selected this folder as the installation folder for installing ImageJ-ND-Viewer-Plugin-32bit.msi

2) I created the following Java program
Code: Select all
public class TestLegacyND2Reader {

   public static void main(String[] args) {      
      System.loadLibrary("LegacyND2Reader");
   }

}

3) I added the nd2test folder to my java.library.path (i.e., -Djava.library.path=D:\nd2test)

When I run this program I get an UnsatisfiedLinkError exception. Here's the stack trace
Code: Select all
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\nd2test\LegacyND2Reader.dll: Can't find dependent libraries
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
   at java.lang.Runtime.loadLibrary0(Runtime.java:823)
   at java.lang.System.loadLibrary(System.java:1028)

Besides the LegacyND2Reader, ipp*, v6* and a few other DLLs included with the msi installer (there are a total of 29 DLLs in my nd2test folder) would you happen to know what dependencies are required to load LegacyND2Reader?

Is there a way to know that when an ND2 file is imported into Fiji using the Bio-Formats Import Options plugin that the DLL-based reader was successfully used to import the file?

Thanks,
Joe
jborbely
 
Posts: 4
Joined: Wed Nov 25, 2015 7:52 am

Re: 64-bit LegacyND2Reader.dll

Postby mlinkert » Tue Dec 01, 2015 7:14 pm

Hi Joe,

Besides the LegacyND2Reader, ipp*, v6* and a few other DLLs included with the msi installer (there are a total of 29 DLLs in my nd2test folder) would you happen to know what dependencies are required to load LegacyND2Reader?


LegacyND2Reader.dll, the "bin" directory of your JRE/JDK installation, plus everything installed by the .msi should be enough. Usually problems like this are a result of the java.library.path not being picked up correctly, so you probably want to check the value of that system property in your test class. It should include the folder that you've set as well as something that ends in "jre\bin".

Is there a way to know that when an ND2 file is imported into Fiji using the Bio-Formats Import Options plugin that the DLL-based reader was successfully used to import the file?


The easiest thing way is to switch to using the DLL-based reader by default. If you select "Plugins > Bio-Formats > Bio-Formats Plugin Configuration" in ImageJ, choose "Nikon ND2" from the list on the "Formats" tab, and then check the "Use Nikon's ND2 library..." box, that should do it.

You can confirm that the DLLs are all installed correctly by selecting "Plugins > Bio-Formats > Bio-Formats Plugin Configuration", then "Nikon ND2 plugin" in the "Libraries" tab. The status field should be set to "Installed" if everything installed correctly. If you check the "Display metadata" box during import, that will also serve as a secondary check - the DLL-based reader will show very little metadata by comparison.

-Melissa
User avatar
mlinkert
Team Member
 
Posts: 353
Joined: Fri May 29, 2009 2:12 pm
Location: Southwest Wisconsin

Re: 64-bit LegacyND2Reader.dll

Postby jborbely » Wed Dec 02, 2015 10:35 am

Hi Melissa,
LegacyND2Reader.dll, the "bin" directory of your JRE/JDK installation, plus everything installed by the .msi should be enough

My test code now looks like
Code: Select all
public static void main(String[] args) {
    System.out.println(System.getProperty("java.library.path"));
    System.loadLibrary("LegacyND2Reader");
}

With the following output (NOTE: I truncated the part from "${env_var:PATH}"; since it is very long)
Code: Select all
D:\nd2test;D:\Fiji_win32.app\java\win32\jdk1.6.0_24\jre\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5\bin;...;
Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\nd2test\LegacyND2Reader.dll: Can't find dependent libraries
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
   at java.lang.Runtime.loadLibrary0(Runtime.java:823)
   at java.lang.System.loadLibrary(System.java:1028)

If you select "Plugins > Bio-Formats > Bio-Formats Plugin Configuration" in ImageJ, choose "Nikon ND2" from the list on the "Formats" tab, and then check the "Use Nikon's ND2 library..." box, that should do it.

By selecting that box, and importing a ND2 file I get the following exception
Code: Select all
(Fiji Is Just) ImageJ 2.0.0-rc-43/1.50e; Java 1.6.0_24 [32-bit]; Windows 7 6.1; 88MB of 1223MB (7%)

java.lang.IllegalArgumentException: 0 must not be null and positive.
   at ome.xml.model.primitives.PositiveInteger.<init>(PositiveInteger.java:48)
   at loci.formats.MetadataTools.populatePixelsOnly(MetadataTools.java:292)
   at loci.formats.MetadataTools.populatePixelsOnly(MetadataTools.java:266)
   at loci.formats.ChannelFiller.setId(ChannelFiller.java:227)
   at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:651)
   at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:289)
   at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:651)
   at loci.formats.DimensionSwapper.setId(DimensionSwapper.java:293)
   at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:651)
   at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:651)
   at loci.plugins.in.ImportProcess.setId(ImportProcess.java:703)
   at loci.plugins.in.ImportProcess.initializeStack(ImportProcess.java:557)
   at loci.plugins.in.ImportProcess.execute(ImportProcess.java:147)
   at loci.plugins.in.Importer.showDialogs(Importer.java:140)
   at loci.plugins.in.Importer.run(Importer.java:76)
   at loci.plugins.LociImporter.run(LociImporter.java:78)
   at ij.IJ.runUserPlugIn(IJ.java:212)
   at ij.IJ.runPlugIn(IJ.java:176)
   at ij.IJ.runPlugIn(IJ.java:165)
   at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:499)
   at HandleExtraFileTypes.run(HandleExtraFileTypes.java:72)
   at ij.IJ.runUserPlugIn(IJ.java:212)
   at ij.IJ.runPlugIn(IJ.java:176)
   at ij.IJ.runPlugIn(IJ.java:165)
   at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:503)
   at ij.io.Opener.openImage(Opener.java:369)
   at ij.io.Opener.openImage(Opener.java:243)
   at ij.io.Opener.open(Opener.java:110)
   at ij.io.Opener.openAndAddToRecent(Opener.java:292)
   at ij.plugin.DragAndDrop.openFile(DragAndDrop.java:181)
   at ij.plugin.DragAndDrop.run(DragAndDrop.java:152)
   at java.lang.Thread.run(Thread.java:662)

The file is successfully imported by unselecting that box.

When opening D:\nd2test\LegacyND2Reader.dll in Dependency Walker (http://www.dependencywalker.com/) the following libraries are reported as missing: MSVCR71D.DLL, V6_GNR_JP2SDK.DLL.

jp2sdk.h is part of v6_gnr_imageformat_jp2.dll, which is installed by the ND Viewer

I still seem to have issues with this jp2sdk dependency. v6_gnr_imageformat_jp2.dll is located in my D:\nd2test directory. Any suggestions/comments about the missing dependencies? (since Google has no knowledge of V6_GNR_JP2SDK, then neither do I)

Is anyone on the bioformats dev team currently able to open a ND2 file using the DLL-based reader with the latest version of ImageJ?

Kind regards,
Joe
jborbely
 
Posts: 4
Joined: Wed Nov 25, 2015 7:52 am


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest