File tree Expand file tree Collapse file tree 3 files changed +93141
-0
lines changed Expand file tree Collapse file tree 3 files changed +93141
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ def test_P2PDistance_inputs():
6
6
input_map = dict (ignore_exception = dict (nohash = True ,
7
7
usedefault = True ,
8
8
),
9
+ out_file = dict (usedefault = True ,
10
+ ),
9
11
surface1 = dict (mandatory = True ,
10
12
),
11
13
surface2 = dict (mandatory = True ,
@@ -21,6 +23,7 @@ def test_P2PDistance_inputs():
21
23
22
24
def test_P2PDistance_outputs ():
23
25
output_map = dict (distance = dict (),
26
+ out_file = dict (),
24
27
)
25
28
outputs = P2PDistance .output_spec ()
26
29
Original file line number Diff line number Diff line change
1
+ # coding: utf-8
2
+ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3
+ # vi: set ft=python sts=4 ts=4 sw=4 et:
4
+
5
+ import os
6
+ from shutil import rmtree
7
+ from tempfile import mkdtemp
8
+
9
+ from nipype .testing import (assert_equal , assert_raises ,
10
+ assert_almost_equal , example_data )
11
+
12
+ import numpy as np
13
+ import nibabel as nb
14
+ import nipype .testing as nit
15
+
16
+ from nipype .algorithms import mesh as m
17
+
18
+
19
+ def test_distances ():
20
+ tempdir = mkdtemp ()
21
+ in_surf = example_data ('surf01.vtk' )
22
+
23
+ dist_ident = m .P2PDistance ()
24
+ dist_ident .inputs .surface1 = in_surf
25
+ dist_ident .inputs .surface2 = in_surf
26
+ dist_ident .inputs .out_file = os .path .join (tmpdir , 'distance.npy' )
27
+ res = dist_ident .run ()
28
+ yield assert_equal , res .outputs .distance , 0.0
29
+
30
+ dist_ident .inputs .weighting = 'area'
31
+ res = dist_ident .run ()
32
+ yield assert_equal , res .outputs .distance , 0.0
33
+
34
+ rmtree (tempdir )
You can’t perform that action at this time.
0 commit comments