BioGTK 6.8.0
dotnet add package BioGTK --version 6.8.0
NuGet\Install-Package BioGTK -Version 6.8.0
<PackageReference Include="BioGTK" Version="6.8.0" />
<PackageVersion Include="BioGTK" Version="6.8.0" />
<PackageReference Include="BioGTK" />
paket add BioGTK --version 6.8.0
#r "nuget: BioGTK, 6.8.0"
#:package BioGTK@6.8.0
#addin nuget:?package=BioGTK&version=6.8.0
#tool nuget:?package=BioGTK&version=6.8.0
BioGTK
A .NET application & library for editing & annotating various microscopy image formats. Supports all bioformats supported images. Integrates with ImageJ, running ImageJ filters & macro functions. Check out the wiki for library usage. or check out the documentation. Supports Windows, Linux and Mac. For Windows & Mac see installation instructions.
Features
C# scripting with sample tool-script and other sample scripts in "/Scripts/" folder. See samples.
Supports running ImageJ macro commands on images open in Bio. Console to run ImageJ macro commands and Bio C# scripts.
Supports viewing & creating pyramidal images with multiple resolutions. Like whole slide images.
Stitch images at varying resolutions into single pyramidal image with multiple resolutions.
Multiple view modes like Emission, and Filtered. ROI's shown for each channel can be configured in ROI Manager.
Supports drawing shapes & colors onto 16 bit & 48 bit images, unlike System.Drawing.Graphics.
Convenient viewing of image stacks with scroll wheel moving Z-plane and mouse side buttons scrolling C-planes.
Editing & saving ROI's in images to OME format image stacks.
Copy & Paste to quickly annotate images and name them easily by right click.
Select multiple points by holding down control key, and move them by holding down control key.
Exporting ROI's from each OME image in a folder of images to CSV.
Interactive and automatic segmentation with Segment Anything 2 or Micro-SAM2 for microscopy. See model setup for the ONNX files.
Dependencies
- BioFormats.NET8 GPL3
- IKVM License
- AForge LGPL
- LibTiff.Net BSD
- Cs-script MIT
- ImageJ (Only needed when running ImageJ macro commands)
- ScottPlot MIT
- LibVips (Optional) LGPL
- Segment-Anything-CSharp (Optional) Apache License 2.0
- ONNX-SAM2-Segment-Anything (Optional) MIT
- OpenSlideGTK (Optional) MIT
Scripting
- Save scripts into "StartupPath/Scripts" with ".cs" ending.
- Open script editor and recorder from menu.
- Scripts saved in Scripts folder will be loaded into script runner.
- Use Script recorder to record program function calls and script runner to turn recorder text into working scripts. (See sample scripts
Plugins
- Save plugin DLL's into "StartupPath/Plugins"
- Add plugins from Github repositories by clicking Update and add the url of the repository which you want to add.
- See example plugin to create your own plugins.
- Add the BioGTK plugin repository "https://github.com/BiologyTools/BioGTK-Plugins" to your updater list.
Models
- Save models into "StartupPath/Models" supports BioImage.IO models.
- Supports ONNX (".onnx") and PyTorch models (".pt"). For PyTorch models include the ".yaml" metadata file with the same name as the model file in the models folder.
.NET Runtime Install
The macOS DMG includes the .NET 10 runtime. For installations that use a system runtime, install .NET 10 from Microsoft's download page. .NET 10 downloads
macOS Installation
The DMG includes .NET 10, GTK 3, and the application's packaged runtime dependencies.
- Download the DMG for your Mac from the release assets. Choose
BioGTK-macos-arm64.dmgfor Apple Silicon (M-series) orBioGTK-macos-x64.dmgfor Intel. BioGTK releases - Open the DMG and drag BioGTK.app onto the Applications shortcut.
- Eject the DMG, then open BioGTK from your Applications folder.
- To allow the program to be run: Run the following in terminal '''xattr -dr com.apple.quarantine /Applications/BioGTK.app''' If MacOS blocks the first launch because the developer cannot be verified, open System Settings > Privacy & Security, select Open Anyway for BioGTK, and confirm Open. Apple's first-launch instructions
Scripts, functions, tools, plugins, and models are stored under ~/Library/Application Support/BioGTK. For SAM2 and Micro-SAM2 segmentation, follow the model setup instructions. ONNX Runtime and TorchSharp model execution in the current macOS packages is available on Apple Silicon. Segmentation model setup
DMGs built by GitHub Actions are also available in the Artifacts section of a successful Build macOS DMG run. DMG workflow
Workflows that launch the external Fiji application use a separately installed Fiji.
Windows Installation
- Download BioGTK-win-x64-Setup.exe from the release assets. BioGTK releases
- Run the installer, then open BioGTK from the Start menu. Setup installs GTK 3 and the .NET runtime for your Windows account.
- If you use an external Fiji or ImageJ installation, open File → Choose Fiji or ImageJ Executable… in the BioGTK NodeView window and select its executable.
For a portable copy, download BioGTK-win-x64.zip from the same release, select Extract All, and open Start BioGTK.cmd in the extracted folder. Keep the folders together. The ZIP includes the same .NET and GTK runtimes as the installer.
To remove BioGTK, open Settings → Apps → Installed apps, select BioGTK, and choose Uninstall.
- Optionally install OpenSlide for better navigation of whole-slide-images. Be sure to set the PATH variable correctly.
- Optionally install CUDA for hardware accelerated stitching as well as tile cache in graphics card memory instead of RAM.
- Optionally install PyTorch for running BioImage.io models.
Linux Installation
- See this video or follow the instructions below.
- Download the latest tarball(tar.gz) from Releases as linux already includes GTK3 package.
- Optionally install LibVips for increased performance and functions with whole-slide-images.
- Optionally install OpenSlide for better navigation of whole-slide-images. By running each line below as sudo.
sudo apt install software-properties-commonsudo add-apt-repository ppa:openslide/openslidesudo apt install openslide-tools - Optionally install CUDA for hardware accelerated stitching as well as tile cache in graphics card memory instead of RAM.
- Optionally install PyTorch for running BioImage.io models.
Examples
First you need to setup your project as a GTK project with .NET 8.0 as the target. Then in between Gtk.Application.Init() and Gtk.Application.Run() use the library as you please. Here is an example for opening a new NodeView from BioGTKApp program.cs.
Console.WriteLine("Initializing GTK.");
Gtk.Application.Init();
Console.WriteLine("Creating NodeView.");
BioGTK.NodeView node = BioGTK.NodeView.Create(args);
node.Show();
Gtk.Application.Run();
Another example on how to open an image with a new ImageView
Gtk.Application.Init();
//Since we will be using the GUI we call App.Initialize();
App.Initialize();
BioImage bm = BioImage.OpenFile("F:\\TESTIMAGES\\CZI\\16Bit-ZStack.czi");
ImageView v = ImageView.Create(bm);
v.Show();
Gtk.Application.Run();
Usage
//If you want to initialize the application call app initialize.
//This will initialize Bioformats library as well as the rest of the application.
App.Initialize();
//Or you can create a new NodeView which will initialize the application
//as well as parse any command line arguments.
NodeView nodes = NodeView.Create(new string[]{"file"});
//You can also call BioImage.Initialize to
//initialize just the Bioformats library.
BioImage.Initialize();
//Once initialized you can open OME, ImageJ tiff files, and Bio Tiff files with:
BioImage b = BioImage.OpenFile("file");
//Or if you want to use specifically the OME image reader you can use BioImage.OpenOME
BioImage b = BioImage.OpenOME("file");
//If you are working with a pyramidal image you can open a portion of a tiled image with OpenOME.
//BioImage.OpenOME(string file, int serie, bool tab, bool addToImages, bool tile, int tilex, int tiley, int tileSizeX, int tileSizeY)
//You can specify whether to open in a newtab as well as whether to add the image to
//the Images.images table. As well as specify whether to open as a tile with the specified
//tile X,Y position & tile width & height.
BioImage.OpenOME("file",0,false,false,true,0,0,600,600);
//This will open a portion of the image as a tile and won't add it to the Images table.
//Once you have opened a tiled image with BioImage.OpenOME you can call the
//GetTile(BioImage b, ZCT coord, int serie, int tilex, int tiley, int tileSizeX, int tileSizeY) method
// to quickly get another tile from different portion of the image. For BioGTK & BioLib
Bitmap bm = GetTile(b, new ZCT(0,0,0), 0, 100, 100, 600, 600);
//You can display an image with the ImageView control which can display
// Pyramidal, Whole-Slide, and Series of images.
ImageView v = ImageView.Create(b);
//To get the current coordinate of the ImageView you can call GetCoordinate.
ZCT cord = v.GetCoordinate();
//or to set the current coordinate
v.SetCoordinate(new ZCT(1,1,1));
//To create a point as well as any other ROI type you can call the ROI create methods.
ROI p = ROI.CreatePoint(cord, 0, 0);
ROI rect = ROI.CreateRectangle(cord, 0, 0, 100, 100);
//Usage of Graphics class for 16 & 48 bit images as well as regular bit depth images
//is very similar to System.Graphics.
//We create a new Graphics object by passing the Bitmap for BioGTK & BioLib and BufferInfo for BioCore
Graphics g = Graphics.FromImage(b.Buffers[0]);
//Then we create a pen by passing a ColorS which represent a Color with,
//a higher bit depth (unsigned short) rather than a byte.
g.pen = new Pen(new ColorS(ushort.MaxValue, ushort.MaxValue, ushort.MaxValue));
//Then we can call the familiar methods DrawLine, DrawPolygon, FillPolygon etc.
g.DrawLine(0,0,100,100);
//Finally we dispose the Graphics object.
g.Dispose();
//Then to update the image in the viewer once we have made changes to the image we call:
v.UpdateImage();
//This will update the images of the viewer in the current coordinate plane.
v.UpdateView();
//We can also save the resulting image given the ID of the image in the Images table.
//All images opened with BioImage.OpenFile or BioImage.OpenOME are added to the
//Images.images table with the filename as an ID.
BioImage.SaveFile("file","path");
//To convert between different pixel formats we can call for example To24Bit.
b.To24Bit();
Sample Plugin
using AForge;
using BioGTK;
using Gdk;
using Gtk;
using SkiaSharp.Views.Desktop;
namespace PluginExample
{
public class PluginExample : BioGTK.Plugin.IPlugin
{
public string Name => "PluginExample";
public string MenuPath => "Tools/" + Name + ".dll";
public bool ContextMenu => false;
public void Execute(string[] args)
{
}
public void KeyUpEvent(object o, KeyPressEventArgs e)
{
}
public void KeyDownEvent(object o, KeyPressEventArgs e)
{
}
public void ScrollEvent(object o, ScrollEventArgs args)
{
}
public void Render(object sender, SKPaintSurfaceEventArgs e)
{
}
public void MouseMove(object o, PointD e, MotionNotifyEventArgs buts)
{
}
public void MouseUp(object o, PointD e, ButtonReleaseEventArgs buts)
{
}
public void MouseDown(object o, PointD e, ButtonPressEventArgs buts)
{
}
}
}
Sample Tool Script
//css_reference BioGTK.dll;
using System;
using BioGTK;
using System.Threading;
using AForge;
using Gdk;
public class Loader {
//Point ROI Tool Example
public string Load()
{
int ind = 1;
do
{
BioGTK.Scripting.State s = BioGTK.Scripting.GetState();
if (s != null)
{
if (!s.processed)
{
if (s.type == BioGTK.Scripting.Event.Down && s.buts == 1)
{
ZCT cord = BioGTK.App.viewer.GetCoordinate();
BioGTK.Scripting.LogLine(cord.ToString() + " Coordinate");
BioGTK.ROI an = BioGTK.ROI.CreatePoint(cord, s.p.X, s.p.Y);
BioGTK.ImageView.SelectedImage.Annotations.Add(an);
BioGTK.Scripting.LogLine(cord.ToString() + " Coordinate");
an.Text = "Point" + ind;
ind++;
BioGTK.Scripting.LogLine(s.ToString() + " Point");
}
else
if (s.type == BioGTK.Scripting.Event.Up)
{
BioGTK.Scripting.LogLine(s.ToString());
}
else
if (s.type == BioGTK.Scripting.Event.Move)
{
BioGTK.Scripting.LogLine(s.ToString());
}
if(s.key == Key.r)
{
BioGTK.Scripting.LogLine("KeyDown");
}
s.processed = true;
}
}
if(BioGTK.Scripting.Exit("test.cs"))
{
return "OK";
}
} while (true);
return "OK";
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- BioFormats.NET6 (>= 9.0.0-rc2)
- BioLib (>= 4.3.3)
- Flurl (>= 4.0.0)
- Flurl.Http (>= 4.0.2)
- ManagedCuda.NETStandard (>= 9.1.300)
- MathNet.Numerics (>= 5.0.0)
- Microsoft.ML.OnnxRuntime (>= 1.32.0)
- Microsoft.ML.TorchSharp (>= 0.24.0)
- Newtonsoft.Json (>= 13.0.4)
- OpenTK (>= 4.9.4)
- OpenTK.Graphics (>= 4.9.4)
- OpenTK.Windowing.Common (>= 4.9.4)
- OpenTK.Windowing.Desktop (>= 4.9.4)
- ScottPlot (>= 5.1.59)
- SkiaSharp (>= 4.157.0)
- SkiaSharp.NativeAssets.Linux (>= 4.157.0)
- SkiaSharp.NativeAssets.macOS (>= 4.157.0)
- SkiaSharp.NativeAssets.Win32 (>= 4.157.0)
- SkiaSharp.Views.Gtk3 (>= 4.157.0)
- TorchSharp-cpu (>= 0.107.0)
- YamlDotNet (>= 18.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.8.0 | 0 | 11/25/2026 |
| 6.7.0 | 133 | 11/4/2026 |
| 6.6.0 | 208 | 5/19/2026 |
| 6.5.2 | 198 | 2/12/2026 |
| 6.5.1 | 159 | 2/10/2026 |
| 6.5.0 | 157 | 2/8/2026 |
| 6.4.0 | 160 | 2/2/2026 |
| 6.3.0 | 339 | 6/23/2025 |
| 6.2.0 | 274 | 1/20/2025 |
| 6.1.1 | 239 | 1/8/2025 |
| 6.1.0 | 258 | 1/6/2025 |
| 6.0.0 | 255 | 12/17/2024 |
| 5.9.0 | 230 | 12/10/2024 |
| 5.8.2 | 213 | 12/3/2024 |
| 5.8.1 | 193 | 12/2/2024 |
| 5.8.0 | 226 | 11/26/2024 |
| 5.7.1 | 201 | 11/18/2024 |
| 5.7.0 | 176 | 11/17/2024 |
| 5.6.0 | 222 | 10/29/2024 |
| 5.5.0 | 226 | 10/19/2024 |
- Multi-scene OME-Zarr stores now open one ImageView per scene from Open Zarr, Open URL, or the command line. Each view loads its own pyramid levels and label overlays.
- Image Data Resource (IDR) datasets open from s3://idr/ URLs and older EBI links through the current IDR endpoint.
- Image windows can shrink below their initial size. RGB channel selectors adjust to the available width, and long channel names and status text are shortened to fit.
- Files passed on the command line load after the interface opens. If one file fails, BioGTK reports the error and continues with the next file.
- Corrected mask and ROI alignment while panning and zooming on Retina macOS displays.
- Restored the whole-slide overview on Linux, including consistent HiDPI sizing and navigation, and isolated it from annotation or plugin rendering failures.
- Fixed whole-slide image startup on Wayland by avoiding unsupported hidden-window positioning and installing GLFW error handling before OpenGL context creation.
- Reduced recorder and console noise by no longer recording read-only coordinate checks or internal view refreshes.
- Improves MacOS support including Fiji.NET macro commands.