This repository is a base of Eos.
リビジョン | 5c50c3f22f30ec62af4834d4cec0ea6b8ffbeeed (tree) |
---|---|
日時 | 2015-07-03 10:17:59 |
作者 | Takuo Yasunaga <yasunaga@bio....> |
コミッター | Takuo Yasunaga |
faster 3Dto2D
@@ -47,6 +47,7 @@ lmrcImage3Dto2DSingle(mrcImage* out2D, mrcImage* in3D, | ||
47 | 47 | int mode) |
48 | 48 | { |
49 | 49 | int max; |
50 | + int i, j, k; | |
50 | 51 | double sum; |
51 | 52 | mrcImageParaTypeReal gx, gy, gz; |
52 | 53 | mrcImageParaTypeReal g3x, g3y, g3z; |
@@ -64,6 +65,7 @@ lmrcImage3Dto2DSingle(mrcImage* out2D, mrcImage* in3D, | ||
64 | 65 | out2D->HeaderN.x = max; |
65 | 66 | out2D->HeaderN.y = max; |
66 | 67 | out2D->HeaderN.z = 1; |
68 | + out2D->HeaderMode = mrcFloatImage; | |
67 | 69 | mrcInit(out2D, NULL); |
68 | 70 | } |
69 | 71 |
@@ -87,10 +89,16 @@ lmrcImage3Dto2DSingle(mrcImage* out2D, mrcImage* in3D, | ||
87 | 89 | v.data[0] = prjx - gx; |
88 | 90 | v.data[1] = prjy - gy; |
89 | 91 | v.data[2] = prjz - gz; |
90 | - matrix3DMultiplyVector(&v, MatrixAnti); | |
91 | - x = v.data[0] + g3x; | |
92 | - y = v.data[1] + g3y; | |
93 | - z = v.data[2] + g3z; | |
92 | + | |
93 | + x = g3x; | |
94 | + y = g3y; | |
95 | + z = g3z; | |
96 | + //matrix3DMultiplyVector(&v, MatrixAnti); | |
97 | + for(i=0; i<3; i++) { | |
98 | + x += MatrixAnti[i][0]*v.data[i]; | |
99 | + y += MatrixAnti[i][1]*v.data[i]; | |
100 | + z += MatrixAnti[i][2]*v.data[i]; | |
101 | + } | |
94 | 102 | switch(linfo->AreaMode) { |
95 | 103 | lmrc3Dto2DInfoAreaModeGlobular: { |
96 | 104 | if(SQR((x - g3x)/r3x) |
@@ -118,7 +126,8 @@ lmrcImage3Dto2DSingle(mrcImage* out2D, mrcImage* in3D, | ||
118 | 126 | } |
119 | 127 | sum+=data; |
120 | 128 | } |
121 | - mrcPixelDataSet(out2D, prjx, prjy, llinfo->section, sum/max, mrcPixelRePart); | |
129 | + out2D->ImageFloatImage[(int)(prjx+prjy*out2D->HeaderN.x+llinfo->section*out2D->HeaderN.x*out2D->HeaderN.y)] = sum/max; | |
130 | + //mrcPixelDataSet(out2D, prjx, prjy, llinfo->section, sum/max, mrcPixelRePart); | |
122 | 131 | } |
123 | 132 | } |
124 | 133 | } |
@@ -19,5 +19,10 @@ typedef struct eosBayes { | ||
19 | 19 | eosBayesDistribution* likelihood; |
20 | 20 | } eosBayes; |
21 | 21 | |
22 | +extern void eosBayesInit(eosBayes* b, int numDistribution, int numLikelihood, int mode); | |
23 | +extern void eosBayesDistributionInit(eosBayes* b, int mode); | |
24 | +extern void eosBayesDistributionInit0(eosBayesDistribution* d, int mode); | |
25 | +extern void eosBayesEstimation(eosBayesDistribution* d, int mode); | |
26 | +extern void eosBayesWrite(FILE* fpt, eosBayesDistribution* d, int mode); | |
22 | 27 | |
23 | 28 | #endif /* EOS_BAYES_H */ |
@@ -0,0 +1,147 @@ | ||
1 | +.SUFFIXES: | |
2 | + | |
3 | +.IGNORE: | |
4 | + | |
5 | +SHELL=/bin/ksh | |
6 | + | |
7 | +include ${EOS_HOME}/src/Config/${EOS_HOST}.inc | |
8 | + | |
9 | +TCLVERSION=8.4.5 | |
10 | +TKVERSION=8.4.5 | |
11 | +#TCLVERSION=8.5.8 | |
12 | +#TKVERSION=8.5.8 | |
13 | +TKIMGVERSION=1.4 | |
14 | +BLTVERSION=2.4z | |
15 | +#VTKVERSION1=Nighty | |
16 | +#VTKVERSION=5.4.2 | |
17 | +VTKVERSION0=6.2 | |
18 | +VTKVERSION=$(VTKVERSION0).0 | |
19 | +VTKNAME=VTK-$(VTKVERSION) | |
20 | +VTKWHERE=http://www.vtk.org/files/release/$(VTKVERSION0)/$(VTKNAME).tar.gz | |
21 | + | |
22 | +check: TclInit TkInit TkImgInit BLTInit VTKInit | |
23 | + | |
24 | +config: TclConfig TkConfig TkImgInit BLTConfig VTKConfig | |
25 | + | |
26 | +all: Tcl Tk TkImg BLT VTK | |
27 | + | |
28 | +clean: TclClean TkClean TkImgClean BLTClean VTKClean | |
29 | + | |
30 | +TclInit:: | |
31 | + @ln -s ../../src/TclTk/tcl$(TCLVERSION)-src.tar.gz . | |
32 | + @gzip -dc tcl$(TCLVERSION)-src.tar.gz | tar xvf - | |
33 | + | |
34 | +TkInit:: | |
35 | + @ln -s ../../src/TclTk/tk$(TKVERSION)-src.tar.gz . | |
36 | + @gzip -dc tk$(TKVERSION)-src.tar.gz | tar xvf - | |
37 | + | |
38 | +TkImgInit:: | |
39 | + @ln -s ../../src/TclTk/tkimg$(TKIMGVERSION).tar.gz . | |
40 | + @gzip -dc tkimg$(TKIMGVERSION)tar.gz | tar xvf - | |
41 | + | |
42 | +BLTInit:: | |
43 | + @ln -s ../../src/TclTk/BLT$(BLTVERSION).tar.gz . | |
44 | + @gzip -dc BLT$(BLTVERSION).tar.gz | tar xvf - | |
45 | + | |
46 | +VTKInit:: | |
47 | + #@ln -s ../../src/TclTk/vtk-$(VTKVERSION).tar.gz . | |
48 | + #@gzip -dc vtk-$(VTKVERSION).tar.gz | tar xvf - | |
49 | + curl -O $(VTKWHERE) | |
50 | + tar xvzf $(VTKNAME).tar.gz | |
51 | + | |
52 | +TclConfig:: | |
53 | + @cd tcl$(TCLVERSION)/unix ; \ | |
54 | + $(MAKE) clean ; \ | |
55 | + ./configure --prefix=${EOS_HOME}/util/$(OSTYPE) \ | |
56 | + --enable-shared \ | |
57 | + --enable-gcc | |
58 | + | |
59 | +TkConfig:: | |
60 | + @cd tk$(TKVERSION)/unix ; \ | |
61 | + $(MAKE) clean; \ | |
62 | + ./configure --prefix=${EOS_HOME}/util/$(OSTYPE) \ | |
63 | + --with-tcl=../../tcl$(TCLVERSION)/unix \ | |
64 | + --enable-gcc --with-libtiff | |
65 | +TkImgConfig:: | |
66 | + @cd tkimg$(TKIMGVERSION) ; \ $(MAKE) clean; \ | |
67 | + ./configure --prefix=${EOS_HOME}/util/$(OSTYPE) \ | |
68 | + --with-tcl=${EOS_HOME}/util/src$(OSTYPE)/TclTk/tcl$(TCLVERSION)/unix \ | |
69 | + --with-tk=${EOS_HOME}/util/src$(OSTYPE)/TclTk/tk$(TKVERSION)/unix \ | |
70 | + | |
71 | +BLTConfig:: | |
72 | + @cd blt$(BLTVERSION); \ | |
73 | + $(MAKE) clean ; \ | |
74 | + ./configure --prefix=${EOS_HOME}/util/$(OSTYPE) \ | |
75 | + --with-tcl=../tcl$(TCLVERSION)/unix \ | |
76 | + --with-tk=../tk$(TKVERSION)/unix \ | |
77 | + --enable-jpeg=${EOS_HOME}/util/$(OSTYPE) \ | |
78 | + --enable-shared \ | |
79 | + --enable-gcc \ | |
80 | + --with-x --with-gnu-ld | |
81 | + | |
82 | +VTKConfig:: | |
83 | + cd $(VTKNAME); \ | |
84 | + ${EOS_HOME}/util/$(OSTYPE)/bin/ccmake . | |
85 | + #cd vtk$(VTKVERSION); \ | |
86 | + #$(MAKE) clean ; \ #if [ $(OSTYPE) = "SGI" ] ; \ #then \ # echo "Using GL" ; \ # ./configure --prefix=${EOS_HOME}/util/$(OSTYPE) \ # --with-tcl=../tcl$(TCLVERSION)/unix \ # --with-tk=../tk$(TKVERSION)/unix \ # --with-tkwidget \ # --with-x ; \ #else \ | |
87 | + # echo "Using MESA" ; \ | |
88 | + # ./configure --prefix=${EOS_HOME}/util/$(OSTYPE) \ | |
89 | + # --with-tcl \ | |
90 | + # --with-tkwidget \ | |
91 | + # --without-gl \ | |
92 | + # --with-mesa \ | |
93 | + # --without-python \ | |
94 | + # --with-graphics \ | |
95 | + # --with-imaging \ | |
96 | + # --with-patented \ | |
97 | + # --with-x ; \ | |
98 | + # echo "TCL_INCLUDE=-I${EOS_HOME}/util/$(OSTYPE)/include" >> user.make ; \ | |
99 | + # echo "TCL_LIB=${EOS_HOME}/util/$(OSTYPE)/lib/libtcl8.3.a " >> user.make ; \ | |
100 | + # echo "TK_INCLUDE=-I${EOS_HOME}/util/$(OSTYPE)/include" >> user.make ; \ | |
101 | + # echo "TK_LIB=${EOS_HOME}/util/$(OSTYPE)/lib/libtk8.3.a " >> user.make ; \ | |
102 | + # echo "MESA_INCLUDE=-I${EOS_HOME}/util/$(OSTYPE)/include" >> user.make ; \ | |
103 | + # echo "MESA_LIB=${EOS_HOME}/util/$(OSTYPE)/lib/libMesaGL.a " >> user.make ; \ | |
104 | + #fi | |
105 | + | |
106 | +Tcl:: | |
107 | + @cd tcl$(TCLVERSION)/unix ; \ | |
108 | + $(MAKE) install | |
109 | + | |
110 | +Tk:: | |
111 | + @cd tk$(TKVERSION)/unix ; \ | |
112 | + $(MAKE) install | |
113 | + | |
114 | +TkImg:: | |
115 | + @cd tkimg$(TKIMGVERSION)/; \ | |
116 | + $(MAKE) install | |
117 | + | |
118 | + | |
119 | +BLT:: | |
120 | + @cd blt$(BLTVERSION); \ | |
121 | + $(MAKE) install ; \ | |
122 | + # $(MAKE) INSTALL=${EOS_HOME}/sbin/eosinstall install | |
123 | + | |
124 | +VTK:: | |
125 | + cd VTK ; \ | |
126 | + $(MAKE) ; \ | |
127 | + $(MAKE) install | |
128 | + | |
129 | + | |
130 | +TclClean:: | |
131 | + @cd tcl$(TCLVERSION)/unix ; \ | |
132 | + $(MAKE) distclean | |
133 | + | |
134 | +TkClean:: | |
135 | + @cd tk$(TKVERSION)/unix ; \ | |
136 | + $(MAKE) distclean | |
137 | + | |
138 | + | |
139 | +BLTClean:: | |
140 | + @cd blt$(BLTVERSION); \ | |
141 | + $(MAKE) distclean | |
142 | + | |
143 | +VTKClean:: | |
144 | + cd vtk$(VTKVERSION) ; \ | |
145 | + $(MAKE) distclean | |
146 | + | |
147 | + |