public PictureViewerTestForm() { InitializeComponent(); pi = new Pi2(); //Pi2Image img = pi.Read("../../testing/uint8.png"); //Pi2Image img = pi.Read("../../testing/t1-head_slice64.tif"); //Pi2Image img = pi.Read("../../testing/t1-head"); //pi.Convert(img, ImageDataType.Float32); //pi.Divide(img, 500); //pi.Set(img, 10, 10, 0, float.PositiveInfinity); Pi2Image img = pi.MapRaw("../../testing/input_data/t1-head_256x256x129.raw"); Pi2PictureViewer viewer = new Pi2PictureViewer(); viewer.PiImage = img; viewer.Dock = DockStyle.Fill; Controls.Add(viewer); Pi2PictureToolStrip tools = new Pi2PictureToolStrip(); tools.Dock = DockStyle.Top; Controls.Add(tools); tools.PictureViewer = viewer; viewer.UpdateUI(true); }
private static void MetadataTest() { Pi2 pi = new Pi2(); Pi2Image img = pi.NewImage(ImageDataType.UInt16); pi.SetMeta(img, "Key1", "String value 1"); pi.SetMeta(img, "Key2", "String value 2"); string[] keys = pi.ListMeta(img); foreach (string s in keys) { Console.WriteLine(s); } }
public PictureBoxTestForm() { InitializeComponent(); pi = new Pi2(); Pi2Image img = pi.NewImage(ImageDataType.UInt16); pi.Read(img, "../../testing/uint16.png"); box = new Pi2PictureBox(img, 2, 0, 65535 / 2); box.AutoResize = true; box.Location = new Point(50, 200); Controls.Add(box); hist = new HistogramBox(); hist.Location = new Point(300, 30); hist.PictureBox = box; Controls.Add(hist); box.UpdateImage(); hist.UpdateHistogram(); }