Class OpenSlideLoader
java.lang.Object
qupath.lib.images.servers.openslide.jna.OpenSlideLoader
Static helper class to manage loading the OpenSlide library.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringdetectVendor(String path) Try to detect the vendor of the image at the specified path.static StringGet the version of the OpenSlide library.static booleanQuery whether OpenSlide has already been loaded.static OpenSlideOpen an image using OpenSlide, returning an OpenSlide instance to access pixels and metadata.static booleanTry to load OpenSlide.static booleantryToLoadQuietly(String... searchPath) Try to load OpenSlide, but don't throw an exception if it fails.
- 
Constructor Details- 
OpenSlideLoaderpublic OpenSlideLoader()
 
- 
- 
Method Details- 
tryToLoadQuietlyTry to load OpenSlide, but don't throw an exception if it fails.- Parameters:
- searchPath- optional search paths that may be provided to assist with finding the preferred library.
- Returns:
- true if OpenSlide was loaded successfully, false otherwise.
 
- 
tryToLoadTry to load OpenSlide. This is liable to throw an exception if the library cannot be loaded.- Parameters:
- searchPath- optional search paths that may be provided to assist with finding the preferred library.
- Returns:
- true if OpenSlide was loaded successfully, false otherwise.
- Throws:
- UnsatisfiedLinkError
 
- 
getLibraryVersionGet the version of the OpenSlide library. This will attempt to load OpenSlide if it is not already available.- Returns:
- a version string for the library, or null if the library is not available
 
- 
isOpenSlideAvailablepublic static boolean isOpenSlideAvailable()Query whether OpenSlide has already been loaded. This will not attempt to load the library; for that, use #tryToLoadQuietly(),getLibraryVersion()ortryToLoad(String...).- Returns:
- true if OpenSlide has been loaded successfully, false otherwise
 
- 
openImageOpen an image using OpenSlide, returning an OpenSlide instance to access pixels and metadata.This will attempt to load OpenSlide if it has not already been loaded, throwing an IOExceptionif this fails. UseisOpenSlideAvailable()to check whether OpenSlide is available before calling this.- Parameters:
- path- the image path (usually an absolute file path)
- Returns:
- an OpenSlide instance
- Throws:
- IOException- if OpenSlide could not be loaded failed to open the file
 
- 
detectVendorTry to detect the vendor of the image at the specified path. This will attempt to load OpenSlide if it has not already been loaded.- Parameters:
- path- the image path (usually an absolute file path)
- Returns:
- a vendor string if available, or null if OpenSlide could not be loaded or does not recognize the file
 
 
-