public void TestRenderImage() { ImageManager.SetImplementation(new ImageSharpImageManager()); var image = ImageManager.CreateImage(100, 100); image.Render(4, false, false, 0); Assert.IsType <ImageSharpImage>(image); }
public void RenderImage_WPFManager_AsReturnsImageSource() { lock (this.@lock) { ImageManager.SetImplementation(WPFImageManager.Instance); var image = new DicomImage(@".\Test Data\CT-MONO2-16-ankle").RenderImage(); Assert.IsAssignableFrom <ImageSource>(image.As <ImageSource>()); } }
public void RenderImage_WinFormsManager_AsReturnsBitmap() { lock (this.@lock) { ImageManager.SetImplementation(WinFormsImageManager.Instance); var image = new DicomImage(@".\Test Data\CT-MONO2-16-ankle").RenderImage(); Assert.IsAssignableFrom <Bitmap>(image.As <Bitmap>()); } }
public void DicomJpegLosses_DecodingAvailable(string filename) { ImageManager.SetImplementation(RawImageManager.Instance); var file = DicomFile.Open(@".\Test Data\" + filename, FileReadOption.ReadAll); var dcmImage = new DicomImage(file.Dataset); var image = dcmImage.RenderImage(); Assert.NotNull(image); }
public void SetImplementation_WPF_ImageManagerUsesWPFImplementation() { lock (@lock) { ImageManager.SetImplementation(WPFImageManager.Instance); var image = ImageManager.CreateImage(100, 100); image.Render(4, false, false, 0); Assert.IsType <WPFImage>(image); } }
public void RenderImage_ColorPaletteWithOffset(string filename) { lock (_lock) { ImageManager.SetImplementation(WinFormsImageManager.Instance); var file = new DicomImage(@".\Test Data\" + filename); var image = file.RenderImage(0); Assert.IsAssignableFrom <Bitmap>(image.As <Bitmap>()); } }
public void RenderImage_ColorPalette() { lock (_lock) { ImageManager.SetImplementation(WinFormsImageManager.Instance); var file = new DicomImage(@".\Test Data\10200904.dcm"); var image = file.RenderImage(0); Assert.IsAssignableFrom <Bitmap>(image.As <Bitmap>()); } }
public void TestActualRendering() { ImageManager.SetImplementation(new ImageSharpImageManager()); var dcmImage = new DicomImage(@"Test Data\CR-MONO1-10-chest"); var image = dcmImage.RenderImage(); Assert.IsAssignableFrom <Image <Bgra32> >(image.AsSharpImage()); var sharpImage = image.AsSharpImage(); Assert.Equal(dcmImage.Width, sharpImage.Width); Assert.Equal(dcmImage.Height, sharpImage.Height); }
public void ManipulatedImage_MultithreadedAccess_ShouldNotThrow() { lock (_lock) { ImageManager.SetImplementation(WinFormsImageManager.Instance); var image = new DicomImage(@".\Test Data\CT-MONO2-16-ankle"); var exception = Record.Exception(() => { Parallel.For(0, 1000, i => { image.RenderImage().AsBitmap(); image.Scale = 0.999; }); }); Assert.Null(exception); } }