Is it possible to import WANG annotations from a binary file and burn it to an image using a pose imaging?
Hello, @peterpde ,
Please take a look at this thread on Wang metadata processing.
If I understand your request correctly, you want to load binary WANG annotations and set it to an image. I am aware that .tiff format supports it. Here is a code example that might help you:
const int WangAnnotationsId = 32932;
var wangBytes = File.ReadAllBytes(@"path to WANG annotation binary file");
var inputPath = @"input.tiff";
using (var image = Image.Load(inputPath) as TiffImage)
{
foreach (var page in image.Pages)
{
var tiffPage = page as TiffFrame;
var options = tiffPage.FrameOptions;
options.AddTag(new TiffUndefinedType(WangAnnotationsId)
{
Data = wangBytes,
});
}
image.Save(inputPath + "-with-WANG.tiff");
}