Beispiel #1
0
    def test_adjust_cor(self):
        images = generate_images()
        m = CORInspectionDialogModel(
            images, 5, ScalarCoR(20),
            ReconstructionParameters('FBP_CUDA', 'ram-lak'), False)
        m.centre_value = 5
        m.step = 1

        m.adjust(ImageType.CURRENT)
        self.assertEqual(m.centre_value, 5)
        self.assertEqual(m.step, 0.5)

        m.adjust(ImageType.LESS)
        self.assertEqual(m.centre_value, 4.5)
        self.assertEqual(m.step, 0.5)

        m.adjust(ImageType.CURRENT)
        self.assertEqual(m.centre_value, 4.5)
        self.assertEqual(m.step, 0.25)

        m.adjust(ImageType.MORE)
        self.assertEqual(m.centre_value, 4.75)
        self.assertEqual(m.step, 0.25)

        m.adjust(ImageType.CURRENT)
        self.assertEqual(m.centre_value, 4.75)
        self.assertEqual(m.step, 0.125)
Beispiel #2
0
    def test_divide_iters_step(self):
        images = generate_images()
        m = CORInspectionDialogModel(
            images, 5, ScalarCoR(20),
            ReconstructionParameters('FBP_CUDA', 'ram-lak'), True)
        m.step = 11

        m._divide_step()
        self.assertEqual(m.step, 5)
Beispiel #3
0
 def test_current_cor(self):
     images = generate_images()
     m = CORInspectionDialogModel(
         images, 5, ScalarCoR(20),
         ReconstructionParameters('FBP_CUDA', 'ram-lak'), False)
     m.centre_value = 5
     m.step = 1
     self.assertEqual(m.cor(ImageType.LESS), 4)
     self.assertEqual(m.cor(ImageType.CURRENT), 5)
     self.assertEqual(m.cor(ImageType.MORE), 6)