예제 #1
0
    def get_images(self) -> tuple:
        """
        Returns a tuple of :class:`~dicom_parser.image.Image` instances
        ordered by instance number.

        Returns
        -------
        tuple
            Image instance by instance number.
        """

        images = [Image(dcm_path) for dcm_path in self.get_dcm_paths()]
        return tuple(
            sorted(images,
                   key=lambda image: image.header.get("InstanceNumber")))
예제 #2
0
 def setUpClass(cls):
     cls.image = Image(TEST_RSFMRI_IMAGE_PATH)
     cls.mosaic = Mosaic(cls.image._data, cls.image.header)
예제 #3
0
 def test_is_mosaic_property(self):
     not_mosaic_image = Image(TEST_IMAGE_PATH)
     self.assertFalse(not_mosaic_image.is_mosaic)
     mosaic_image = Image(TEST_RSFMRI_IMAGE_PATH)
     self.assertTrue(mosaic_image.is_mosaic)
예제 #4
0
 def test_initialization_without_pixel_data_raises_attribute_error(self):
     dataset = pydicom.dcmread(TEST_IMAGE_PATH, stop_before_pixels=True)
     with self.assertWarns(Warning):
         Image(dataset)
예제 #5
0
 def test_initialization_with_filedataset(self):
     dataset = pydicom.dcmread(TEST_IMAGE_PATH)
     image = Image(dataset)
     self.assertIsInstance(image, Image)
     self.assertIsInstance(image.header, Header)
예제 #6
0
 def test_initialization_with_pathlib_path(self):
     image = Image(Path(TEST_IMAGE_PATH))
     self.assertIsInstance(image, Image)
     self.assertIsInstance(image.header, Header)
예제 #7
0
 def setUpClass(cls):
     cls.image = Image(TEST_IMAGE_PATH)
     cls.rsfmri_image = Image(TEST_RSFMRI_IMAGE_PATH)