| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,22 +8,20 @@ | |||
| 8 | 8 | from dipy.denoise.enhancement_kernel import EnhancementKernel | |
| 9 | 9 | from dipy.tracking.fbcmeasures import FBCMeasures | |
| 10 | 10 | from dipy.core.sphere import Sphere | |
| 11 | - from dipy.viz import window | ||
| 12 | - from xvfbwrapper import Xvfb | ||
| 11 | + from dipy.viz import window, actor | ||
| 13 | 12 | ||
| 14 | 13 | class TestDipy(unittest.TestCase): | |
| 15 | - def test_renderer(self): | ||
| 16 | - vdisplay = Xvfb() | ||
| 17 | - vdisplay.start() | ||
| 14 | + def test_scene(self): | ||
| 15 | + xyz = 10 * np.random.rand(100, 3) | ||
| 16 | + colors = np.random.rand(100, 4) | ||
| 17 | + radii = np.random.rand(100) + 0.5 | ||
| 18 | 18 | ||
| 19 | - ren = window.Renderer() | ||
| 19 | + sphere_actor = actor.sphere(centers=xyz, colors=colors, radii=radii) | ||
| 20 | 20 | ||
| 21 | - with tempfile.TemporaryDirectory() as dir: | ||
| 22 | - out_file = os.path.join(dir, 'test.png') | ||
| 23 | - window.record(ren, n_frames=1, out_path=out_file, size=(600, 600)) | ||
| 24 | - self.assertTrue(os.path.exists(out_file)) | ||
| 25 | - | ||
| 26 | - vdisplay.stop() | ||
| 21 | + scene = window.Scene() | ||
| 22 | + scene.add(sphere_actor) | ||
| 23 | + | ||
| 24 | + self.assertEqual((0, 0), scene.GetSize()) | ||
| 27 | 25 | ||
| 28 | 26 | def test_graph(self): | |
| 29 | 27 | g = Graph() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments