Ejemplo n.º 1
0
    def testImplVRcomma(self):
        """util.fix_separator: Able to replace comma in Implicit VR dataset.."""
        fixer.fix_separator(b",", for_VRs=["DS", "IS"], process_unknown_VRs=False)
        ds = filereader.read_dataset(self.bytesio, is_little_endian=True, is_implicit_VR=True)
        expected = [valuerep.DSfloat(x) for x in ["2", "4", "8", "16"]]
        got = ds.ROIContourSequence[0].ContourSequence[0].ContourData
        config.reset_data_element_callback()

        msg = "Expected {0}, got {1}".format(expected, got)
        self.assertEqual(expected, got, msg)
Ejemplo n.º 2
0
    def testImplVRcomma(self):
        """util.fix_separator:
           Able to replace comma in Implicit VR dataset.."""
        fixer.fix_separator(b",", for_VRs=["DS", "IS"],
                            process_unknown_VRs=False)
        ds = filereader.read_dataset(self.bytesio, is_little_endian=True,
                                     is_implicit_VR=True)
        expected = [valuerep.DSfloat(x) for x in ["2", "4", "8", "16"]]
        got = ds.ROIContourSequence[0].ContourSequence[0].ContourData
        config.reset_data_element_callback()

        assert expected == got
Ejemplo n.º 3
0
    def testImplVRcomma(self):
        """util.fix_separator:
           Able to replace comma in Implicit VR dataset.."""
        fixer.fix_separator(b",", for_VRs=["DS", "IS"],
                            process_unknown_VRs=False)
        ds = filereader.read_dataset(self.bytesio, is_little_endian=True,
                                     is_implicit_VR=True)
        got = ds.ROIContourSequence[0].ContourSequence[0].ContourData
        config.reset_data_element_callback()

        expected = [2., 4., 8., 16.]
        if have_numpy and config.use_DS_numpy:
            assert numpy.allclose(expected, got)
        else:
            assert expected == got
Ejemplo n.º 4
0
 def teardown(self):
     config.reset_data_element_callback()