Example #1
0
        public void BuildTest()
        {
            DataSet dicom = Iod.Build("MG");

            // maybe build an IOD from a set of source tags ???
            // have yet to figure out how this can be tested, here for debugging
        }
Example #2
0
        public void MixOfDependencyTest()
        {
            DataSet dicom = new DataSet();

            dicom.Add(t.SpecificCharacterSet, "ISO_IR 6");
            dicom.Add("(0010,0010)", "Sadler^Michael");
            dicom.Add("(0010,0020)", "123456");
            dicom.Add("(0010,1010)", "49Y");
            dicom.Add("(0010,1020)", "127");
            dicom.Add("(0010,1030)", "260");


            Iod.Xml = @"
                <dicom>
                    <module name='Module'>
                        <element tag='(0010,0010)' vr='PN' vt='1'></element>
                        <element tag='(0010,0020)' vr='LO' vt='1C' dependency='(0008,0005)=ISO_IR 100|ISO_IR 6'></element>
                        <element tag='(0010,1010)' vr='AS' vt='1C' dependency='(0010,0040)=!'></element>
                        <element tag='(0010,1020)' vr='DS' vt='1C' dependency='(0010,1030)=...'></element>
                    </module>
                    <iod name='ME'>
                        <include name='Module'></include>
                    </iod>
                </dicom>
            ";

            Assert.IsTrue(Iod.Verify(dicom.Elements, "ME"), "Expected that this would verify.");
        }
Example #3
0
        public void ImplicitVerifyIodTest()
        {
            DataSet dicom = new DataSet();

            string path = Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\WNGVU1P1.dcm");

            dicom.Read(path);

            Assert.IsTrue(Iod.Verify(dicom.Elements), "Expected that this would verify.");
        }
Example #4
0
        public void VerifyIodTest()
        {
            DataSet dicom = new DataSet();

            string path = Path.Combine(Tools.RootFolder, @"EK\Capture\Dicom\DicomToolKit\Test\Data\DicomDir\WNGVU1P1.dcm");

            dicom.Read(path);

            Elements missing = new Elements();
            bool     success = Iod.Verify(dicom.Elements, "CR", missing);

            Assert.IsTrue(success, "Expected that this would verify.");

            // just check other signature
            success = Iod.Verify(dicom.Elements, "CR");
            Assert.IsTrue(success, "Expected that this would verify.");
        }
Example #5
0
        public bool VerifyIOD()
        {
            bool result = true;

            try
            {
                filename = this.Text = String.Empty;
                result   = Iod.Verify(dicom.Elements);
                SetTitles();
                FillTreeView();
            }
            catch (Exception ex)
            {
                MessageBox.Show(Logging.Log(ex));
            }
            return(result);
        }
Example #6
0
        public void Type1CInRangeNotExistTest()
        {
            DataSet dicom = new DataSet();

            // create a DataSet with a tag value in range
            dicom.Add(t.PatientSize, "128");

            // specify an IOD that requires a tag if a second tag's value falls in a range
            Iod.Xml = @"
                <dicom>
                    <module name='Module'>
                        <element tag='(0010,0010)' vr='PN' vt='1C' dependency='(0010,1020)=6:150'></element>
                    </module>
                    <iod name='ME'>
                        <include name='Module'></include>
                    </iod>
                </dicom>
            ";

            Assert.IsFalse(Iod.Verify(dicom.Elements, "ME"), "Expected that this would not verify because the dependency value is in range and the tag does not exist.");
        }
Example #7
0
        public void Type1DoesNotExistTest()
        {
            DataSet dicom = new DataSet();

            // create a DataSet with one non-null tag
            dicom.Add(t.PatientName, "Sadler^Michael");

            // specify an IOD that requires another tag to be required
            Iod.Xml = @"
                <dicom>
                    <module name='Module'>
                        <element tag='(0008,0005)' vr='CS' vt='1'></element>
                    </module>
                    <iod name='ME'>
                        <include name='Module'></include>
                    </iod>
                </dicom>
            ";

            // verify that they do not match up
            Assert.IsFalse(Iod.Verify(dicom.Elements, "ME"), "Expected that this would not verify because the required tag does not exist.");
        }
Example #8
0
        public void Type1ExistsTest()
        {
            // create a DataSet with a certain single non-null tag
            DataSet dicom = new DataSet();

            dicom.Add(t.SpecificCharacterSet, "ISO_IR 6");

            // specify an IOD that requires a certain tag to be required
            Iod.Xml = @"
                <dicom>
                    <module name='Module'>
                        <element tag='(0008,0005)' vr='CS' vt='1'></element>
                    </module>
                    <iod name='ME'>
                        <include name='Module'></include>
                    </iod>
                </dicom>
            ";

            // verify that they match up
            Assert.IsTrue(Iod.Verify(dicom.Elements, "ME"), "Expected that this would verify because the required tags exists.");
        }
Example #9
0
        public void Type1CInRangeExistsTest()
        {
            DataSet dicom = new DataSet();

            // create a DataSet with a first non-null tag and a second tag with a value in range
            dicom.Add(t.PatientName, "Sadler^Michael");
            dicom.Add(t.PatientSize, "128");

            // specify an IOD that requires a first tag if a second tag's value falls in a range
            Iod.Xml = @"
                <dicom>
                    <module name='Module'>
                        <element tag='(0010,0010)' vr='PN' vt='1C' dependency='(0010,1020)=6:150'></element>
                    </module>
                    <iod name='ME'>
                        <include name='Module'></include>
                    </iod>
                </dicom>
            ";

            // verify that they match up
            Assert.IsTrue(Iod.Verify(dicom.Elements, "ME"), "Expected that this would verify because the dependency value is in range and the tag exists.");
        }