wsi

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slide

type Slide struct {
	// contains filtered or unexported fields
}

Slide 封装 openslide_t 指针 Slide wraps the openslide_t pointer

func Open

func Open(path string) (*Slide, error)

Open 打开一张 WSI Open opens a WSI file

func (*Slide) Close

func (s *Slide) Close()

Close 关闭 WSI Close closes the WSI file

func (*Slide) Downsample

func (s *Slide) Downsample(level int) (float64, error)

Downsample 返回某一层相对 0 层的 downsample 倍数 Downsample returns the downsample factor of a specific level relative to level 0

func (*Slide) GetAssociatedImageNames

func (s *Slide) GetAssociatedImageNames() []string

GetAssociatedImageNames 获取所有关联图像名称 GetAssociatedImageNames returns all associated image names

func (*Slide) GetBestLevelForDownsample

func (s *Slide) GetBestLevelForDownsample(downsample float64) int

GetBestLevelForDownsample 返回给定 downsample 倍数下的最佳层级 GetBestLevelForDownsample returns the best level for the given downsample factor

func (*Slide) GetProperty

func (s *Slide) GetProperty(name string) string

GetProperty 获取指定的属性值 GetProperty returns the value of a specific property

func (*Slide) GetPropertyNames

func (s *Slide) GetPropertyNames() []string

GetPropertyNames 获取所有属性名称 GetPropertyNames returns all property names

func (*Slide) LevelCount

func (s *Slide) LevelCount() int

LevelCount 返回金字塔层数 LevelCount returns the number of pyramid levels

func (*Slide) LevelDimensions

func (s *Slide) LevelDimensions(level int) (w, h int64, err error)

LevelDimensions 返回某一层的宽高 LevelDimensions returns the dimensions (width, height) of a specific level

func (*Slide) LevelToBase

func (s *Slide) LevelToBase(level int, localX, localY int64) (baseX, baseY int64, err error)

Helper: 将某一层的局部坐标转换为 level 0 坐标 localX, localY 是某 level 下的左上角坐标 Helper: Converts local coordinates of a level to level 0 coordinates localX, localY are the top-left coordinates at a specific level

func (*Slide) ReadAssociatedImage

func (s *Slide) ReadAssociatedImage(name string) (*image.RGBA, error)

ReadAssociatedImage 读取关联图像 ReadAssociatedImage reads an associated image

func (*Slide) ReadRegion

func (s *Slide) ReadRegion(x, y int64, level int, w, h int64) (*image.RGBA, error)

ReadRegion 读取一块区域,返回 image.RGBA x, y 是在 level=0 坐标系中的左上角(注意单位是像素) level 是要读取的金字塔层 w, h 是要读取的宽高(单位:像素,基于当前 level) ReadRegion reads a region and returns image.RGBA x, y are the top-left coordinates in the level 0 coordinate system (unit: pixels) level is the pyramid level to read w, h are the width and height to read (unit: pixels, based on current level)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL