1 | #pragma rtGlobals=1 // Use modern global access method. |
---|
2 | |
---|
3 | Window Gizmo_VoxelMat() : GizmoPlot |
---|
4 | PauseUpdate; Silent 1 // Building Gizmo 6 window... |
---|
5 | |
---|
6 | // Do nothing if the Gizmo XOP is not available. |
---|
7 | if(exists("NewGizmo")!=4) |
---|
8 | DoAlert 0, "Gizmo XOP must be installed" |
---|
9 | return |
---|
10 | endif |
---|
11 | |
---|
12 | NewGizmo/N=Gizmo_VoxelMat/T="Gizmo_VoxelMat" /W=(1557,254,2015,684) |
---|
13 | ModifyGizmo startRecMacro |
---|
14 | AppendToGizmo voxelgram=root:mat,name=voxelgram0 |
---|
15 | ModifyGizmo ModifyObject=voxelgram0 property={ valueRGBA,0,1,1.5259e-05,0.195544,0.8,0.3} |
---|
16 | ModifyGizmo ModifyObject=voxelgram0 property={ mode,0} |
---|
17 | ModifyGizmo ModifyObject=voxelgram0 property={ pointSize,3} |
---|
18 | AppendToGizmo Axes=boxAxes,name=axes0 |
---|
19 | ModifyGizmo ModifyObject=axes0,property={-1,axisScalingMode,1} |
---|
20 | ModifyGizmo ModifyObject=axes0,property={-1,axisColor,0,0,0,1} |
---|
21 | ModifyGizmo ModifyObject=axes0,property={0,ticks,2} |
---|
22 | ModifyGizmo ModifyObject=axes0,property={1,ticks,2} |
---|
23 | ModifyGizmo ModifyObject=axes0,property={2,ticks,2} |
---|
24 | ModifyGizmo modifyObject=axes0 property={Clipped,0} |
---|
25 | AppendToGizmo light=Directional,name=light0 |
---|
26 | ModifyGizmo light=light0 property={ position,0.000000,0.000000,-1.000000,0.000000} |
---|
27 | ModifyGizmo light=light0 property={ direction,0.000000,0.000000,-1.000000} |
---|
28 | ModifyGizmo light=light0 property={ ambient,0.866667,0.866667,0.866667,1.000000} |
---|
29 | ModifyGizmo light=light0 property={ specular,1.000000,1.000000,1.000000,1.000000} |
---|
30 | AppendToGizmo freeAxesCue={0,0,0,1.5},name=freeAxesCue0 |
---|
31 | AppendToGizmo attribute blendFunc={770,771},name=blendFunc0 |
---|
32 | ModifyGizmo setDisplayList=0, object=freeAxesCue0 |
---|
33 | ModifyGizmo setDisplayList=1, object=light0 |
---|
34 | ModifyGizmo setDisplayList=2, attribute=blendFunc0 |
---|
35 | ModifyGizmo setDisplayList=3, object=voxelgram0 |
---|
36 | ModifyGizmo setDisplayList=4, object=axes0 |
---|
37 | ModifyGizmo SETQUATERNION={0.358770,0.538311,0.643129,0.409744} |
---|
38 | ModifyGizmo autoscaling=1 |
---|
39 | ModifyGizmo currentGroupObject="" |
---|
40 | ModifyGizmo compile |
---|
41 | |
---|
42 | // ModifyGizmo showInfo |
---|
43 | // ModifyGizmo infoWindow={1350,1036,1821,1272} |
---|
44 | // ModifyGizmo bringToFront |
---|
45 | ModifyGizmo endRecMacro |
---|
46 | End |
---|
47 | |
---|
48 | |
---|
49 | // a simple slice viewer ? where did this come from? |
---|
50 | // plots xy slice at z(ii) as an image, and loops through the z-slices |
---|
51 | // cmd-. to stop at any slice, sleepTime slows the rate. |
---|
52 | // a new image is created every time |
---|
53 | // |
---|
54 | Proc AnimatedSlices(matStr) |
---|
55 | String matStr="mat" |
---|
56 | |
---|
57 | variable ii=0,num,sleepTime=0.3 |
---|
58 | num=DimSize(mat,2) |
---|
59 | //Print "num = ",num |
---|
60 | Display /W=(5,44,313,319) |
---|
61 | AppendImage $matStr |
---|
62 | ModifyImage $matStr ctab= {*,*,YellowHot,1} |
---|
63 | ModifyImage $matStr plane= 0 |
---|
64 | ModifyGraph width={Aspect,1},height={Aspect,1} |
---|
65 | ModifyGraph mirror=2 |
---|
66 | TextBox/N=text0/A=MC/X=43.30/Y=-44.20 "" |
---|
67 | |
---|
68 | do |
---|
69 | modifyimage $matStr plane=(ii) |
---|
70 | TextBox/C/N=text0 num2str(ii+1)+"/"+num2str(num) |
---|
71 | DoUpdate |
---|
72 | Sleep/S sleepTime |
---|
73 | ii+=1 |
---|
74 | while(ii<num) |
---|
75 | End |
---|
76 | |
---|
77 | |
---|
78 | Proc ShowFullMatrix() |
---|
79 | |
---|
80 | //get the maximum dimensions - assumes input matrix "mat" |
---|
81 | Variable xm,ym,zm |
---|
82 | xm=DimSize(mat,0) |
---|
83 | ym=DimSize(mat,1) |
---|
84 | zm=DimSize(mat,2) |
---|
85 | |
---|
86 | ModifySurfer xmin=0,ymin=0,zmin=0 |
---|
87 | ModifySurfer xmax=xm,ymax=ym,zmax=zm |
---|
88 | |
---|
89 | End |
---|
90 | |
---|
91 | //plots each point in 3D space, does NOT autoscale to the input data |
---|
92 | // |
---|
93 | Proc PlotXYZ(xStr,yStr,zStr) |
---|
94 | String xStr="x3d",yStr="y3d",zStr="z3d" |
---|
95 | |
---|
96 | //get the maximum dimensions - assumes input matrix "mat" |
---|
97 | Variable xm,ym,zm |
---|
98 | xm=DimSize(mat,0) |
---|
99 | ym=DimSize(mat,1) |
---|
100 | zm=DimSize(mat,2) |
---|
101 | |
---|
102 | CreateSurfer |
---|
103 | MoveWindow 4,44,517,382 |
---|
104 | ModifySurfer FactoryDefaults, Update=0 |
---|
105 | ModifySurfer/N=Surface0 |
---|
106 | ModifySurfer srcWave=($xStr,$yStr,$zStr) |
---|
107 | ModifySurfer srcType=4,plotType=5 |
---|
108 | ModifySurfer setControlView=3 |
---|
109 | ModifySurfer zScale=1, xStep=1, yStep=1 |
---|
110 | ModifySurfer frame=895, drawFrame=1 |
---|
111 | ModifySurfer xmin=0,ymin=0,zmin=0 |
---|
112 | ModifySurfer xmax=xm,ymax=ym,zmax=zm |
---|
113 | ModifySurfer drawBox=1 |
---|
114 | ModifySurfer drawTicks=5 |
---|
115 | ModifySurfer backRGB={65535,65535,65535} |
---|
116 | ModifySurfer palette=Grays |
---|
117 | ModifySurfer markerRGB={65535,0,0} |
---|
118 | ModifySurfer grids=1 |
---|
119 | ModifySurfer marker=19, markerSize=2 |
---|
120 | ModifySurfer scatterDepthCue=1 |
---|
121 | // ModifySurfer autoscale=1 |
---|
122 | ModifySurfer Update=1 |
---|
123 | |
---|
124 | End |
---|
125 | |
---|