![]() |
BioLib
4.1.1
A GUI-less version of Bio .NET library for editing & annotating various microscopy image formats.
|
openslide wrapper More...
Public Member Functions | |
| SlideImage () | |
| ImageDimension | GetLevelDimension (int level) |
| IEnumerable< ImageDimension > | GetLevelDimensions () |
| Get all level dimensions. | |
| void | ResetDimensionsCache () |
| Clears the cached level-0 dimensions so Dimensions is re-derived from the active well field on the next access. Call this whenever BioImage.WellIndex changes for a well image. | |
| unsafe byte[] | ReadRegion (int level, ZCT zct, long x, long y, long width, long height) |
| Copy pre-multiplied BGRA data from a whole slide image. | |
| bool | TryReadRegion (int level, long x, long y, long width, long height, out byte[] data, ZCT zct) |
| Copy pre-multiplied BGRA data from a whole slide image. | |
| async Task< byte[]> | TryReadRegionAsync (int level, long x, long y, long width, long height, ZCT zct, CancellationToken ct=default) |
| Copy pre-multiplied BGRA data from a whole slide image. | |
| void | Close () |
| void | Dispose () |
| async Task< byte[]> | ReadRegionAsync (int level, long curLevelOffsetXPixel, long curLevelOffsetYPixel, int curTileWidth, int curTileHeight, ZCT coord, CancellationToken ct=default) |
Static Public Member Functions | |
| static string | DetectVendor (string filename) |
| Quickly determine whether a whole slide image is recognized. | |
| static void | Initialize (string path=null) |
| Add .dll directory to PATH. | |
| static SlideImage | Open (BioImage b) |
| Open. | |
| static double | CalculateBaseFactor (int originalResolution, int lastLevelResolution, int totalLevels) |
| Calculates the base downsampling factor between two levels of a slide. | |
| static List< double > | GetLevelDownsamples (double baseDownsampleFactor, int totalLevels) |
| Calculates the downsample factors for each level of a slide. | |
Protected Member Functions | |
| virtual void | Dispose (bool disposing) |
| Dispose. | |
Properties | |
| BioImage | BioImage [get, set] |
| int | LevelCount [get] |
| Get the number of levels in the whole slide image. | |
| ImageDimension | Dimensions [get] |
openslide wrapper
| BioLib.SlideImage.SlideImage | ( | ) |
| handle | |
| isOwner | close handle when disposed |
| OpenSlideException |
|
static |
Calculates the base downsampling factor between two levels of a slide.
| originalDimension | The dimension (width or height) of the original level. |
| nextLevelDimension | The dimension (width or height) of the next level. |
| void BioLib.SlideImage.Close | ( | ) |
|
static |
Quickly determine whether a whole slide image is recognized.
If OpenSlide recognizes the file referenced by filename , return a string identifying the slide format vendor.This is equivalent to the value of the NativeMethods.VENDOR property. Calling Open(string) on this file will return a valid OpenSlide object or an OpenSlide object in error state.
Otherwise, return null.Calling
Open(string) on this file will also return null.
| filename | The filename to check. On Windows, this must be in UTF-8. |
| void BioLib.SlideImage.Dispose | ( | ) |
|
protectedvirtual |
Dispose.
| disposing |
| ImageDimension BioLib.SlideImage.GetLevelDimension | ( | int | level | ) |
| IEnumerable< ImageDimension > BioLib.SlideImage.GetLevelDimensions | ( | ) |
Get all level dimensions.
| OpenSlideException |
|
static |
Calculates the downsample factors for each level of a slide.
| baseDownsampleFactor | The downsample factor between each level. |
| totalLevels | Total number of levels in the slide. |
|
static |
Add .dll directory to PATH.
| path |
| OpenSlideException |
|
static |
Open.
| filename |
| OpenSlideException |
| unsafe byte[] BioLib.SlideImage.ReadRegion | ( | int | level, |
| ZCT | zct, | ||
| long | x, | ||
| long | y, | ||
| long | width, | ||
| long | height ) |
Copy pre-multiplied BGRA data from a whole slide image.
| level | The desired level. |
| x | The top left x-coordinate, in the level 0 reference frame. |
| y | The top left y-coordinate, in the level 0 reference frame. |
| width | The width of the region. Must be non-negative. |
| height | The height of the region. Must be non-negative. |
| ArgumentOutOfRangeException |
|
| async Task< byte[]> BioLib.SlideImage.ReadRegionAsync | ( | int | level, |
| long | curLevelOffsetXPixel, | ||
| long | curLevelOffsetYPixel, | ||
| int | curTileWidth, | ||
| int | curTileHeight, | ||
| ZCT | coord, | ||
| CancellationToken | ct = default ) |
| bool BioLib.SlideImage.TryReadRegion | ( | int | level, |
| long | x, | ||
| long | y, | ||
| long | width, | ||
| long | height, | ||
| out byte[] | data, | ||
| ZCT | zct ) |
Copy pre-multiplied BGRA data from a whole slide image.
| level | The desired level. |
| x | The top left x-coordinate, in the level 0 reference frame. |
| y | The top left y-coordinate, in the level 0 reference frame. |
| width | The width of the region. Must be non-negative. |
| height | The height of the region. Must be non-negative. |
| data | The BGRA pixel data of this region. |
| async Task< byte[]> BioLib.SlideImage.TryReadRegionAsync | ( | int | level, |
| long | x, | ||
| long | y, | ||
| long | width, | ||
| long | height, | ||
| ZCT | zct, | ||
| CancellationToken | ct = default ) |
Copy pre-multiplied BGRA data from a whole slide image.
| level | The desired level. |
| x | The top left x-coordinate, in the level 0 reference frame. |
| y | The top left y-coordinate, in the level 0 reference frame. |
| width | The width of the region. Must be non-negative. |
| height | The height of the region. Must be non-negative. |
| data | The BGRA pixel data of this region. |
summary> Close an OpenSlide object. /summary> remarks> No other threads may be using the object. After this call returns, the object cannot be used anymore. /remarks>
|
getset |
|
get |
|
get |
Get the number of levels in the whole slide image.
<return>The number of levels, or -1 if an error occurred.</return>
| OpenSlideException |