-
Notifications
You must be signed in to change notification settings - Fork 1
Library Usage
Microscopy edited this page Mar 3, 2023
·
2 revisions
//First we initialize the OME library.
BioImage.Initialize();
//For whole slide images.
//The initial opening will take a while for large files due to Bioformats ImageReader setID method.
BioImage slide = BioImage.OpenOME("file", 0, false, true, 0, 0, 800, 800);
//However opening a tile from an already opened file is fast.
BioImage tile = BioImage.OpenOME("file", 0, true, true, 20000, 20000, 800, 800);
//Saving image stack to a file
BioImage.SaveOME("file" + ".ome.tif", tile.ID);
Images.RemoveImage(tile);
tile.Dispose();
//For non whole slide images.
BioImage b = BioImage.OpenFile("file");
ImageView v = new ImageView(b);
ZCT cord = v.GetCoordinate();
ROI r = ROI.CreatePoint(cord, 0, 0);
//Usage of Graphics class for 16 & 48 bit images.
Graphics g = Graphics.FromImage(b.Buffers[0]);
g.pen = new Pen(new ColorS(ushort.MaxValue, ushort.MaxValue, ushort.MaxValue),10,b.bitsPerPixel);
g.DrawLine(0,0,100,100);
g.Dispose();
v.UpdateImage();
v.UpdateView();
//Lets save the result
BioImage.SaveFile("file","path");