Mercurial > hg > orthanc
comparison UnitTestsSources/FromDcmtk.cpp @ 803:4689e400e0fa
directory to store the results of the unit tests
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 07 May 2014 09:29:11 +0200 |
parents | 82b07ab959f4 |
children | a017d1a89b4f |
comparison
equal
deleted
inserted
replaced
802:82b07ab959f4 | 803:4689e400e0fa |
---|---|
35 //m.SetLevel(DicomRootLevel_Study); | 35 //m.SetLevel(DicomRootLevel_Study); |
36 //m.Replace(DICOM_TAG_PATIENT_ID, "coucou"); | 36 //m.Replace(DICOM_TAG_PATIENT_ID, "coucou"); |
37 //m.Replace(DICOM_TAG_PATIENT_NAME, "coucou"); | 37 //m.Replace(DICOM_TAG_PATIENT_NAME, "coucou"); |
38 | 38 |
39 ParsedDicomFile o; | 39 ParsedDicomFile o; |
40 o.SaveToFile("anon.dcm"); | 40 o.SaveToFile("UnitTestsResults/anon.dcm"); |
41 | 41 |
42 for (int i = 0; i < 10; i++) | 42 for (int i = 0; i < 10; i++) |
43 { | 43 { |
44 char b[1024]; | 44 char b[1024]; |
45 sprintf(b, "anon%06d.dcm", i); | 45 sprintf(b, "UnitTestsResults/anon%06d.dcm", i); |
46 std::auto_ptr<ParsedDicomFile> f(o.Clone()); | 46 std::auto_ptr<ParsedDicomFile> f(o.Clone()); |
47 if (i > 4) | 47 if (i > 4) |
48 o.Replace(DICOM_TAG_SERIES_INSTANCE_UID, "coucou"); | 48 o.Replace(DICOM_TAG_SERIES_INSTANCE_UID, "coucou"); |
49 m.Apply(*f); | 49 m.Apply(*f); |
50 f->SaveToFile(b); | 50 f->SaveToFile(b); |
76 ASSERT_EQ(5, reader.GetWidth()); | 76 ASSERT_EQ(5, reader.GetWidth()); |
77 ASSERT_EQ(PixelFormat_RGBA32, reader.GetFormat()); | 77 ASSERT_EQ(PixelFormat_RGBA32, reader.GetFormat()); |
78 | 78 |
79 ParsedDicomFile o; | 79 ParsedDicomFile o; |
80 o.EmbedImage(s); | 80 o.EmbedImage(s); |
81 o.SaveToFile("png1.dcm"); | 81 o.SaveToFile("UnitTestsResults/png1.dcm"); |
82 | 82 |
83 // Red dot, without alpha channel | 83 // Red dot, without alpha channel |
84 s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gUGDTcIn2+8BgAAACJJREFUCNdj/P//PwMjIwME/P/P+J8BBTAxEOL/R9Lx/z8AynoKAXOeiV8AAAAASUVORK5CYII="; | 84 s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gUGDTcIn2+8BgAAACJJREFUCNdj/P//PwMjIwME/P/P+J8BBTAxEOL/R9Lx/z8AynoKAXOeiV8AAAAASUVORK5CYII="; |
85 o.EmbedImage(s); | 85 o.EmbedImage(s); |
86 o.SaveToFile("png2.dcm"); | 86 o.SaveToFile("UnitTestsResults/png2.dcm"); |
87 | 87 |
88 // Check box in Graylevel8 | 88 // Check box in Graylevel8 |
89 s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gUGDDcB53FulQAAAElJREFUGNNtj0sSAEEEQ1+U+185s1CtmRkblQ9CZldsKHJDk6DLGLJa6chjh0ooQmpjXMM86zPwydGEj6Ed/UGykkEM8X+p3u8/8LcOJIWLGeMAAAAASUVORK5CYII="; | 89 s = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gUGDDcB53FulQAAAElJREFUGNNtj0sSAEEEQ1+U+185s1CtmRkblQ9CZldsKHJDk6DLGLJa6chjh0ooQmpjXMM86zPwydGEj6Ed/UGykkEM8X+p3u8/8LcOJIWLGeMAAAAASUVORK5CYII="; |
90 o.EmbedImage(s); | 90 o.EmbedImage(s); |
91 //o.Replace(DICOM_TAG_SOP_CLASS_UID, UID_DigitalXRayImageStorageForProcessing); | 91 //o.Replace(DICOM_TAG_SOP_CLASS_UID, UID_DigitalXRayImageStorageForProcessing); |
92 o.SaveToFile("png3.dcm"); | 92 o.SaveToFile("UnitTestsResults/png3.dcm"); |
93 | 93 |
94 | 94 |
95 { | 95 { |
96 // Gradient in Graylevel16 | 96 // Gradient in Graylevel16 |
97 | 97 |
109 *p = v; | 109 *p = v; |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 o.EmbedImage(img.GetAccessor()); | 113 o.EmbedImage(img.GetAccessor()); |
114 o.SaveToFile("png4.dcm"); | 114 o.SaveToFile("UnitTestsResults/png4.dcm"); |
115 } | 115 } |
116 } | 116 } |