コード例 #1
0
        public void HasValidHeader_False()
        {
            var filename = Path.GetTempFileName();

            using (var writer = new StreamWriter(filename))
            {
                writer.WriteLine("Hello World!");
            }

            var dicomToolkit = new DicomToolkit();

            Assert.False(dicomToolkit.HasValidHeader(filename));
        }
コード例 #2
0
        public void HasValidHeader_True()
        {
            var filename  = Path.GetTempFileName();
            var dicomFile = new DicomFile();

            dicomFile.Dataset.Add(DicomTag.SOPInstanceUID, DicomUIDGenerator.GenerateDerivedFromUUID());
            dicomFile.FileMetaInfo.TransferSyntax             = DicomTransferSyntax.ExplicitVRLittleEndian;
            dicomFile.FileMetaInfo.MediaStorageSOPInstanceUID = DicomUIDGenerator.GenerateDerivedFromUUID();
            dicomFile.FileMetaInfo.MediaStorageSOPClassUID    = DicomUIDGenerator.GenerateDerivedFromUUID();

            dicomFile.Save(filename);

            var dicomToolkit = new DicomToolkit();

            Assert.True(dicomToolkit.HasValidHeader(filename));
        }