openslide wrapper
More...
|
| SlideImage () |
|
ImageDimension | GetLevelDimension (int level) |
| Get the dimensions of a level. More...
|
|
IEnumerable< ImageDimension > | GetLevelDimensions () |
| Get all level dimensions. More...
|
|
unsafe byte[] | ReadRegion (int level, long x, long y, long width, long height) |
| Copy pre-multiplied BGRA data from a whole slide image. More...
|
|
unsafe 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. More...
|
|
void | Close () |
|
void | Dispose () |
|
async Task< byte[]> | ReadRegionAsync (int level, long curLevelOffsetXPixel, long curLevelOffsetYPixel, int curTileWidth, int curTileHeight, ZCT coord) |
|
|
BioImage | BioImage [get, set] |
|
int | LevelCount [get] |
| Get the number of levels in the whole slide image. More...
|
|
ImageDimension | Dimensions [get] |
| Get the dimensions of level 0 (the largest level). Exactly equivalent to calling GetLevelDimensions(0). More...
|
|
openslide wrapper
Definition at line 19 of file SlideImage.cs.
◆ SlideImage()
BioCore.SlideImage.SlideImage |
( |
| ) |
|
- Parameters
-
handle | |
isOwner | close handle when disposed |
- Exceptions
-
Definition at line 49 of file SlideImage.cs.
◆ CalculateBaseFactor()
static double BioCore.SlideImage.CalculateBaseFactor |
( |
int |
originalResolution, |
|
|
int |
lastLevelResolution, |
|
|
int |
totalLevels |
|
) |
| |
|
static |
Calculates the base downsampling factor between two levels of a slide.
- Parameters
-
originalDimension | The dimension (width or height) of the original level. |
nextLevelDimension | The dimension (width or height) of the next level. |
- Returns
- The base downsampling factor.
Definition at line 151 of file SlideImage.cs.
◆ Close()
void BioCore.SlideImage.Close |
( |
| ) |
|
◆ DetectVendor()
static string BioCore.SlideImage.DetectVendor |
( |
string |
filename | ) |
|
|
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
.
- Parameters
-
filename | The filename to check. On Windows, this must be in UTF-8. |
- Returns
- An identification of the format vendor for this file, or NULL.
Definition at line 39 of file SlideImage.cs.
◆ Dispose() [1/2]
void BioCore.SlideImage.Dispose |
( |
| ) |
|
◆ Dispose() [2/2]
virtual void BioCore.SlideImage.Dispose |
( |
bool |
disposing | ) |
|
|
protectedvirtual |
◆ GetLevelDimension()
ImageDimension BioCore.SlideImage.GetLevelDimension |
( |
int |
level | ) |
|
Get the dimensions of a level.
- Parameters
-
- Exceptions
-
Definition at line 127 of file SlideImage.cs.
◆ GetLevelDimensions()
IEnumerable< ImageDimension > BioCore.SlideImage.GetLevelDimensions |
( |
| ) |
|
Get all level dimensions.
- Returns
- Exceptions
-
Definition at line 137 of file SlideImage.cs.
◆ GetLevelDownsamples()
static List< double > BioCore.SlideImage.GetLevelDownsamples |
( |
double |
baseDownsampleFactor, |
|
|
int |
totalLevels |
|
) |
| |
|
static |
Calculates the downsample factors for each level of a slide.
- Parameters
-
baseDownsampleFactor | The downsample factor between each level. |
totalLevels | Total number of levels in the slide. |
- Returns
- A list of downsample factors for each level.
Definition at line 173 of file SlideImage.cs.
◆ Initialize()
static void BioCore.SlideImage.Initialize |
( |
string |
path = null | ) |
|
|
static |
Add .dll directory to PATH
- Parameters
-
- Exceptions
-
Definition at line 59 of file SlideImage.cs.
◆ Open()
Open.
- Parameters
-
- Returns
- Exceptions
-
Definition at line 74 of file SlideImage.cs.
◆ ReadRegion()
unsafe byte[] BioCore.SlideImage.ReadRegion |
( |
int |
level, |
|
|
long |
x, |
|
|
long |
y, |
|
|
long |
width, |
|
|
long |
height |
|
) |
| |
Copy pre-multiplied BGRA data from a whole slide image.
- Parameters
-
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. |
- Returns
- The pixel data of this region.
- Exceptions
-
ArgumentOutOfRangeException | - Exceptions
-
|
Definition at line 225 of file SlideImage.cs.
◆ ReadRegionAsync()
async Task< byte[]> BioCore.SlideImage.ReadRegionAsync |
( |
int |
level, |
|
|
long |
curLevelOffsetXPixel, |
|
|
long |
curLevelOffsetYPixel, |
|
|
int |
curTileWidth, |
|
|
int |
curTileHeight, |
|
|
ZCT |
coord |
|
) |
| |
◆ TryReadRegion()
unsafe bool BioCore.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.
- Parameters
-
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. |
- Returns
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>
Definition at line 240 of file SlideImage.cs.
◆ BioImage
◆ Dimensions
ImageDimension BioCore.SlideImage.Dimensions |
|
get |
Get the dimensions of level 0 (the largest level). Exactly equivalent to calling GetLevelDimensions(0).
- Exceptions
-
Definition at line 107 of file SlideImage.cs.
◆ LevelCount
int BioCore.SlideImage.LevelCount |
|
get |
Get the number of levels in the whole slide image.
<return>The number of levels, or -1 if an error occurred.</return>
- Exceptions
-
Definition at line 86 of file SlideImage.cs.
The documentation for this class was generated from the following file: