forked from Slicer/SlicerGitSVNArchive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
testVolume.tcl
77 lines (57 loc) · 1.71 KB
/
testVolume.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
catch "sc Delete"
vtkMRMLScene sc
sc SetURL $::SlicerHome/share/MRML/Testing/volScene3.xml
sc Connect
puts "GetNumberOfNodesByClass [sc GetNumberOfNodesByClass vtkMRMLScalarVolumeNode]"
puts "GetNodeClasses [sc GetNodeClasses]"
puts "GetNthNode"
set v0 [sc GetNthNodeByClass 0 vtkMRMLScalarVolumeNode]
puts "Print volume node 0"
puts "[$v0 Print]"
set v1 [sc GetNthNodeByClass 1 vtkMRMLScalarVolumeNode]
puts "Print volume node 1"
puts "[$v1 Print]"
set n [sc GetNthNodeByClass 0 vtkMRMLVolumeArchetypeStorageNode]
puts "Print Storage node 0"
puts "[$n Print]"
set n [sc GetNthNodeByClass 1 vtkMRMLVolumeArchetypeStorageNode]
puts "Print Storage node 1"
puts "[$n Print]"
set n [sc GetNthNodeByClass 0 vtkMRMLVolumeDisplayNode]
puts "Print Display node 0"
puts "[$n Print]"
set n [sc GetNthNodeByClass 0 vtkMRMLLinearTransformNode]
puts "Print Transform node 0"
puts "[$n Print]"
set t0 [$v0 GetParentTransformNode]
puts "Print Transform for volume 0"
puts "[$t0 Print]"
set t1 [$v1 GetParentTransformNode]
puts "Print Transform for volume 1"
puts "[$t1 Print]"
set m0 [$t0 GetMatrixTransformToParent]
puts "Print Matrix for transform node 0"
puts "[$m0 Print]"
set m1 [$t1 GetMatrixTransformToParent]
puts "Print Matrix for transform node 1"
puts "[$m1 Print]"
catch "mm0 Delete"
vtkMatrix4x4 mm0
mm0 Identity
$t0 GetMatrixTransformToWorld mm0
puts "Print GetMatrixTransformToWorld transform node 0"
puts "[mm0 Print]"
catch "mm1 Delete"
vtkMatrix4x4 mm1
mm1 Identity
$t1 GetMatrixTransformToWorld mm1
puts "Print GetMatrixTransformToWorld transform node 1"
puts "[mm1 Print]"
mm0 Identity
$t0 GetMatrixTransformToNode $t1 mm0
puts "Print GetMatrixTransformToNode from 0 to 1"
puts "[mm0 Print]"
mm0 Delete
mm1 Delete
sc Delete
exit 0