source: sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_VoxelDisplay.ipf @ 941

Last change on this file since 941 was 941, checked in by srkline, 9 years ago

Moved rescaling panel from Wrapper.ipf to PlotUtils?.ipf, a more natural location.

Added "Manual Optimization" utility to the SANS Models/1D operations menu. this is a simple panel that allows users to "optimize" the fit in 1 or 2 directions. Very instructive to see whether you're near a minimum, and what the chi2 surface looks like around the minimum.

Did a similar Manual Optimization for the Real-space MultiClyinder? calculations from Ken Rubinson. simpler interface here.

All of the "CGB" fixes are present here, including the calculation of the number of guides.

File size: 5.3 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2
3Window 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,10,1.5259e-05,0.195544,0.8,0.15}
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
46End
47
48
49Function ColorizeGizmo()
50
51        Wave mat = root:mat
52       
53        String listStr,str
54        listStr = ListOfValues(mat)             //returns a ";" delimited list of the different SLD values
55        //remove the solvent
56        NVAR val = root:FFT_SolventSLD
57        listStr = RemoveFromList(num2istr(val), listStr ,";")
58       
59        print listStr
60       
61        Variable numDiffSLD = ItemsInList(listStr ,";")
62        if(numdiffSLD > 5)
63                numDiffSLD = 5
64                DoAlert 0,"Only 5 different colors can be displayed. Some SLDs will not be displayed."
65        endif
66
67        Variable ii,ind
68//// now loop through and colorize the different parts
69        Make/O/D/N=5 rr_vox,gg_vox,bb_vox,aa_vox
70        rr_vox = {0,1,4.57771e-05,0.8,0}
71        gg_vox = {0.244434,0,0.6,0.799954,0}
72        bb_vox = {1,0,0,0,0}
73        aa_vox = 0.15                           //alpha = transparency
74       
75        for(ii=0;ii<numDiffSLD;ii+=1)
76                ind = ii
77//      for(ii=0;ii<numDiffSLD;ii+=1)
78//              ind = mod(ii,5)         //loop through the 5 colors
79                str = "ModifyGizmo/N=Gizmo_VoxelMat ModifyObject=voxelgram0 property={ valueRGBA,"
80                str += num2istr(ind)+","
81                str += StringFromList(ind, listStr ,";")   +","
82                str += num2str(rr_vox[ind])+","
83                str += num2str(gg_vox[ind])+","
84                str += num2str(bb_vox[ind])+","
85                str += num2str(aa_vox[ind])+"}"
86                       
87//              ModifyGizmo/N=Gizmo_VoxelMat ModifyObject=voxelgram0 property={ valueRGBA,ii,SLD_id[ii],rr[ii],gg[ii],bb[ii],aa[ii]}
88//              print str
89                execute str
90        endfor
91       
92        return(0)
93End
94
95// a simple slice viewer ? where did this come from?
96// plots xy slice at z(ii) as an image, and loops through the z-slices
97// cmd-. to stop at any slice, sleepTime slows the rate.
98// a new image is created every time
99//
100Proc AnimatedSlices(matStr)
101        String matStr="mat"
102       
103        variable ii=0,num,sleepTime=0.3
104        num=DimSize(mat,2)
105        //Print "num = ",num
106        Display /W=(5,44,313,319)
107        AppendImage $matStr
108        ModifyImage $matStr ctab= {*,*,YellowHot,1}
109        ModifyImage $matStr plane= 0
110        ModifyGraph width={Aspect,1},height={Aspect,1}
111        ModifyGraph mirror=2
112        TextBox/N=text0/A=MC/X=43.30/Y=-44.20 ""
113       
114        do
115                modifyimage $matStr plane=(ii)
116                TextBox/C/N=text0 num2str(ii+1)+"/"+num2str(num)
117                DoUpdate
118                Sleep/S sleepTime
119                ii+=1
120        while(ii<num)
121End
122
123//// superceded by Gizmo
124//Proc ShowFullMatrix()
125//
126//
127//      CreateSurfer
128//     
129//      //get the maximum dimensions - assumes input matrix "mat"
130//      Variable xm,ym,zm
131//      xm=DimSize(mat,0)
132//      ym=DimSize(mat,1)
133//      zm=DimSize(mat,2)
134//     
135//      ModifySurfer  xmin=0,ymin=0,zmin=0
136//      ModifySurfer  xmax=xm,ymax=ym,zmax=zm
137//
138//End
139
140//// superceded by Gizmo
141////plots each point in 3D space, does NOT autoscale to the input data
142////
143//Proc PlotXYZ(xStr,yStr,zStr)
144//      String xStr="x3d",yStr="y3d",zStr="z3d"
145//     
146//      //get the maximum dimensions - assumes input matrix "mat"
147//      Variable xm,ym,zm
148//      xm=DimSize(mat,0)
149//      ym=DimSize(mat,1)
150//      zm=DimSize(mat,2)
151//     
152//      CreateSurfer
153//      MoveWindow 4,44,517,382
154//      ModifySurfer  FactoryDefaults, Update=0
155//      ModifySurfer/N=Surface0
156//      ModifySurfer srcWave=($xStr,$yStr,$zStr)
157//      ModifySurfer  srcType=4,plotType=5
158//      ModifySurfer  setControlView=3
159//      ModifySurfer  zScale=1,  xStep=1,  yStep=1
160//      ModifySurfer  frame=895,  drawFrame=1
161//      ModifySurfer  xmin=0,ymin=0,zmin=0
162//      ModifySurfer  xmax=xm,ymax=ym,zmax=zm
163//      ModifySurfer  drawBox=1
164//      ModifySurfer  drawTicks=5
165//      ModifySurfer backRGB={65535,65535,65535}
166//      ModifySurfer palette=Grays
167//      ModifySurfer markerRGB={65535,0,0}
168//      ModifySurfer  grids=1
169//      ModifySurfer  marker=19,  markerSize=2
170//      ModifySurfer  scatterDepthCue=1
171////    ModifySurfer  autoscale=1
172//      ModifySurfer  Update=1
173//     
174//End
175
Note: See TracBrowser for help on using the repository browser.