Example #1
0
    def test_reg2(self):
        fixed = self.generate_double_blobs(point1=[256, 256, 8],
                                           point2=[64, 64, 7],
                                           size=[512, 511, 16])

        moving = self.generate_double_blobs(point1=[240, 288, 8],
                                            point2=[48, 96, 7],
                                            size=[512, 511, 16])

        registration(fixed,
                     moving,
                     do_affine3d=True,
                     do_fft_initialization=False,
                     samples_per_parameter=100)
Example #2
0
    def test_reg5_with_mask(self):
        fixed = self.generate_double_blobs(point1=[256, 256, 8],
                                           point2=[64, 64, 7],
                                           size=[512, 511, 16])
        fixed *= sitk.Cast(fixed >= 0.1, sitk.sitkFloat32)

        moving = self.generate_double_blobs(point1=[240, 288, 8],
                                            point2=[48, 96, 7],
                                            size=[512, 511, 16])

        registration(fixed,
                     moving,
                     do_affine3d=True,
                     do_affine2d=False,
                     do_fft_initialization=True,
                     auto_mask=True,
                     samples_per_parameter=500)
Example #3
0
 def test_reg0(self):
     pts = [[256, 256, 8]]
     # all registration options set to False, so no registration is
     # performed, returning the identity transformation.
     tx = registration(sitk.Image([32, 32], sitk.sitkUInt8),
                       sitk.Image([32, 32], sitk.sitkUInt8),
                       do_fft_initialization=False,
                       do_affine2d=False,
                       do_affine3d=False)
     self.check_near(pts[0], tx.TransformPoint(pts[0]))
Example #4
0
    def test_reg1(self):
        fixed_pts = [[256, 256, 8], [64, 64, 7]]
        fixed = self.generate_double_blobs(point1=fixed_pts[0],
                                           point2=fixed_pts[1],
                                           size=[512, 511, 16])

        moving_pts = [[240, 288, 8], [48, 96, 7]]
        moving = self.generate_double_blobs(point1=moving_pts[0],
                                            point2=moving_pts[1],
                                            size=[512, 511, 16])

        tx = registration(fixed,
                          moving,
                          do_affine3d=False,
                          do_fft_initialization=True)

        self.check_near(moving_pts[0], tx.TransformPoint(fixed_pts[0]))
        self.check_near(moving_pts[1], tx.TransformPoint(fixed_pts[1]))