comparison UnitTestsSources/ImageProcessingTests.cpp @ 3651:46cb00e4adbb

DicomMap::DumpMainDicomTags() and DicomMap::ParseMainDicomTags()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Feb 2020 13:22:02 +0100
parents 94f4a18a79cc
children 5f64c866108a
comparison
equal deleted inserted replaced
3650:e5811a9f8df0 3651:46cb00e4adbb
894 } 894 }
895 895
896 TEST(ImageProcessing, ApplyWindowingGrayScale8ToGrayScale16) 896 TEST(ImageProcessing, ApplyWindowingGrayScale8ToGrayScale16)
897 { 897 {
898 { 898 {
899 Image image(PixelFormat_Grayscale8, 6, 1, false); 899 Image image(PixelFormat_Grayscale8, 5, 1, false);
900 SetGrayscale8Pixel(image, 0, 0, 0); 900 SetGrayscale8Pixel(image, 0, 0, 0);
901 SetGrayscale8Pixel(image, 1, 0, 2); 901 SetGrayscale8Pixel(image, 1, 0, 2);
902 SetGrayscale8Pixel(image, 2, 0, 5); 902 SetGrayscale8Pixel(image, 2, 0, 5);
903 SetGrayscale8Pixel(image, 3, 0, 10); 903 SetGrayscale8Pixel(image, 3, 0, 10);
904 SetGrayscale8Pixel(image, 4, 0, 255); 904 SetGrayscale8Pixel(image, 4, 0, 255);
905 905
906 { 906 {
907 Image target(PixelFormat_Grayscale16, 6, 1, false); 907 Image target(PixelFormat_Grayscale16, 5, 1, false);
908 ImageProcessing::ApplyWindowing(target, image, 5.0f, 10.0f, 1.0f, 0.0f, false); 908 ImageProcessing::ApplyWindowing(target, image, 5.0f, 10.0f, 1.0f, 0.0f, false);
909 909
910 ASSERT_TRUE(TestGrayscale16Pixel(target, 0, 0, 0)); 910 ASSERT_TRUE(TestGrayscale16Pixel(target, 0, 0, 0));
911 ASSERT_TRUE(TestGrayscale16Pixel(target, 1, 0, 65536*2/10)); 911 ASSERT_TRUE(TestGrayscale16Pixel(target, 1, 0, 65536*2/10));
912 ASSERT_TRUE(TestGrayscale16Pixel(target, 2, 0, 65536*5/10)); 912 ASSERT_TRUE(TestGrayscale16Pixel(target, 2, 0, 65536*5/10));
917 } 917 }
918 918
919 TEST(ImageProcessing, ApplyWindowingGrayScale16ToGrayScale16) 919 TEST(ImageProcessing, ApplyWindowingGrayScale16ToGrayScale16)
920 { 920 {
921 { 921 {
922 Image image(PixelFormat_Grayscale16, 6, 1, false); 922 Image image(PixelFormat_Grayscale16, 5, 1, false);
923 SetGrayscale16Pixel(image, 0, 0, 0); 923 SetGrayscale16Pixel(image, 0, 0, 0);
924 SetGrayscale16Pixel(image, 1, 0, 2); 924 SetGrayscale16Pixel(image, 1, 0, 2);
925 SetGrayscale16Pixel(image, 2, 0, 5); 925 SetGrayscale16Pixel(image, 2, 0, 5);
926 SetGrayscale16Pixel(image, 3, 0, 10); 926 SetGrayscale16Pixel(image, 3, 0, 10);
927 SetGrayscale16Pixel(image, 4, 0, 255); 927 SetGrayscale16Pixel(image, 4, 0, 255);
928 928
929 { 929 {
930 Image target(PixelFormat_Grayscale16, 6, 1, false); 930 Image target(PixelFormat_Grayscale16, 5, 1, false);
931 ImageProcessing::ApplyWindowing(target, image, 5.0f, 10.0f, 1.0f, 0.0f, false); 931 ImageProcessing::ApplyWindowing(target, image, 5.0f, 10.0f, 1.0f, 0.0f, false);
932 932
933 ASSERT_TRUE(TestGrayscale16Pixel(target, 0, 0, 0)); 933 ASSERT_TRUE(TestGrayscale16Pixel(target, 0, 0, 0));
934 ASSERT_TRUE(TestGrayscale16Pixel(target, 1, 0, 65536*2/10)); 934 ASSERT_TRUE(TestGrayscale16Pixel(target, 1, 0, 65536*2/10));
935 ASSERT_TRUE(TestGrayscale16Pixel(target, 2, 0, 65536*5/10)); 935 ASSERT_TRUE(TestGrayscale16Pixel(target, 2, 0, 65536*5/10));