Beispiel #1
0
    def test_weingarten_image_curvature_example(self):
        image = ants.image_read(ants.get_ants_data('mni')).resample_image(
            (3, 3, 3))
        imagecurv = ants.weingarten_image_curvature(image)

        image2 = ants.image_read(ants.get_ants_data('r16')).resample_image(
            (2, 2))
        imagecurv2 = ants.weingarten_image_curvature(image2)
Beispiel #2
0
 def test_vol_example(self):
     ch2i = ants.image_read(ants.get_ants_data("mni"))
     ch2seg = ants.threshold_image(ch2i, "Otsu", 3)
     wm = ants.threshold_image(ch2seg, 3, 3)
     kimg = ants.weingarten_image_curvature(ch2i, 1.5).smooth_image(1)
     rp = [(90, 180, 90), (90, 180, 270), (90, 180, 180)]
     filename = mktemp(suffix='.png')
     result = ants.vol(wm, [kimg],
                       quantlimits=(0.01, 0.99),
                       filename=filename)
Beispiel #3
0
 def test_surf_example(self):
     ch2i = ants.image_read(ants.get_ants_data("ch2"))
     ch2seg = ants.threshold_image(ch2i, "Otsu", 3)
     wm = ants.threshold_image(ch2seg, 3, 3)
     wm2 = wm.smooth_image(1).threshold_image(0.5, 1e15)
     kimg = ants.weingarten_image_curvature(ch2i, 1.5).smooth_image(1)
     wmz = wm2.iMath("MD", 3)
     rp = [(90, 180, 90), (90, 180, 270), (90, 180, 180)]
     filename = mktemp(suffix='.png')
     ants.surf(x=wm2,
               y=[kimg],
               z=[wmz],
               inflation_factor=255,
               overlay_limits=(-0.3, 0.3),
               verbose=True,
               rotation_params=rp,
               filename=filename)