Documentation ¶
Index ¶
- Variables
- func AvailableComponentMaps() map[string]map[color.Color]string
- func AvailablePalettes() map[string]color.Palette
- func CheckAllResizeAlgorithms(img goimage.Image, plate *wtype.Plate, rotate bool, ...) []*goimage.NRGBA
- func ColourComponentMap() map[color.Color]string
- func ColourToCMYK(colour color.Color) (cmyk color.CMYK)
- func ColourToGrayscale(colour color.Color) (gray color.Gray)
- func Export(img image.Image, fileName string) (file wtype.File, err error)
- func MakeGreyScalePalette() []color.Color
- func MakePaletteFromImage(img goimage.Image, plate *wtype.Plate, rotate bool) color.Palette
- func MakeSmallPaletteFromImage(img goimage.Image, plate *wtype.Plate, rotate bool) color.Palette
- func MakeSubMapFromMap(colourMap map[color.Color]string, colourNames []string) map[color.Color]string
- func MakeSubPalette(paletteName string, colourNames []string) color.Palette
- func OpenFile(file wtype.File) (*image.NRGBA, error)
- func OpenGIF(file wtype.File) (*gif.GIF, error)
- func ParseGIF(source *gif.GIF, frameNum []int) (imgs []*image.NRGBA, err error)
- func Posterize(img image.Image, levels int) (*image.NRGBA, error)
- func PrintFPImagePreview(img goimage.Image, plate *wtype.Plate, rotate bool, ...)
- func RemoveDuplicatesKeysFromMap(elements map[string]color.Color) map[string]color.Color
- func RemoveDuplicatesValuesFromMap(elements map[string]color.Color) map[string]color.Color
- func ResizeImageToPlate(img goimage.Image, plate *wtype.Plate, algorithm imaging.ResampleFilter, ...) *goimage.NRGBA
- func ResizeImageToPlateAutoRotate(img goimage.Image, plate *wtype.Plate, algorithm imaging.ResampleFilter) *goimage.NRGBA
- func ResizeImageToPlateMin(img goimage.Image, plate *wtype.Plate) *goimage.NRGBA
- func SelectColor(colID string) color.Color
- func SelectLibrary(libID string) (palette color.Palette)
- func ToPlateLayout(img goimage.Image, plate *wtype.Plate, palette *color.Palette, rotate bool, ...) (map[string]color.Color, *goimage.NRGBA)
- func VisibleEquivalentMaps() map[string]map[color.Color]string
- type AnthaColor
- type AnthaImg
- type AnthaPalette
- type AnthaPix
- type LivingColor
- type LivingGIF
- type LivingImg
- type LivingPalette
- type LivingPix
Constants ¶
This section is empty.
Variables ¶
var ( // White is a color.RGBA representation of the colour white White = color.RGBA{R: uint8(242), G: uint8(243), B: uint8(242), A: uint8(255)} // Black is a color.RGBA representation of the colour black Black = color.RGBA{R: uint8(0), G: uint8(0), B: uint8(0), A: uint8(255)} // Transparent is a color.RGBA representation of a nil colour. Transparent = color.RGBA{R: uint8(0), G: uint8(0), B: uint8(0), A: uint8(0)} )
var AllResampleFilters = map[string]imaging.ResampleFilter{ "Cosine": imaging.Cosine, "Welch": imaging.Welch, "Blackman": imaging.Blackman, "Hamming": imaging.Hamming, "Hann": imaging.Hann, "Lanczos": imaging.Lanczos, "Bartlett": imaging.Bartlett, "Guassian": imaging.Gaussian, "BSpline": imaging.BSpline, "CatmullRom": imaging.CatmullRom, "MitchellNetravali": imaging.MitchellNetravali, "Hermite": imaging.Hermite, "Linear": imaging.Linear, "Box": imaging.Box, "NearestNeighbour": imaging.NearestNeighbor, }
AllResampleFilters are the resample filters from disintegration package
Functions ¶
func AvailableComponentMaps ¶
AvailableComponentMaps returns available palettes in a map.
func AvailablePalettes ¶
AvailablePalettes returns all the (hardcoded) palettes in the library. The keys are the pallette names.
func CheckAllResizeAlgorithms ¶
func CheckAllResizeAlgorithms(img goimage.Image, plate *wtype.Plate, rotate bool, algorithms map[string]imaging.ResampleFilter) []*goimage.NRGBA
CheckAllResizeAlgorithms resizes an image using a variety of different algorithms.
func ColourComponentMap ¶
ColourComponentMap is a map of RGB colour to description for use as key in crossreferencing colour to component in other maps.
func ColourToCMYK ¶
ColourToCMYK converts a color to color.CYMK
func ColourToGrayscale ¶
ColourToGrayscale converts a color to color.Gray
func Export ¶
Export exports an image to file. The image format is derived from the filename extension.
func MakeGreyScalePalette ¶
MakeGreyScalePalette returns a palette of grey shades
func MakePaletteFromImage ¶
MakePaletteFromImage will make a color Palette from an image resized to fit a given plate type.
func MakeSmallPaletteFromImage ¶
MakeSmallPaletteFromImage will make a color Palette from an image resized to fit a given plate type using Plan9 Palette
func MakeSubMapFromMap ¶
func MakeSubMapFromMap(colourMap map[color.Color]string, colourNames []string) map[color.Color]string
MakeSubMapFromMap extracts colors from a color library Given colour names. Bad name.
func MakeSubPalette ¶
MakeSubPalette extracts colors from a palette given a slice of colour names.
func Posterize ¶
Posterize posterizes an image. This refers to changing an image to use only a small number of different tones.
func PrintFPImagePreview ¶
func PrintFPImagePreview(img goimage.Image, plate *wtype.Plate, rotate bool, visiblemap, uvmap map[color.Color]string)
PrintFPImagePreview takes an image, plate type, and colors from visiblemap/uvmap and (use to) save the resulting processed image.
func RemoveDuplicatesKeysFromMap ¶
RemoveDuplicatesKeysFromMap will loop over a map of colors to find and delete duplicates. Entries with duplicate keys are deleted.
func RemoveDuplicatesValuesFromMap ¶
RemoveDuplicatesValuesFromMap will loop over a map of colors to find and delete duplicates. Entries with duplicate values are deleted.
func ResizeImageToPlate ¶
func ResizeImageToPlate(img goimage.Image, plate *wtype.Plate, algorithm imaging.ResampleFilter, rotate bool) *goimage.NRGBA
ResizeImageToPlate resizes an image to fit the number of wells on a plate. We treat wells as pixels. Bad name.
func ResizeImageToPlateAutoRotate ¶
func ResizeImageToPlateAutoRotate(img goimage.Image, plate *wtype.Plate, algorithm imaging.ResampleFilter) *goimage.NRGBA
ResizeImageToPlateAutoRotate resizes an image to fit the number of wells on a plate and if the image is in portrait the image will be rotated by 270 degrees to optimise resolution on the plate.
func ResizeImageToPlateMin ¶
ResizeImageToPlateMin is a minimalist resize function. Uses Lanczos resampling, which is the best but slowest method.
func SelectColor ¶
SelectColor returns the desired color from a string ID
func SelectLibrary ¶
SelectLibrary will select a hardcoded set of colors and return them as a palette object
func ToPlateLayout ¶
func ToPlateLayout(img goimage.Image, plate *wtype.Plate, palette *color.Palette, rotate bool, autoRotate bool) (map[string]color.Color, *goimage.NRGBA)
ToPlateLayout takes an image, plate type, and palette and returns a map of well position to colors. Creates a map of pixel to plate position from processing a given image with a chosen colour palette. It's recommended to use at least 384 well plate. If autorotate == true, rotate is overridden
Types ¶
type AnthaColor ¶
An AnthaColor represents a color linked to an LHComponent
type AnthaImg ¶
type AnthaImg struct { Plate *wtype.Plate Pix []AnthaPix Palette AnthaPalette }
An AnthaImg represents an image where pixels are linked
func MakeAnthaImg ¶
func MakeAnthaImg(goImg goimage.Image, anthaPalette *AnthaPalette, anthaImgPlate *wtype.Plate) (outputImg *AnthaImg, resizedImg *goimage.NRGBA)
MakeAnthaImg will create an AnthaImage object from a digital image.
type AnthaPalette ¶
type AnthaPalette struct { AnthaColors []AnthaColor Palette color.Palette }
An AnthaPalette is an array of anthaColors
func MakeAnthaPalette ¶
func MakeAnthaPalette(palette color.Palette, components []*wtype.Liquid) *AnthaPalette
MakeAnthaPalette will make a palette of Colors linked to LHcomponents. They are merged according to their order in the slice
func (AnthaPalette) CheckPresence ¶
func (p AnthaPalette) CheckPresence(c AnthaColor) bool
CheckPresence returns a bool indicating if the AnthaColor is already in the AnthaPalette
func (AnthaPalette) Convert ¶
func (p AnthaPalette) Convert(c color.Color) AnthaColor
Convert returns the AnthaPalette AnthaColor closest to c in Euclidean R,G,B space.
type AnthaPix ¶
type AnthaPix struct { Color AnthaColor Location wtype.WellCoords }
An AnthaPix is a pixel linked to an anthaColor, and thereby an LHComponent
type LivingColor ¶
type LivingColor struct { ID string Color color.NRGBA Seq wtype.DNASequence Component *wtype.Liquid }
A LivingColor links a color to physical information such as DNASequence and LHcomponent
func MakeLivingColor ¶
func MakeLivingColor(ctx context.Context, ID string, color *color.NRGBA, seq string) (livingColor *LivingColor)
MakeLivingColor is an object constructor for a LivingColor with default settings
func SelectLivingColor ¶
func SelectLivingColor(ctx context.Context, colID string) LivingColor
SelectLivingColor will return a LivingColor given its ID
type LivingGIF ¶
type LivingGIF struct {
Frames []LivingImg
}
A LivingGIF is a representation of a GIF linked to biological data
func MakeLivingGIF ¶
MakeLivingGIF makes a LivingGIF object given a slice of LivingImg
type LivingImg ¶
type LivingImg struct { Plate wtype.Plate Pix []LivingPix Palette LivingPalette }
A LivingImg is a representation of an image linked to biological data
func MakeLivingImg ¶
func MakeLivingImg(goImg goimage.Image, livingPalette *LivingPalette, livingImgPlate *wtype.Plate) (outputImg *LivingImg, resizedImg goimage.Image)
MakeLivingImg will create a LivingImage object from a digital image.
type LivingPalette ¶
type LivingPalette struct {
LivingColors []LivingColor
}
A LivingPalette holds an array of LivingColors
func MakeLivingPalette ¶
func MakeLivingPalette(palette LivingPalette, components []*wtype.Liquid) *LivingPalette
MakeLivingPalette will make a palette of LivingColors linked to LHcomponents. They are merged according to their order in the slice
func SelectLivingColorLibrary ¶
func SelectLivingColorLibrary(ctx context.Context, libID string) (palette LivingPalette)
SelectLivingColorLibrary will return a the desired set of livingcolors given an ID
func (LivingPalette) CheckPresence ¶
func (p LivingPalette) CheckPresence(c LivingColor) bool
CheckPresence returns a bool indicating if the LivingColor is already in the LivingPalette
func (LivingPalette) Convert ¶
func (p LivingPalette) Convert(c color.Color) LivingColor
Convert returns the LivingPalette LivingColor closest to c in Euclidean R,G,B space.
type LivingPix ¶
type LivingPix struct { Color LivingColor Location wtype.WellCoords }
A LivingPix represents a pixel along with well coordinate