gopenslide

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT, MIT Imports: 7 Imported by: 0

README

openslide

Just a Go wrapper around parts of the brilliant openslide libraries. See the og libs here: https://github.com/openslide

Building

MacOS

  • brew install openslide
  • Test like:
# fix your path based on the version installed by brew
CGO_CFLAGS="-g -Wall -I/usr/local/Cellar/openslide/3.4.1_8/include/openslide" CGO_LDFLAGS="-L. -lopenslide" go test .
  • Build it like:
# adjust to your version and path etc
CGO_CFLAGS="-g -Wall -I/usr/local/Cellar/openslide/3.4.1_8/include/openslide" CGO_LDFLAGS="-L. -lopenslide" go build openslide.go

Windows

  • Build it like:
# download llvm/gcc from https://github.com/mstorsjo/llvm-mingw/releases
# download openslide from https://openslide.org/download/#windows-binaries
#CGO_ENABLED=1 CC="C:\Users\Ali\Downloads/llvm-mingw-20230919-msvcrt-x86_64/bin/gcc.exe" go build -o openslide-win .
#CGO_ENABLED=1 CC="/c/Users/Ali/Downloads/llvm-mingw-20230919-msvcrt-x86_64/bin/gcc.exe" go build -o openslide-win.dll .

# this works on windowns 10
# download gcc from https://winlibs.com/
# GCC 13.2.0 (with MCF threads) + LLVM/Clang/LLD/LLDB 16.0.6 + MinGW-w64 11.0.1 (UCRT) - release 2
# Win64 version with LLVM/Clang/LLDB etc
PATH=$PATH:$(pwd)/lib  CGO_ENABLED=1  CC="/c/Users/Ali/Downloads/mingw64/bin/gcc.exe"  go test .

License (OpenSlide)

OpenSlide is released under the terms of the GNU Lesser General Public License, version 2.1.

OpenSlide is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

License (This wrapper)

gophenslide is released under MIT license.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NOT_FOUND_ERROR = fmt.Errorf("OpenSlideErr: Not Found")
View Source
var NOT_FOUND_OR_SUPPORTED_ERROR = fmt.Errorf("OpenSlideErr: Format or File Not Supported or Found!")
View Source
var NOT_SUPPORTED_ERROR = fmt.Errorf("OpenSlideErr: Format Not Supported")

Functions

func NewRGBAImageFromRegionInLevel

func NewRGBAImageFromRegionInLevel(osr *C.openslide_t, level int, x, y, width, height int64) (*image.RGBA, error)

Types

type KVPair added in v0.0.6

type KVPair map[string]string

type WSI

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

func OpenWSI added in v0.0.5

func OpenWSI(pathToFile string) (WSI, error)

func (*WSI) Close added in v0.0.6

func (wsi *WSI) Close()

func (*WSI) GetLevelCount added in v0.0.5

func (wsi *WSI) GetLevelCount() int

func (*WSI) GetLevelDimensions added in v0.0.5

func (wsi *WSI) GetLevelDimensions(level int) (int64, int64, error)

func (*WSI) GetLevelDownsample added in v0.0.5

func (wsi *WSI) GetLevelDownsample(level int) float64

func (*WSI) GetPropertyKVPairs added in v0.0.6

func (wsi *WSI) GetPropertyKVPairs() []KVPair

func (*WSI) GetPropertyNames added in v0.0.6

func (wsi *WSI) GetPropertyNames() []string

func (*WSI) GetPropertyValue added in v0.0.6

func (wsi *WSI) GetPropertyValue(name string) string

func (*WSI) ReadRegion added in v0.0.5

func (wsi *WSI) ReadRegion(level int, x int64, y int64, w int64, h int64) ([]byte, error)

Jump to

Keyboard shortcuts

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