BioGTK  5.1.1
A .NET library & program for annotating, editing various microscopy imaging formats using Bioformats supported images.
Loading...
Searching...
No Matches
Bio.SlideSliceLayer Class Reference

Slide slice layer. More...

Inheritance diagram for Bio.SlideSliceLayer:

Public Member Functions

 SlideSliceLayer (ISlideSource slideSource)
 
override IEnumerable< IFeature > GetFeatures (MRect box, double resolution)
 

Detailed Description

Slide slice layer.

Constructor & Destructor Documentation

◆ SlideSliceLayer()

Bio.SlideSliceLayer.SlideSliceLayer ( ISlideSource  slideSource)
inline
27 : base()
28 {
29 _slideSource = slideSource;
30 Name = "SliceLayer";
31 Extent = slideSource.Schema.Extent.ToMRect();
32 }

Member Function Documentation

◆ GetFeatures()

override IEnumerable< IFeature > Bio.SlideSliceLayer.GetFeatures ( MRect  box,
double  resolution 
)
inline
35 {
36 if (box is null) return Enumerable.Empty<IFeature>();
37 // Repaint on debouncing, resolution changed(zoom map) or box changed(resize control) .
38 if (_lastExtent.ToMRect().Centroid.Distance(box.Centroid) > 2 * resolution || _lastResolution != resolution || _lastExtent.Width != box.Width || _lastExtent.Height != box.Height)
39 {
40 _lastExtent = box.ToExtent();
41 _lastResolution = resolution;
42 MRect box2 = box.Grow(SymbolStyle.DefaultWidth * 2.0 * resolution, SymbolStyle.DefaultHeight * 2.0 * resolution);
43 var sliceInfo = new SliceInfo() { Extent = box2.ToExtent(), Resolution = resolution };
44 var bytes = _slideSource.GetSlice(sliceInfo);
45 if (bytes != null && _lastFeatures.FirstOrDefault() is IFeature feature)
46 {
47 feature = new RasterFeature(new MRaster(bytes.Result, box2));
48 }
49 }
50 return _lastFeatures;
51 }
Task< byte[]> GetSlice(SliceInfo sliceInfo)
Get slice.

The documentation for this class was generated from the following file: