###### Users may need to modify the below line.
# Set Eos Home Directory
if [ -z "$EOS_HOME0" ] ; then
- export EOS_HOME=$HOME/Eos
- export EOS_MIRROR_SITE=$HOME/EosMirror
- export EOS_GITUSER=$saki_eos
- else
- # For Personal(by install-eos.sh)
- export EOS_HOME=$EOS_HOME0
- export EOS_MIRROR_SITE=$EOS_HOME0/EosMirror
- export EOS_GITUSER=$saki_eos
- fi
- if [ -z "$EOS_HOME" ] ; then
+ export EOS_HOME=$HOME/Eos
+ export EOS_MIRROR_SITE=$HOME/EosMirror
+ else
+ export EOS_HOME=$EOS_HOME
+ export EOS_MIRROR_SITE=$EOS_MIRROR_SITE
+ fi
-else
- # For Personal(by install-eos.sh)
- export EOS_HOME=$EOS_HOME0
- export EOS_MIRROR_SITE=$EOS_HOME0/EosMirror
-fi
#
# Eos
#include "Memory.h"
#include "./lmrcFFTCentralSection.h"
-lmrcImageFFTRhoFilter(mrcImage* volFT, mrcImage* count, int mode)
+ void
- for(Z3d = -volFT->HeaderN.z/2.0; Z3d < volFT->HeaderN.z/2.0; Z3d++) {
- for(Y3d = -volFT->HeaderN.y/2.0; Y3d < volFT->HeaderN.y/2.0; Y3d++) {
- for(X3d = 0; X3d <= volFT->HeaderN.x/2.0; X3d++) {
- mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &re3d, mrcPixelRePart, linfo->InterpMode);
- mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &im3d, mrcPixelImPart, linfo->InterpMode);
- mrcPixelDataGet(count, X3d, Y3d, Z3d, &sum, mrcPixelRePart, linfo->InterpMode);
- if(0<sum) {
- re3d /= sum;
- im3d /= sum;
- } else {
- re3d = 0;
- im3d = 0;
- }
- mrcPixelDataSet(volFT, X3d, Y3d, Z3d, re3d, mrcPixelRePart);
- mrcPixelDataSet(volFT, X3d, Y3d, Z3d, im3d, mrcPixelImPart);
++lmrcImageFFTRhoFilter(mrcImage* volFT, mrcImage* count, lmrcFFTCentralSectionInfo* linfo, int mode)
+ {
+ mrcImageParaTypeReal X3d, Y3d, Z3d;
+ double re3d, im3d, sum;
+
-lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* template3D, mrcImage* in, double probablity, lmrcFFTCentralSectionInfo* linfo, int* c, int mode)
++ for(Z3d = (-volFT->HeaderN.z/2.0)+0.5; Z3d < ( volFT->HeaderN.z/2.0)-0.5; Z3d++) {
++ for(Y3d = (-volFT->HeaderN.y/2.0)+0.5; Y3d < (volFT->HeaderN.y/2.0)-0.5; Y3d++) {
++ for(X3d = 0; X3d < (volFT->HeaderN.x/2.0)-0.5; X3d++) {
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &re3d, mrcPixelRePart, linfo->InterpMode);
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &im3d, mrcPixelImPart, linfo->InterpMode);
++ mrcPixelDataGet(count, X3d, Y3d, Z3d, &sum, mrcPixelRePart, linfo->InterpMode);
++ if(0<sum) {
++ re3d /= sum;
++ im3d /= sum;
++ } else {
++ re3d = 0;
++ im3d = 0;
++ }
++ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, re3d, mrcPixelRePart);
++ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, im3d, mrcPixelImPart);
+ }
+ }
+ }
+ }
+
+ void
- double re3d0, im3d0;
++lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* template3D, mrcImage* in, double probability, lmrcFFTCentralSectionInfo* linfo, int* c, int mode)
+ {
+ mrcImageParaTypeReal X2d, Y2d, Z2d;
+ mrcImageParaTypeReal X3d, Y3d, Z3d;
+ int i, n, k0;
+ Matrix3D mat;
+ double re3d, im3d;
- mrcImage* volFT;
++ double re3d0=0, im3d0=0;
+ double re2d, im2d;
+ double re2d0, im2d0;
+ double phaseShift;
- for(Y2d = -out->HeaderN.y/2.0; Y2d < out->HeaderN.y/2.0; Y2d++) {
- for(X2d = 0; X2d <= out->HeaderN.x/2.0; X2d++) {
++ //mrcImage* volFT;
+
++ DEBUGPRINT("SectionPut Start\n");
+
+ if(c==0) {
+ volFT->Header = template3D->Header;
+ count->Header = template3D->Header;
+ mrcInit(volFT, NULL);
+ mrcInit(count, NULL);
+ }
+ c++;
+
+ lmrcImageFFTCenterChange(volFT, 0);
+
+ matrix3DRotationAntiSetFollowingEulerAngle(mat, linfo->EulerMode, linfo->Rot1, linfo->Rot2, linfo->Rot3, MATRIX_3D_MODE_INITIALIZE);
+
- if(-volFT->HeaderN.x/2 < X3d && X3d < volFT->HeaderN.x/2
- &&-volFT->HeaderN.y/2 < Y3d && Y3d < volFT->HeaderN.y/2
- &&-volFT->HeaderN.z/2 < Z3d && Z3d < volFT->HeaderN.z/2) {
++ for(Y2d = -in->HeaderN.y/2.0; Y2d < in->HeaderN.y/2.0; Y2d++) {
++ for(X2d = 0; X2d < in->HeaderN.x/2.0; X2d++) {
+ X3d = mat[0][0]*X2d + mat[1][0]*Y2d; // + mat[2][0]*Z2d(0);
+ Y3d = mat[0][1]*X2d + mat[1][1]*Y2d; // + mat[2][1]*Z2d(0);
+ Z3d = mat[0][2]*X2d + mat[1][2]*Y2d; // + mat[2][2]*Z2d(0);
+
- phaseShift = 2*M_PI*(-linfo->TransX*X2d/out->HeaderN.x - linfo->TransY*Y2d/out->HeaderN.y);
++ if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5
++ &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5
++ &&(-volFT->HeaderN.z/2)+0.5 < Z3d && Z3d < (volFT->HeaderN.z/2)-0.5 ){
+ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &re3d, mrcPixelRePart, linfo->InterpMode);
+ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &im3d, mrcPixelImPart, linfo->InterpMode);
+ } else {
+ re3d = 0;
+ im3d = 0;
+ }
- DEBUGPRINT5("coord: %f %f <- %f %f %f\n", X2d, Y2d, X3d, Y3d, Z3d);
- DEBUGPRINT4("data: %f %f <- %f %f \n", re2d, im2d, re3d, im3d);
- DEBUGPRINT5("3d: %f %f at %f %f %f\n", re3d, im3d, X3d, Y3d, Z3d);
- DEBUGPRINT4("2d: %f %f at %f %f \n", re2d, im2d, X2d, Y2d);
-
- mrcPixelDataGet(in, X2d0, Y2d0, 0, &re2d0, mrcPixelRePart, linfo->InterpMode);
- mrcPixelDataGet(in, X2d0, Y2d0, 0, &im2d0, mrcPixelImPart, linfo->InterpMode);
-
++ phaseShift = 2*M_PI*(-linfo->TransX*X2d/in->HeaderN.x - linfo->TransY*Y2d/in->HeaderN.y);
+
+ re2d = re3d*cos(phaseShift) - im3d*sin(phaseShift);
+ im2d = re3d*sin(phaseShift) + im3d*cos(phaseShift);
+
-
- re3d0 = re3d*cos(-phaseShift) - im3d*sin(-phaseShift);
++// DEBUGPRINT5("coord: %f %f <- %f %f %f\n", X2d, Y2d, X3d, Y3d, Z3d);
++// DEBUGPRINT4("data: %f %f <- %f %f \n", re2d, im2d, re3d, im3d);
++// DEBUGPRINT5("3d: %f %f at %f %f %f\n", re3d, im3d, X3d, Y3d, Z3d);
++// DEBUGPRINT4("2d: %f %f at %f %f \n", re2d, im2d, X2d, Y2d);
++
++ mrcPixelDataGet(in, X2d, Y2d, 0, &re2d0, mrcPixelRePart, linfo->InterpMode);
++ mrcPixelDataGet(in, X2d, Y2d, 0, &im2d0, mrcPixelImPart, linfo->InterpMode);
++//if(re2d0 == 0 && im2d0 == 0){
++//}else{
+ re3d = re2d+re2d0*probability;
+ im3d = im2d+im2d0*probability;
- if(-volFT->HeaderN.x/2 < X3d && X3d < volFT->HeaderN.x/2
- &&-volFT->HeaderN.y/2 < Y3d && Y3d < volFT->HeaderN.y/2
- &&-volFT->HeaderN.z/2 < Z3d && Z3d < volFT->HeaderN.z/2) {
++
++ re3d0 = re3d*cos(-phaseShift) - im3d*sin(-phaseShift);
+ im3d0 = re3d*sin(-phaseShift) + im3d*cos(-phaseShift);
++ // DEBUGPRINT4("new data: %f %f <- %f %f \n", re2d0, im2d0, re3d0, im3d0);
+
- if(-volFT->HeaderN.x/2 < X3d && X3d < volFT->HeaderN.x/2
- &&-volFT->HeaderN.y/2 < Y3d && Y3d < volFT->HeaderN.y/2
- &&-volFT->HeaderN.z/2 < Z3d && Z3d < volFT->HeaderN.z/2) {
- mrcPixelDataGet(counter, X3d, Y3d, Z3d, &re3d0, mrcPixelRePart, linfo->InterpMode);
- mrcPixelDataSet(counter, X3d, Y3d, Z3d, re3d0+1, mrcPixelRePart);
- }
++ if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5
++ &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5
++ &&(-volFT->HeaderN.z/2)+0.5 < Z3d && Z3d < (volFT->HeaderN.z/2)-0.5) {
+ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, re3d0, mrcPixelRePart);
+ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, im3d0, mrcPixelImPart);
+ }
+
- }
++ if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5
++ &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5
++ &&(-volFT->HeaderN.z/2)+0.5 < Z3d && Z3d < (volFT->HeaderN.z/2)-0.5) {
++ mrcPixelDataGet(count, X3d, Y3d, Z3d, &re3d0, mrcPixelRePart, linfo->InterpMode);
++ // if(re3d0==0 && im3d0==0){
++ // printf("not zerozero\n");
++ // }else{
++ if(re3d0!=0 || im3d0!=0){
++ mrcPixelDataSet(count, X3d, Y3d, Z3d, re3d0+1, mrcPixelRePart);
++ // printf(" zerozero\n");
++ }
++ // DEBUGPRINT1("count: %f \n", re3d0);
+ }
- lmrcImageFFTCenterChange(out, 0);
-
- if(!IsFT(volume, "lmrcFFTCentralSectionGet", 0)) {
++ }
++// }
+ }
+
+ lmrcImageFFTCenterChange(volFT, 0);
- }
++/*
++ if(!IsFT(volFT, "lmrcFFTCentralSectionGet", 0)){
+ mrcImageFree(volFT, 0);
+ memoryFree(volFT);
++ }*/
+ }
void
lmrcFFTCentralSectionGet(mrcImage* out, mrcImage* template, mrcImage* volume, lmrcFFTCentralSectionInfo* linfo, int mode)
--- /dev/null
--- /dev/null
++/*
++# %M% %Y% %I%
++# The latest update : %G% at %U%
++#
++#%Z% lmrcFFTCentralSection ver %I%
++#%Z% Created by
++#%Z%
++#%Z% Usage : lmrcFFTCentralSection
++#%Z% Attention
++#%Z%
++*/
++static char __sccs_id[] = "%Z%lmrcFFTCentralSection ver%I%; Date:%D% %Z%";
++
++#undef DEBUG
++#include "genUtil.h"
++
++#include "Memory.h"
++#include "./lmrcFFTCentralSection.h"
++void
++lmrcImageFFTRhoFilter(mrcImage* volFT, mrcImage* count, lmrcFFTCentralSectionInfo* linfo, int mode)
++{
++ mrcImageParaTypeReal X3d, Y3d, Z3d;
++ double re3d, im3d, sum;
++
++// for(Z3d = (-volFT->HeaderN.z/2.0)+0.5; Z3d < ( volFT->HeaderN.z/2.0)-0.5; Z3d++) {
++// for(Y3d = (-volFT->HeaderN.y/2.0)+0.5; Y3d < (volFT->HeaderN.y/2.0)-0.5; Y3d++) {
++// for(X3d = 1; X3d < (volFT->HeaderN.x/2.0)-0.5; X3d++) {
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &re3d, mrcPixelRePart, linfo->InterpMode);
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &im3d, mrcPixelImPart, linfo->InterpMode);
++ mrcPixelDataGet(count, X3d, Y3d, Z3d, &sum, mrcPixelRePart, linfo->InterpMode);
++ if(0<sum) {
++ re3d /= sum;
++ im3d /= sum;
++ } else {
++ re3d = 0;
++ im3d = 0;
++ }
++ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, re3d, mrcPixelRePart);
++ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, im3d, mrcPixelImPart);
++ }
++ }
++ }
++}
++
++void
++lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* template3D, mrcImage* in, double probability, lmrcFFTCentralSectionInfo* linfo, int* c, int mode)
++{
++ mrcImageParaTypeReal X2d, Y2d, Z2d;
++ mrcImageParaTypeReal X3d, Y3d, Z3d;
++ int i, n, k0;
++ Matrix3D mat;
++ double re3d, im3d;
++ double re3d0, im3d0;
++ double re2d, im2d;
++ double re2d0, im2d0;
++ double phaseShift;
++ //mrcImage* volFT;
++
++ DEBUGPRINT("SectionPut Start\n");
++
++ if(c==0) {
++ volFT->Header = template3D->Header;
++ count->Header = template3D->Header;
++ mrcInit(volFT, NULL);
++ mrcInit(count, NULL);
++ }
++ c++;
++
++ lmrcImageFFTCenterChange(volFT, 0);
++
++ matrix3DRotationAntiSetFollowingEulerAngle(mat, linfo->EulerMode, linfo->Rot1, linfo->Rot2, linfo->Rot3, MATRIX_3D_MODE_INITIALIZE);
++
++ for(Y2d = -in->HeaderN.y/2.0; Y2d < in->HeaderN.y/2.0; Y2d++) {
++ for(X2d = 0; X2d < in->HeaderN.x/2.0; X2d++) {
++ X3d = mat[0][0]*X2d + mat[1][0]*Y2d; // + mat[2][0]*Z2d(0);
++ Y3d = mat[0][1]*X2d + mat[1][1]*Y2d; // + mat[2][1]*Z2d(0);
++ Z3d = mat[0][2]*X2d + mat[1][2]*Y2d; // + mat[2][2]*Z2d(0);
++
++ if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5
++ &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5
++ &&(-volFT->HeaderN.z/2)+0.5 < Z3d && Z3d < (volFT->HeaderN.z/2)-0.5 ){
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &re3d, mrcPixelRePart, linfo->InterpMode);
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &im3d, mrcPixelImPart, linfo->InterpMode);
++ } else {
++ re3d = 0;
++ im3d = 0;
++ }
++ phaseShift = 2*M_PI*(-linfo->TransX*X2d/in->HeaderN.x - linfo->TransY*Y2d/in->HeaderN.y);
++
++ re2d = re3d*cos(phaseShift) - im3d*sin(phaseShift);
++ im2d = re3d*sin(phaseShift) + im3d*cos(phaseShift);
++
++// DEBUGPRINT5("coord: %f %f <- %f %f %f\n", X2d, Y2d, X3d, Y3d, Z3d);
++// DEBUGPRINT4("data: %f %f <- %f %f \n", re2d, im2d, re3d, im3d);
++// DEBUGPRINT5("3d: %f %f at %f %f %f\n", re3d, im3d, X3d, Y3d, Z3d);
++// DEBUGPRINT4("2d: %f %f at %f %f \n", re2d, im2d, X2d, Y2d);
++
++ mrcPixelDataGet(in, X2d, Y2d, 0, &re2d0, mrcPixelRePart, linfo->InterpMode);
++ mrcPixelDataGet(in, X2d, Y2d, 0, &im2d0, mrcPixelImPart, linfo->InterpMode);
++
++ re3d = re2d+re2d0*probability;
++ im3d = im2d+im2d0*probability;
++
++ re3d0 = re3d*cos(-phaseShift) - im3d*sin(-phaseShift);
++ im3d0 = re3d*sin(-phaseShift) + im3d*cos(-phaseShift);
++ // DEBUGPRINT4("new data: %f %f <- %f %f \n", re2d0, im2d0, re3d0, im3d0);
++
++ if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5
++ &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5
++ &&(-volFT->HeaderN.z/2)+0.5 < Z3d && Z3d < (volFT->HeaderN.z/2)-0.5) {
++ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, re3d0, mrcPixelRePart);
++ mrcPixelDataSet(volFT, X3d, Y3d, Z3d, im3d0, mrcPixelImPart);
++ }
++
++ if((-volFT->HeaderN.x/2)+0.5 < X3d && X3d < (volFT->HeaderN.x/2)-0.5
++ &&(-volFT->HeaderN.y/2)+0.5 < Y3d && Y3d < (volFT->HeaderN.y/2)-0.5
++ &&(-volFT->HeaderN.z/2)+0.5 < Z3d && Z3d < (volFT->HeaderN.z/2)-0.5) {
++ mrcPixelDataGet(count, X3d, Y3d, Z3d, &re3d0, mrcPixelRePart, linfo->InterpMode);
++ // DEBUGPRINT1("count: %f \n", re3d0);
++ mrcPixelDataSet(count, X3d, Y3d, Z3d, re3d0+1, mrcPixelRePart);
++ }
++ }
++ }
++
++ lmrcImageFFTCenterChange(volFT, 0);
++/*
++ if(!IsFT(volFT, "lmrcFFTCentralSectionGet", 0)){
++ mrcImageFree(volFT, 0);
++ memoryFree(volFT);
++ }*/
++}
++
++void
++lmrcFFTCentralSectionGet(mrcImage* out, mrcImage* template, mrcImage* volume, lmrcFFTCentralSectionInfo* linfo, int mode)
++{
++ mrcImageParaTypeReal X2d, Y2d, Z2d;
++ mrcImageParaTypeReal X3d, Y3d, Z3d;
++ int i, n, k0;
++ Matrix3D mat;
++ double re3d, im3d;
++ double re2d, im2d;
++ double phaseShift;
++ mrcImage* volFT;
++ double weight;
++
++ if(IsFT(volume, "lmrcFFTCentralSectionGet", 0)) {
++ volFT = volume;
++ } else {
++ volFT = memoryAllocate(sizeof(mrcImage), "in lmrcFFTCentralSectionGet");
++ lmrcImageFFT(volFT, volume, 0);
++ }
++
++ out->Header = template->Header;
++ mrcInit(out, NULL);
++
++ weight = 1.0/sqrt(volFT->HeaderN.x*volFT->HeaderN.y*volFT->HeaderN.z)*sqrt(out->HeaderN.x*out->HeaderN.y);
++
++ lmrcImageFFTCenterChange(volFT, 0);
++
++ matrix3DRotationAntiSetFollowingEulerAngle(mat, linfo->EulerMode, linfo->Rot1, linfo->Rot2, linfo->Rot3, MATRIX_3D_MODE_INITIALIZE);
++
++ for(Y2d = -out->HeaderN.y/2.0; Y2d < out->HeaderN.y/2.0; Y2d++) {
++ for(X2d = 0; X2d <= out->HeaderN.x/2.0; X2d++) {
++ X3d = mat[0][0]*X2d + mat[1][0]*Y2d; // + mat[2][0]*Z2d(0);
++ Y3d = mat[0][1]*X2d + mat[1][1]*Y2d; // + mat[2][1]*Z2d(0);
++ Z3d = mat[0][2]*X2d + mat[1][2]*Y2d; // + mat[2][2]*Z2d(0);
++
++ if(-volFT->HeaderN.x/2 < X3d && X3d < volFT->HeaderN.x/2
++ &&-volFT->HeaderN.y/2 < Y3d && Y3d < volFT->HeaderN.y/2
++ &&-volFT->HeaderN.z/2 < Z3d && Z3d < volFT->HeaderN.z/2) {
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &re3d, mrcPixelRePart, linfo->InterpMode);
++ mrcPixelDataGet(volFT, X3d, Y3d, Z3d, &im3d, mrcPixelImPart, linfo->InterpMode);
++ } else {
++ re3d = 0;
++ im3d = 0;
++ }
++ phaseShift = 2*M_PI*(-linfo->TransX*X2d/out->HeaderN.x - linfo->TransY*Y2d/out->HeaderN.y);
++
++ re2d = re3d*cos(phaseShift) - im3d*sin(phaseShift);
++ im2d = re3d*sin(phaseShift) + im3d*cos(phaseShift);
++
++ DEBUGPRINT5("coord: %f %f <- %f %f %f\n", X2d, Y2d, X3d, Y3d, Z3d);
++ DEBUGPRINT4("data: %f %f <- %f %f \n", re2d, im2d, re3d, im3d);
++ DEBUGPRINT5("3d: %f %f at %f %f %f\n", re3d, im3d, X3d, Y3d, Z3d);
++ DEBUGPRINT4("2d: %f %f at %f %f \n", re2d, im2d, X2d, Y2d);
++ mrcPixelDataSet(out, X2d, Y2d, 0, re2d*weight, mrcPixelRePart);
++ mrcPixelDataSet(out, X2d, Y2d, 0, im2d*weight, mrcPixelImPart);
++ }
++ }
++
++ lmrcImageFFTCenterChange(volFT, 0);
++ lmrcImageFFTCenterChange(out, 0);
++
++ if(!IsFT(volume, "lmrcFFTCentralSectionGet", 0)) {
++ mrcImageFree(volFT, 0);
++ memoryFree(volFT);
++ }
++}
/* prototype begin */
extern void lmrcFFTCentralSectionGet(mrcImage* out, mrcImage* template, mrcImage* volume, lmrcFFTCentralSectionInfo* linfo, int mode);
+
++extern void lmrcImageFFTRhoFilter(mrcImage* volFT, mrcImage* count, lmrcFFTCentralSectionInfo* linfo, int mode);
++extern void lmrcImageFFTCentralSectionPut(mrcImage* volFT, mrcImage* count, mrcImage* template3D, mrcImage* in, double probability, lmrcFFTCentralSectionInfo* linfo, int* c, int mode);
++
++//lmrcFFTCentralSectionCompare.c
+extern void lmrcFFTCentralSectionCompare(mrcImage* in, mrcImage* volume, lmrcFFTCentralSectionCompareInfo* linfo, int mode);
+extern void lmrcFFTCentralSectionCompareInfoWrite(FILE* fpt, float Likelihood, int mode);
++
++//lmrcMultiFFTCentralSectionsComapre
+extern void lmrcFFTCentralSectionsGet(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, mrcImage* template, mrcImage* volume, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode, int nummode);
+extern void lmrcMultiFFTCentralSectionsCompare(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, mrcImage* in, mrcImage* volume, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode, int nummode);
+extern void lmrcMultiFFTCentralSectionsCompareNormalization(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode);
+extern void lmrcMultiFFTCentralSectionsCompareInfoWrite(FILE* fpt, char* filename, lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, float mode1, float mode2);
+extern void lmrcMultiFFTCentralSectionsCompareInfoSort(lmrcMultiFFTCentralSectionsCompareInfoOut Out[], int left, int right);
+extern void lmrcMultiFFTCentralSectionsCompareInfoProbSet(lmrcMultiFFTCentralSectionsCompareInfo* linfo ,int mode);
+extern void lmrcMultiFFTCentralSectionsCompareInfoLimit(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, float mode1, float mode2);
+extern void lmrcMultiFFTCentralSectionsCompareInfoUpdate(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo);
+extern void lmrcMultiFFTCentralSectionsCompareInfoVariation(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo);
+extern void lmrcMultiFFTCentralSectionsCompareSigma(mrcImage* in, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode);
/* prototype end */
+
#ifdef __cplusplus
};
#endif
--- /dev/null
- DEBUGPRINT1("lmrcMultiFFTCentralSectionsComapreNormalization sum: %f\n",sum);
+/*
+# %M% %Y% %I%
+# The latest update : %G% at %U%
+#
+#%Z% lmrcMultiFFTCentralSectionsCompare ver %I%
+#%Z% Created by
+#%Z%
+#%Z% Usage : lmrcMultiFFTCentralSectionsCompare
+#%Z% Attention
+#%Z%
+*/
+static char __sccs_id[] = "%Z%lmrcMultiFFTCentralSectionsCompare ver%I%; Date:%D% %Z%";
+
+#define DEBUG
+#include "genUtil.h"
+#include "Memory.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <math.h>
+#include "./lmrcFFTCentralSection.h"
+#include "../inc/mrcImage.h"
+
+void
+lmrcMultiFFTCentralSectionsCompare(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, mrcImage* in, mrcImage* volume, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode, int nummode){
+ mrcImageParaTypeReal x, y;
+ double likelihood, prelikelihood;
+ double likelihoodxre, likelihoodyre, likelihoodxyre;
+ double likelihoodxim, likelihoodyim, likelihoodxyim;
+ double rein, imin;
+ double inOrigin, inlim;
+ double revol, imvol;
+ int i,j, flag;
+ clock_t start,end;
+ int sig_x,sig_y;
+ double sigma, sigMax=0, sigMin=100;;
+
+ DEBUGPRINT("lmrcMultiFFTCentralSectionsCompare start\n");
+
+ if(mode != 1){
+ lmrcMultiFFTCentralSectionsCompareSigma(in, linfo, 0);//0:sigma=1 1:sigmaCalcu
+ }
+
+ for(i=0; i < linfo->OutSize; i++){
+ flag =0;
+ for(j=0; j< linfo->PriorSize; j++){
+ if(Out[i].OriginNum == linfo->Prior[j].OriginNum){
+ if(mode == 1){
+ likelihoodxre = 0.0;
+ likelihoodyre = 0.0;
+ likelihoodxyre = 0.0;
+ likelihoodxim = 0.0;
+ likelihoodyim = 0.0;
+ likelihoodxyim = 0.0;
+ for(x=-in->HeaderN.x/2.0; x < in->HeaderN.x/2.0 ; x++){
+ for(y=-in->HeaderN.y/2.0; y < in -> HeaderN.y/2.0 ; y++){
+
+ mrcPixelDataGet(in, x, y, 0, &rein, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ if(rein > 0){
+ mrcPixelDataGet(in, x, y, 0, &imin, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ mrcPixelDataGet(&Out[i].out, x, y, 0, &revol, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ mrcPixelDataGet(&Out[i].out, x, y, 0, &imvol, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+
+ likelihoodxre = likelihoodxre + rein*rein;
+ likelihoodxim = likelihoodxim + imin*imin;
+ likelihoodyre = likelihoodyre + revol*revol;
+ likelihoodyim = likelihoodyim + imvol*imvol;
+ likelihoodxyre = likelihoodxyre + rein*revol;
+ likelihoodxyim = likelihoodxyim + imin*imvol;
+ }
+ }
+ }
+ Out[i].Likelihood = likelihoodxyre/sqrt(likelihoodxre*likelihoodyre) + likelihoodxyim/sqrt(likelihoodxim*likelihoodyim);
+ }else{
+ likelihood = 1;
+ prelikelihood = 0;
+ sigma = 1;
+ sig_x =0;
+ for(x= -in->HeaderN.x/2.0; x < in -> HeaderN.x/2.0 ; x++){
+ sig_y=0;
+ for(y= -in->HeaderN.y/2.0; y < in -> HeaderN.y/2.0 ; y++){
+ mrcPixelDataGet(in, x, y, 0, &rein, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(in, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &rein, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ if(rein > 0 && linfo->Sigma[sig_x][sig_y] > 0.0){
+ mrcPixelDataGet(in, x, y, 0, &imin, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ mrcPixelDataGet(&Out[i].out, x, y, 0, &revol, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ mrcPixelDataGet(&Out[i].out, x, y, 0, &imvol, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(in, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &imin, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(&Out[i].out, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &revol, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(&Out[i].out, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &imvol, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+
+
+ // sigma = ((rein - revol)*(rein - revol) + (imin - imvol)*(imin - imvol))/((-2)*linfo->Sigma[sig_x][sig_y]);
+ //// prelikelihood = (linfo->SigMin*2*M_PI)*(1/((linfo->Sigma[sig_x][sig_y])*2*M_PI))*(exp(((rein - revol)*(rein - revol) + (imin - imvol)*(imin - imvol))/((-2)*linfo->Sigma[sig_x][sig_y])));
+ prelikelihood = prelikelihood + (((rein - revol)*(rein - revol) + (imin - imvol)*(imin - imvol))/((-2)*linfo->Sigma[sig_x][sig_y]));
+ // if(prelikelihood > 0.0){
+ // likelihood = likelihood * prelikelihood;
+ // }
+ // sigma= sigma * linfo->Sigma[sig_x][sig_y];
+ // DEBUGPRINT5(" preLikelihood likelihood, Sigma %d %e %e %e %e \n", i, prelikelihood, sigma, likelihood, linfo->Sigma[sig_x][sig_y]);
+ }
+ sig_y ++;
+ }
+ sig_x ++;
+ }
+ // DEBUGPRINT3("sigma likelihood %f %f %f\n", linfo->Sigma[sig_x-1][sig_y-1], prelikelihood, likelihood);
+ Out[i].Likelihood = exp(prelikelihood)/(2*M_PI);
+ // Out[i].Likelihood = likelihood/(2*M_PI);
+ // Out[i].Likelihood = likelihood;
+ }
+ flag = 1;
+ }
+ }
+ if(flag == 0){
+ Out[i].Likelihood = 0;
+ }
+ // DEBUGPRINT3("Likelihood %d %f %e\n", i, prelikelihood, Out[i].Likelihood);
+ }
+ DEBUGPRINT("lmrcMultiFFTCentralSectionsCompare end\n");
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareNormalization(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode){
+
+ int i;
+ double sum=0.0;
+ double min;
+ double max;
+ double delta = 0.0;
+ double weight = 0.0;
+ double* preProb;
+
+ min = Out[0].Post;
+ max = Out[0].Post;
+
+ if(mode ==1){
+ preProb = (double*)malloc(sizeof(double)*linfo->OutSize);
+ for(i=0; i < linfo->OutSize; i++){
+ if(min > Out[i].Post){
+ min = Out[i].Post;
+ }else if(max < Out[i].Post){
+ max = Out[i].Post;
+ }
+ sum = sum + Out[i].Post;
+ }
+ // DEBUGPRINT1("lmrcMultiFFTCentralSectionsComapreNormalization sum: %f\n",sum);
+ delta = max - min;
+ for(i=0; i<linfo->OutSize; i++){
+ preProb[i] = (exp((Out[i].Post - min)/delta) - 1)/(exp(1)-1);
+ weight = weight + exp(preProb[i]);
+ }
+
+ for(i=0; i<linfo->OutSize; i++){
+ if(Out[i].Post > 0){
+ Out[i].Prob = exp(preProb[i])/weight;
+ Out[i].Post = exp(preProb[i])/weight;
+ }else{
+ Out[i].Prob = 0;
+ Out[i].Post = 0;
+ }
+ }
+ }else{
+ for(i=0; i<linfo->OutSize; i++){
+ sum = sum + Out[i].Post;
+ }
++ // DEBUGPRINT1("lmrcMultiFFTCentralSectionsComapreNormalization sum: %f\n",sum);
+ for(i=0; i<linfo->OutSize; i++){
+ if(sum != 0){
+ Out[i].Prob = Out[i].Post / sum;
+ Out[i].Post = Out[i].Post / sum;
+ }else{
+ Out[i].Prob = 1/(double)(linfo->OutSize);
+ }
+
+ }
+ }
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareInfoWrite(FILE* fpt, char* filename, lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, float mode1, float mode2){
+ int i;
+
+ for(i=0; i< linfo->OutSize; i++){
+ if(Out[i].Prob == 0){
+ }else{
+ fprintf(fpt,"%s %s %15.4f %15.4f %15.4f %s %15d %15.6e\n", filename, linfo->Out[i].EulerMode, Out[i].Rot[0]*DEGREE, Out[i].Rot[1]*DEGREE, Out[i].Rot[2]*DEGREE, Out[i].volume, Out[i].OriginNum, Out[i].Prob);
+ }
+ }
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareInfoLimit(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo, float mode1, float mode2){
+ int i,j;
+ double sum=0;
+
+ for(i=0; i< linfo->OutSize; i++){
+ if(Out[i].Prob < mode1){
+ Out[i].Prob = 0;
+ Out[i].Post = 0;
+ }else if(mode2 != 0){
+ if(sum <= mode2){
+ sum = sum + Out[i].Prob;
+ }else{
+ Out[i].Prob = 0;
+ Out[i].Post = 0;
+ }
+ }
+ }
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareInfoSort(lmrcMultiFFTCentralSectionsCompareInfoOut Out[], int left, int right){
+
+ int pl=left;
+ int pr=right;
+ int middle=(left+right)/2;
+ lmrcMultiFFTCentralSectionsCompareInfoOut temp;
+ double pivot;
+
+ pivot = Out[middle].Prob;
+
+ do{
+ while(Out[pl].Prob > pivot) pl++;
+ while(Out[pr].Prob < pivot) pr--;
+
+ if(pl <= pr){
+ temp = Out[pl];
+ Out[pl] = Out[pr];
+ Out[pr] = temp;
+ pl++;
+ pr--;
+ }
+ }while(pl <= pr);
+
+ if(left < pr) lmrcMultiFFTCentralSectionsCompareInfoSort(Out, left, pr);
+ if(pl < right) lmrcMultiFFTCentralSectionsCompareInfoSort(Out, pl, right);
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareInfoUpdate(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo){
+ int i;
+
+ for(i=0; i<linfo->PriorSize; i++){
+ linfo->Out[linfo->Prior[i].OriginNum].Post = linfo->Prior[i].Prior * linfo->Out[linfo->Prior[i].OriginNum].Likelihood;
+ }
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareInfoProbSet(lmrcMultiFFTCentralSectionsCompareInfo* linfo ,int mode){
+ int i;
+ for(i=0; i<linfo->PriorSize; i++){
+ if(mode == 0){
+ linfo->Prior[i].Prior = 1/(double)(linfo->PriorSize);
+ }else if(mode == 1){
+ // linfo->Out[i].Post = linfo->Prior[i].Prior * linfo->Out[Prior[i].OriginNum].Likelihood;
+ }
+ }
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareInfoVariation(lmrcMultiFFTCentralSectionsCompareInfoOut* Out, lmrcMultiFFTCentralSectionsCompareInfo* linfo){
+ int i,j;
+ double var=0,temp=0;
+
+ for(i=0; i< linfo->PriorSize; i++){
+ for(j=0; j< linfo->OutSize; j++){
+ if(linfo->Prior[i].OriginNum == Out[j].OriginNum){
+ var = var + sqrt((Out[j].Prob - linfo->Prior[i].Prior)*(Out[j].Prob - linfo->Prior[i].Prior));
+ /* temp = Out[linfo->Prior[i].OriginNum].Prob - linfo->Prior[i].Prior;
+ if(temp < 0){
+ temp = temp * (-1);
+ }
+ var = var + temp;
+ */
+ }
+ }
+ }
+ linfo->Variat = var;
+ printf("Variation: %f\n",linfo->Variat);
+}
+
+void
+lmrcMultiFFTCentralSectionsCompareSigma(mrcImage* in, lmrcMultiFFTCentralSectionsCompareInfo* linfo, int mode){
+
+ mrcImageParaTypeReal x, y;
+ double rein, imin;
+ double revol, imvol;
+ int i,j;
+ int sig_x, sig_y;
+ double sigma, sigMax=0, sigMin=100, delta;
+ double inOrigin, inlim;
+
+ linfo->Sigma = malloc(sizeof(double*)*(in->HeaderN.x));
+ if(linfo->Sigma ==NULL){
+ DEBUGPRINT("malloc error\n");
+ }
+ sig_x = 0;
+ for(x=-in->HeaderN.x/2.0; x< in->HeaderN.x/2.0; x++){
+ linfo->Sigma[sig_x] = malloc(sizeof(double)*in->HeaderN.y);
+ if(linfo->Sigma[sig_x]==NULL){
+ DEBUGPRINT("malloc error\n");
+ }
+ sig_x ++;
+ }
+ if(mode == 1){
+ mrcPixelDataGet(in, 0, 0, 0, &inOrigin, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ inlim = inOrigin / 1000;
+
+ sig_x=0;
+ for(x = -in->HeaderN.x/2.0 ; x < in->HeaderN.x/2.0; x++){
+ sig_y=0;
+ for(y = -in->HeaderN.y/2.0 ; y < in->HeaderN.y/2.0; y++){
+ sigma=0;
+ mrcPixelDataGet(in, x, y, 0, &rein, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(in, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &rein, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ if(rein > 0.0){
+ for(i=0; i < linfo->PriorSize; i++){
+ mrcPixelDataGet(in , x, y, 0, &imin, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ mrcPixelDataGet(&linfo->Out[i].out, x, y, 0, &revol, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ mrcPixelDataGet(&linfo->Out[i].out, x, y, 0, &imvol, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(in, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &rein, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(in, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &imin, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ // mrcPixelDataGet(&linfo->Out[linfo->Prior[i].OriginNum].out, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &revol, mrcPixelRePart, linfo->llinfo.llinfo.InterpMode);
+ mrcPixelDataGet(&linfo->Out[linfo->Prior[i].OriginNum].out, (x/(in->HeaderN.x/2.0))*(x/(in->HeaderN.x/2.0)), (y/(in->HeaderN.y/2.0))*(y/(in->HeaderN.y/2.0)), 0, &imvol, mrcPixelImPart, linfo->llinfo.llinfo.InterpMode);
+ sigma = sigma + linfo->Prior[i].Prior*((rein - revol)*(rein - revol) + (imin - imvol)*(imin - imvol));
+ }
+ linfo->Sigma[sig_x][sig_y] = sigma/2;
+
+ if(sigMax < linfo->Sigma[sig_x][sig_y]){
+ sigMax = linfo->Sigma[sig_x][sig_y];
+ }else if(sigMin > linfo->Sigma[sig_x][sig_y] && linfo->Sigma[sig_x][sig_y] > 0.0 ){
+ //}else if(sigMin > linfo->Sigma[sig_x][sig_y] && linfo->Sigma[sig_x][sig_y] > 0.000001 ){
+ sigMin = linfo->Sigma[sig_x][sig_y];
+ }//else if(linfo->Sigma[sig_x][sig_y] < 0.000001){
+ // linfo->Sigma[sig_x][sig_y] = 0.0;
+ // }
+
+ }
+ else{
+ linfo->Sigma[sig_x][sig_y] = 0.0;
+ }
+ // DEBUGPRINT3("sigma %d %d %f\n",sig_x, sig_y, linfo->Sigma[sig_x][sig_y]);
+ sig_y++;
+ }
+ sig_x++;
+ }
+ DEBUGPRINT2("sigMax sigMin %e %e\n",sigMax, sigMin);
+ linfo->SigMin = sigMin;
+ // delta = sqrt((sigMax-sigMin)*(sigMax-sigMin));
+ /* for(sig_x =0; sig_x < (int)in->HeaderN.x; sig_x++){
+ for(sig_y =0; sig_y < (int)in->HeaderN.y; sig_y++){
+ linfo->Sigma[sig_x][sig_y] = linfo->Sigma[sig_x][sig_y]/(sigMin*2*M_PI);
+ // linfo->Sigma[sig_x][sig_y] = linfo->Sigma[sig_x][sig_y] /(sigMin*M_PI);
+
+ }
+ }*/
+ }else{
+ for(sig_x =0; sig_x < (int)in->HeaderN.x; sig_x++){
+ for(sig_y =0; sig_y < (int)in->HeaderN.y; sig_y++){
+ linfo->Sigma[sig_x][sig_y] = 1.0;
+ }
+ }
+ }
+
+}
WORLDNAME=Tools
WORLDNAME=Tools
WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
- WORLDNAME=Tools
+WORLDNAME=Tools
+WORLDNAME=Tools
WORLDNAME=Tools
WORLDNAME=Tools
WORLDNAME=Tools
--- /dev/null
- @if [ -x $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME) ]; \
+include ../Config/Define.inc
+include ../../Config/Define.inc
+include ../../../Config/Define.inc
+include ../../../../Config/Define.inc
+
+EOSHOME=../../../../../
+DSTDIR=$(EOSHOME)/bin
+DSTDOC=$(EOSHOME)/doc
+DSTTAR=$(EOSHOME)/tar
+
+INCFILES =
+
+LIBFILES = \
+ $(LIBPREFIX)EosObjects$(LIBSUFFIX)
+
+LIBFILESDEBUG = \
+ $(LIBPREFIX)EosObjects.debug$(LIBSUFFIX)
+
+SRCC = \
+ $(OBJECTNAME).c \
+ init.c \
+ argCheck.c \
+ usage.c \
+ util.c \
+
+SRCCXX = \
+ $(OBJECTNAME).cc \
+ init.cc \
+ argCheck.cc \
+ usage.cc \
+ util.cc \
+
+MODULES = \
+ $(OBJECTNAME).o \
+ init.o \
+ argCheck.o \
+ usage.o \
+ util.o \
+
+REALMODULES = \
+ $(OSTYPE)/$(OBJECTNAME).o \
+ $(OSTYPE)/init.o \
+ $(OSTYPE)/argCheck.o \
+ $(OSTYPE)/usage.o \
+ $(OSTYPE)/util.o
+
+MODULESDEBUG = \
+ $(OBJECTNAME).debugo \
+ init.debugo \
+ argCheck.debugo \
+ usage.debugo \
+ util.debugo \
+
+REALMODULESDEBUG = \
+ $(OSTYPE)/$(OBJECTNAME).debugo \
+ $(OSTYPE)/init.debugo \
+ $(OSTYPE)/argCheck.debugo \
+ $(OSTYPE)/usage.debugo \
+ $(OSTYPE)/util.debugo
+
+
+all: $(OSTYPE)/$(OBJECTNAME)
+ if [ ! -L $(OSTYPE) ] ; then \
+ moveHostdependent; \
+ fi
+
+debug: $(OSTYPE)/$(OBJECTNAME).debug
+
+cudagdb: $(OSTYPE)/$(OBJECTNAME).cudagdb
+
+
+$(OSTYPE)/$(OBJECTNAME)::
+ @$(RM) -f $(OSTYPE)/Makefile ; \
+ $(CP) $(EOS_HOME)/src/Config/Template/$(WORLDNAME)Template.Dir/src/ARCH/Makefile $(OSTYPE)/Makefile ; \
+ cd $(OSTYPE); \
+ $(MAKE) $(OBJECTNAME) WORLDNAME=$(WORLDNAME) CLASSNAME=$(CLASSNAME) OBJECTNAME=$(OBJECTNAME)
+
+$(OSTYPE)/$(OBJECTNAME).debug::
+ @$(RM) -f $(OSTYPE)/Makefile ; \
+ $(CP) $(EOS_HOME)/src/Config/Template/$(WORLDNAME)Template.Dir/src/ARCH/Makefile $(OSTYPE)/Makefile ; \
+ cd $(OSTYPE); \
+ $(MAKE) $(OBJECTNAME).debug WORLDNAME=$(WORLDNAME) CLASSNAME=$(CLASSNAME) OBJECTNAME=$(OBJECTNAME)
+
+$(OSTYPE)/$(OBJECTNAME).cudagdb::
+ @$(RM) -f $(OSTYPE)/Makefile ; \
+ $(CP) $(EOS_HOME)/src/Config/Template/$(WORLDNAME)Template.Dir/src/ARCH/Makefile $(OSTYPE)/Makefile ; \
+ cd $(OSTYPE); \
+ $(MAKE) $(OBJECTNAME).cudagdb WORLDNAME=$(WORLDNAME) CLASSNAME=$(CLASSNAME) OBJECTNAME=$(OBJECTNAME)
+
+cvsupdate::
+ cvs -d $(EOS_CVSROOT) update -d
+
+cvscommit::
+ cvs -d $(EOS_CVSROOT) commit
+
+edit:
+ @if [ -r $(OBJECTNAME).c ]; \
+ then \
+ sccsEdit $(OBJECTNAME).c; \
+ else \
+ echo "Source files are already editable"; \
+ fi
+ @if [ -r wish/$(OBJECTNAME).wish ]; \
+ then \
+ cd wish; sccsEdit $(OBJECTNAME).wish; \
+ else \
+ echo "Source files (wish) are already editable."; \
+ fi
+ @if [ -r ruby/$(OBJECTNAME).rb ]; \
+ then \
+ cd ruby; sccsEdit $(OBJECTNAME).rb; \
+ else \
+ echo "Source files (ruby) are already editable."; \
+ fi
+ @if [ -r perl/$(OBJECTNAME).pl ]; \
+ then \
+ cd perl; sccsEdit $(OBJECTNAME).pl ; \
+ else \
+ echo "Source files (perl) are already editable."; \
+ fi
+ @if [ -r ../Config/OptionControlFile ]; \
+ then \
+ cd ../Config; sccsEdit OptionControlFile; \
+ else \
+ echo "OptionControlFile are already editable."; \
+ fi
+
+unedit:
+ @if [ -w $(OBJECTNAME).c ]; \
+ then \
+ sccsUnedit $(OBJECTNAME).c; \
+ else \
+ echo "Source files are not editable"; \
+ fi
+ @if [ -w wish/$(OBJECTNAME).wish ]; \
+ then \
+ cd wish; sccsUnedit $(OBJECTNAME).wish; \
+ else \
+ echo "Source files (wish) are not editable."; \
+ fi
+ @if [ -w ruby/$(OBJECTNAME).rb]; \
+ then \
+ cd ruby; sccsUnedit $(OBJECTNAME).rb; \
+ else \
+ echo "Source files (ruby) are not editable."; \
+ fi
+ @if [ -w perl/$(OBJECTNAME).pl ]; \
+ then \
+ cd perl; sccsUnedit $(OBJECTNAME).pl ; \
+ else \
+ echo "Source files (ruby) are not editable."; \
+ fi
+ @if [ -w ../Config/OptionControlFile ]; \
+ then \
+ cd ../Config; sccsUnedit OptionControlFile; \
+ else \
+ echo "OptionControlFile are not editable."; \
+ fi
+
+report:
+ @if [ -r $(OBJECTNAME).c ]; \
+ then \
+ sccsReport $(OBJECTNAME).c; \
+ else \
+ echo "Source files are already editable"; \
+ fi
+ @if [ -r wish/$(OBJECTNAME).wish ]; \
+ then \
+ cd wish; sccsReport $(OBJECTNAME).wish; \
+ else \
+ echo "Source files (wish) are already editable."; \
+ fi
+ @if [ -r ruby/$(OBJECTNAME).rb ]; \
+ then \
+ cd ruby; sccsReport $(OBJECTNAME).rb; \
+ else \
+ echo "Source files (ruby) are already editable."; \
+ fi
+ @if [ -r perl/$(OBJECTNAME).pl ] ; \
+ then \
+ cd perl; sccsReport $(OBJECTNAME).pl ; \
+ else \
+ echo "Source files (perl) are already editable."; \
+ fi
+ @if [ -r ../Config/OptionControlFile ]; \
+ then \
+ cd ../Config; sccsReport OptionControlFile; \
+ else \
+ echo "OptionControlFile are already editable."; \
+ fi
+
+clean :
+ rm -f *.debugo $(OSTYPE)/*.debugo *.cudagdbo $(OSTYPE)/*.cudagdbo *.o $(OSTYPE)/*.o *.linkinfo $(OSTYPE)/*.linkinfo \
+ $(OSTYPE)/$(OBJECTNAME) $(OSTYPE)/*.$(OSTYPE) \
+ $(OSTYPE)/$(OBJECTNAME).debug $(OSTYPE)/*.$(OSTYPE).debug \
+ $(OSTYPE)/$(OBJECTNAME).cudagdb $(OSTYPE)/*.$(OSTYPE).cudagdb \
+ $(OSTYPE)/$(OBJECTNAME).linkinfo $(OSTYPE)/*.$(OSTYPE).linkinfo \
+ *.bak *.$(OSTYPE) core
+
+install: install-bin install-doc install-wish install-ruby install-shell install-perl
+ @if [ dummy$(KHOROS_KENGOBJ) != dummy ] ; \
+ then \
+ if [ -x $(KHOROS_KGENOBJ) ] ; \
+ then \
+ make install-khoros ; \
+ fi; \
+ fi
+
+install-bin:$(DSTDIR)/$(OSTYPE)/$(OBJECTNAME)
+
+$(DSTDIR)/$(OSTYPE)/$(OBJECTNAME):$(OSTYPE)/$(OBJECTNAME) $(DSTDIR)/$(OBJECTNAME)
+ @echo ---- Installing to bin
++ @echo $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME)
+ @if [ ! -d $(DSTDIR)/$(OSTYPE) ]; \
+ then \
+ mkdir $(DSTDIR)/$(OSTYPE); \
+ fi
- @$(CD) $(OSTYPE); $(INSTALL) -m 555 $(OBJECTNAME) ../$(DSTDIR)/$(OSTYPE)
- @$(CHMOD) 555 $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME)
- @$(CHGRP) Eos $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME)
- @echo $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME)
++ @if [ -x $(OSTYPE)/$(OBJECTNAME) ]; \
+ then \
++ echo "Compilation is complete"; \
+ $(RM) -f $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME); \
++ $(CD) $(OSTYPE); $(INSTALL) -m 555 $(OBJECTNAME) ../$(DSTDIR)/$(OSTYPE); \
++ $(CHMOD) 555 ../$(DSTDIR)/$(OSTYPE)/$(OBJECTNAME); \
++ else \
++ echo "Compilation is incomplete. $(OBJECTNAME)"; \
+ fi
- $(CHGRP) Eos $(DSTDIR)/wish/$(OBJECTNAME)/*;\
+ @echo ---- end of bin
+
+install-wish:
+ @if [ -d wish ]; \
+ then \
+ echo "---- Tcl/Tk file Install"; \
+ if [ ! -d $(DSTDIR)/wish/$(OBJECTNAME) ]; \
+ then \
+ mkdir $(DSTDIR)/wish/$(OBJECTNAME) ; \
+ fi ; \
+ $(CP) -f wish/* $(DSTDIR)/wish/$(OBJECTNAME); \
+ $(CHMOD) 555 $(DSTDIR)/wish/$(OBJECTNAME)/* ;\
+ touch $(DSTDIR)/wish/$(OBJECTNAME)/tclIndex;\
+ $(CHMOD) 666 $(DSTDIR)/wish/$(OBJECTNAME)/tclIndex;\
- $(CHGRP) Eos $(DSTDIR)/ruby/$(OBJECTNAME)/* ; \
+ echo "---- Tcl/Tk file Installed";\
+ fi
+
+install-ruby:
+ @if [ -d ruby ]; \
+ then \
+ echo "---- Ruby/Tk file Install"; \
+ if [ ! -d $(DSTDIR)/ruby/$(OBJECTNAME) ]; \
+ then \
+ mkdir $(DSTDIR)/ruby/$(OBJECTNAME) ; \
+ fi ; \
+ $(CP) -f ruby/* $(DSTDIR)/ruby/$(OBJECTNAME); \
+ $(CHMOD) 555 $(DSTDIR)/ruby/$(OBJECTNAME)/* ; \
- $(CHGRP) Eos $(DSTDIR)/perl/$(OBJECTNAME)/* ; \
+ echo "---- Ruby/Tk file Installed"; \
+ fi
+
+install-perl:
+ @if [ -d perl ]; \
+ then \
+ echo "---- Perl/Tk file Install"; \
+ if [ ! -d $(DSTDIR)/perl/$(OBJECTNAME) ]; \
+ then \
+ mkdir $(DSTDIR)/perl/$(OBJECTNAME) ; \
+ fi; \
+ $(CP) -f perl/* $(DSTDIR)/perl/$(OBJECTNAME); \
+ $(CHMOD) 555 $(DSTDIR)/perl/$(OBJECTNAME)/* ; \
- $(CHGRP) Eos $(DSTDIR)/shell/$(OBJECTNAME)/*; \
+ echo "---- Perl/Tk file Installed"; \
+ fi
+
+install-shell:
+ @if [ ! -d $(DSTDIR)/shell/$(OBJECTNAME) ]; \
+ then \
+ mkdir $(DSTDIR)/shell/$(OBJECTNAME) ; \
+ fi
+ @if [ -d shell ]; \
+ then \
+ echo "---- Shell file Install"; \
+ if [ ! -d $(DSTDIR)/shell/$(OBJECTNAME) ]; \
+ then \
+ mkdir $(DSTDIR)/shell/$(OBJECTNAME) ; \
+ fi ; \
+ $(CP) -f shell/* $(DSTDIR)/shell/$(OBJECTNAME); \
+ $(CHMOD) 555 $(DSTDIR)/shell/$(OBJECTNAME)/*; \
- $(CHGRP) -R Eos $(OBJECTNAME); \
+ echo "---- Shell file Installed"; \
+ fi
+
+install-khoros:
+ @echo Installing to khoros
+ @if [ ! -d ../../../../../objects/script/$(OBJECTNAME) -a -f $(KHOROS_KGENOBJ) ]; \
+ then \
+ echo kgenobj;\
+ $(KHOROS_KGENOBJ) -tb Eos -oname $(OBJECTNAME) -type script -pane -cantata true -cat Eos -subcat $(CLASSNAME) -description $(OBJECTNAME) -bname $(OBJECTNAME) -form -lang ksh ; \
+ fi
+ @if [ ! -d ../../../../../objects/script/$(OBJECTNAME) -a -f $(KHOROS_KSET) ]; \
+ then \
+ $(KHOROS_KSET) -tb Eos -oname $(OBJECTNAME) -icon $(OBJECTNAME) ; \
+ fi
+ @if [ -d ../../../../../objects/script/$(OBJECTNAME) -a -f $(KHOROS_KSET) ]; \
+ then \
+ $(CHMOD) -R 775 ../../../../../objects/script/$(OBJECTNAME) ; \
+ if [ $? ] ; \
+ then \
+ echo "-- setting khoros ---" ; \
+ if [ -d ../../../../../objects/script/$(OBJECTNAME)/uis/ ] ; \
+ then \
+ $(CD) ../../../../../objects/script/$(OBJECTNAME)/uis/ ; \
+ $(RM) -f $(OBJECTNAME).pane ; \
+ $(LN) -s ../../../../src/Tools/$(CLASSNAME)/$(OBJECTNAME)/src/$(OBJECTNAME).pane $(OBJECTNAME).pane; \
+ $(CD) ../../ ; \
- $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) *.c > $(OSTYPE)/.Depend ; \
+ $(CHMOD) -R 555 $(OBJECTNAME); \
+ else \
+ echo "../../../../../objects/script/$(OBJECTNAME)/uis/ does not exist."; \
+ fi ; \
+ else \
+ echo "Failed !!: Cannot chage mode in installing $(OBJECTNAME) to khoros system"; \
+ fi ; \
+ echo "-- end of khoros-installing"; \
+ fi
+
+install-doc: html
+ @if [ ! -d $(DSTDOC)/SmallTools ]; \
+ then \
+ mkdir $(DSTDOC)/SmallTools ;\
+ fi
+ @if [ -f $(DSTDOC)/SmallTools/$(OBJECTNAME).html ]; \
+ then \
+ $(RM) -f $(DSTDOC)/SmallTools/$(OBJECTNAME).html ;\
+ fi
+ @$(CP) $(OBJECTNAME).html $(DSTDOC)/SmallTools/$(OBJECTNAME).html
+ @$(CHMOD) 444 $(DSTDOC)/SmallTools/$(OBJECTNAME).html
+ @if [ -f ../doc/*.html ]; \
+ then \
+ $(CP) ../doc/*.html $(DSTDOC)/SmallTools/ ;\
+ fi
+ @$(CHMOD) 444 $(DSTDOC)/SmallTools/$(OBJECTNAME).html
+ @if [ -f $(DSTDOC)/SmallTools/Makefile ]; \
+ then \
+ cd $(DSTDOC)/SmallTools; $(MAKE); \
+ fi
+
+html: $(OBJECTNAME).html
+
+configFileRead:
+ @ctrl2configFileRead $(CLASSNAME) $(OBJECTNAME) ../Config/OptionControlFile
+
+$(OBJECTNAME).html: $(OSTYPE)/$(OBJECTNAME)
+ @echo creating html
+ @$(OSTYPE)/$(OBJECTNAME) -html 2> $(OBJECTNAME).html.tmp
+ @sed -e s/$(OSTYPE)\\/// $(OBJECTNAME).html.tmp > $(OBJECTNAME).html
+ @$(RM) $(OBJECTNAME).html.tmp
+
+$(DSTDIR)/$(OBJECTNAME): $(OSTYPE)/$(OBJECTNAME)
+ @ln -s -f ../sbin/MachineIndependent $@
+
+depend::
+ @echo dependency checking now
+ @if [ ! -L $(OSTYPE) ] ; then \
+ moveHostdependent; \
+ fi
++ rm -f $(OSTYPE)/.Depend
+ #echo C
+ @if [ -f $(OBJECTNAME).c ] ; \
+ then \
+ echo "dependency: *.c"; \
+ echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) *.c ; \
- include $(OSTYPE)/.Depend
- include ../Config/Target.inc
++ $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) *.c >> $(OSTYPE)/.Depend ; \
+ fi
+ #echo CC
+ @if [ -f $(OBJECTNAME).cc ] ; \
+ then \
+ echo "dependency: *.cc"; \
+ echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cc ; \
+ $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cc >> $(OSTYPE)/.Depend ; \
+ fi
+ @if [ -f $(OBJECTNAME).ccm ] ; \
+ then \
+ echo "dependency: *.ccm"; \
+ echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.ccm ; \
+ $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.ccm >> $(OSTYPE)/.Depend ; \
+ fi
+ @if [ -f $(OBJECTNAME).cu ] ; \
+ then \
+ echo "dependency: *.cu"; \
+ echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cu ; \
+ $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cu >> $(OSTYPE)/.Depend ; \
+ fi
+
+update:../Config/OptionControlFile
+ maketool $(CLASSNAME) $(OBJECTNAME) update
+
+changeName::
+
+Test:$(OSTYPE)/$(OBJECTNAME) TestDir
+ @if [ -f test/Makefile ] ; \
+ then \
+ cd test; make ; \
+ else \
+ echo "No test Makefile"; \
+ fi
+
+TestDir::
+ @if [ ! -d test ] ; \
+ then \
+ echo "Creating test dir"; \
+ mkdir test; \
+ fi
+ @if [ ! -f test/Makefile ] ; \
+ then \
+ echo "Creating Makefile"; \
+ cd test; \
+ protoTestMakefileCreate; \
+ fi
+ @if [ ! -d test/data ]; \
+ then \
+ mkdir $(EOSHOME)/data/$(OBJECTNAME); \
+ cd test; \
+ ln -sf ../$(EOSHOME)/data/$(OBJECTNAME) data; \
+ fi
+
+tar::
+ cd $(DSTTAR); tar cvf Tools.$(CLASSNAME).$(OBJECTNAME).tar ../bin/$(OBJECTNAME) \
+ ../bin/*/$(OBJECTNAME).* \
+ ../src/Tools/$(CLASSNAME)/$(OBJECTNAME) \
+ ; gzip Tools.$(CLASSNAME).$(OBJECTNAME).tar
+
++-include $(OSTYPE)/.Depend
++-include ../Config/Target.inc
--- /dev/null
--- /dev/null
++../../../../../hostdepend/X86MAC64/src/Tools/rec3d/mrc2DFTto3DFT/src/X86MAC64
--- /dev/null
- argCheck(kayabukiInfo* info, int argc, char* argv[])
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "../inc/config.h"
+#include "genUtil.h"
+#include "String.h"
+#include "File.h"
+#include "Memory.h"
+
+
+void
- long i, j, nv;
++argCheck(mrc2DFTto3DFTInfo* info, int argc, char* argv[])
+{
- SCASE("n") {
- if(i+1<argc) {
- info->num = stringGetNthIntegerData(argv[i+1], 1, " ,");
- i++;
- info->flagnum++;
- } else {
- usage(argv[0]);
- exit(EXIT_FAILURE);
- }
- SBREAK;
- }
++ long i;
+ char s[1024];
+ FILE* fpt;
+
+ if(NULL==(fpt=fopen(".EosLog", "a+"))) {
+
+ } else {
+ for(i=0; i<argc; i++) {
+ fprintf(fpt, "%s ", argv[i]);
+ }
+ fprintf(fpt, "\n");
+ fclose(fpt);
+ }
+ for(i=1; i<argc; i++) {
+ if(OPTION_FLAG==argv[i][OPTION_FLAG_POS]) {
+ SSWITCH(argv[i]+OPTION_POS)
+ SCASE("i") {
+ if(i+1<argc) {
+ info->In = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagIn++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
++ SCASE("t3d") {
++ if(i+1<argc) {
++ info->temp3d = stringGetNthWord(argv[i+1], 1, " ,");
++ i++;
++ info->flagtemp3d++;
++ } else {
++ usage(argv[0]);
++ exit(EXIT_FAILURE);
++ }
++ SBREAK;
++ }
+ SCASE("o") {
+ if(i+1<argc) {
+ info->Out = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagOut++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("c") {
+ if(i+1<argc) {
+ info->configFile = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagconfigFile++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("m") {
+ if(i+1<argc) {
+ info->mode = stringGetNthIntegerData(argv[i+1], 1, " ,");
+ i++;
+ info->flagmode++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("h") {
+ usage(argv[0]);
+ exit(EXIT_SUCCESS);
+ break;
+ }
+ SCASE("html") {
+ htmlBeforeUsage(argv[0]);
+ usage(argv[0]);
+ htmlAfterUsage(argv[0]);
+ exit(EXIT_SUCCESS);
+ break;
+ }
+ SDEFAULT {
+ fprintf(stderr, "Not Supported Options: :%s\n", argv[i]);
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ break;
+ }
+ SSWITCHEND;
+ }
+ }
+}
--- /dev/null
- init0(hidac2010Info* info)
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "../inc/config.h"
+#include "genUtil.h"
+#include "String.h"
+#include "File.h"
+#include "Memory.h"
+
+
+void
- init1(hidac2010Info* info)
++init0(mrc2DFTto3DFTInfo* info)
+{
+ info->fptIn = NULL; info->flagIn = 0;
++ info->fpttemp3d = NULL; info->flagtemp3d = 0;
+ info->fptOut = NULL; info->flagOut = 0;
+ info->fptconfigFile = NULL; info->flagconfigFile = 0;
+ info->mode = 0; info->flagmode = 0;
+}
+
+void
- sprintf(panepath, "%s/src/Tools\/Test/hidac2010/src/hidac2010.pane", eospath);
++init1(mrc2DFTto3DFTInfo* info)
+{
+ char s[1024];
+ int i;
+ if(!info->flagIn) {
+ stringGetFromFile(s, "In", stdin, stdout, 0);
+ info->In = stringGetNthWord(s, 1, " ,\t");
+ info->flagIn++;
+ }
+ if(info->flagIn) {
+ info->fptIn = fileOpen(info->In, "r");
+ }
+
++ if(!info->flagtemp3d) {
++ stringGetFromFile(s, "temp3d", stdin, stdout, 0);
++ info->temp3d = stringGetNthWord(s, 1, " ,\t");
++ info->flagtemp3d++;
++ }
++ if(info->flagtemp3d) {
++ info->fpttemp3d = fileOpen(info->temp3d, "r");
++ }
++
+ if(!info->flagOut) {
+ stringGetFromFile(s, "Out", stdin, stdout, 0);
+ info->Out = stringGetNthWord(s, 1, " ,\t");
+ info->flagOut++;
+ }
+ if(info->flagOut) {
+ info->fptOut = fileOpen(info->Out, "w");
+ }
+
+ if(info->flagconfigFile) {
+ info->fptconfigFile = fileOpen(info->configFile, "r");
+ }
+
+ if(info->flagmode) {
+ }
+
+}
+#ifdef KHOROS
+#include <stdio.h>
+#include "bootstrap.h"
+#include "dataserv.h"
+#include "datamanip.h"
+extern void func_usage_additions(void);
+extern void func_free_args(kexit_status status, kaddr client_data);
+extern void func_get_args(kform* pane);
+
+void
+func_usage_additions(void)
+{
+}
+void
+func_free_args(kexit_status status, kaddr client_data)
+{
+}
+void
+func_get_args(kform* pane)
+{
+}
+void
+khorosInit(int argc, char* argv[])
+{
+ char* eospath;
+ char panepath[1024];
+ FILE* fpt;
+
+ eospath = getenv("EOS_HOME");
- kclui_initialize(panepath, KGEN_NONE, "EOS", "hidac2010",
++ sprintf(panepath, "%s/src/Tools/rec3d/mrc2DFTto3DFT/src/mrc2DFTto3DFT.pane", eospath);
+ khoros_initialize(argc, argv, "EOS");
+ fpt = fopen(panepath, "r"); if(NULL!=fpt) {
+ fclose(fpt);
++ kclui_initialize(panepath, KGEN_NONE, "EOS", "mrc2DFTto3DFT",
+ func_usage_additions,
+ func_get_args,
+ func_free_args);
+ }
+}
+#endif /* KHOROS */
--- /dev/null
--- /dev/null
++/*
++# mrc2DFTto3DFT : $Revision$
++# $Date$
++# Created by $Author$
++# Usage : mrc2DFTto3DFT
++# Attention
++# $Loccker$
++# $State$
++#
++*/
++#include <stdio.h>
++#include <stdlib.h>
++#include <time.h>
++#include <string.h>
++#include <math.h>
++#define GLOBAL_DECLARATION
++#include "../inc/config.h"
++
++#define DEBUG
++#include "genUtil.h"
++#include "lmrcFFTCentralSection.h"
++//#include "Class.h"
++
++/*
++Example:
++typedef struct lmrc2DFTto3DFTInfo {
++ float a;
++ int b;
++} lmrc2DFTto3DFTInfo;
++
++typedef enum lmrc2DFTto3DFTMode {
++ a=0,
++ b=1
++} lmrc2DFTto3DFTMode;
++*/
++
++int
++main(int argc, char* argv[])
++{
++ mrc2DFTto3DFTInfo info;
++ lmrcFFTCentralSectionInfo linfo;
++ char file2d[256], file3d[256], buf[256];
++ char filename[]="hogehoge";
++ double probability;
++ mrcImage temp3d, in ,count;
++ mrcImage* Inlist;
++ mrcImage Out;
++ int num,ref,i=0;
++ int size;
++ clock_t start,end;
++ FILE* fp;
++
++
++ start = clock();
++
++ init0(&info);
++ argCheck(&info, argc, argv);
++ init1(&info);
++ DEBUGPRINT("Program Start\n");
++
++ mrcFileRead(&temp3d, info.temp3d, "in main", 0);
++ // mrcFileRead(&Out, info.In3D, "in main", 0);
++
++ int c=0;
++ linfo.TransX = 0.0;
++ linfo.TransY = 0.0;
++ linfo.InterpMode = 1.0;
++
++ Out.Header = temp3d.Header;
++ count.Header = temp3d.Header;
++ mrcInit(&Out, NULL);
++ mrcInit(&count, NULL);
++
++ while(fgets(buf, 256, info.fptIn) != NULL){
++ size ++;
++ }
++ rewind(info.fptIn);
++
++ Inlist = malloc(sizeof(mrcImage)*size);
++ if(Inlist ==NULL){
++ printf("malloc error\n");
++ }
++ num =0;
++ while(fscanf(info.fptIn,"%s %s %lf %lf %lf %s %d %lf",file2d, linfo.EulerMode, &linfo.Rot1, &linfo.Rot2, &linfo.Rot3, file3d, &num, &probability) != EOF){
++ if((ref=strcmp(filename,file2d))!= 0){
++ // DEBUGPRINT1("Num %d\n", i);
++ mrcFileRead(&Inlist[i], file2d, "in main", 0);
++ strcpy(filename,file2d);
++// DEBUGPRINT2("filename %s %s\n",filename, file2d);
++ i++;
++ }
++ num =i-1;
++ // DEBUGPRINT1("Num %d\n", i);
++ // DEBUGPRINT2("in Header: %d %d \n", Inlist[num].HeaderN.x, Inlist[num].HeaderN.y)
++ lmrcImageFFTCentralSectionPut(&Out, &count, &temp3d, &Inlist[i-1], probability, &linfo, &c, info.mode);
++ }
++ lmrcImageFFTRhoFilter(&Out, &count, &linfo, info.mode);
++ mrcFileWrite(&Out, info.Out, "in main", 0);
++ free(Inlist);
++ end = clock();
++ DEBUGPRINT1("time %f\n",(double)(end-start)/CLOCKS_PER_SEC);
++ exit(EXIT_SUCCESS);
++}
++
++void
++additionalUsage()
++{
++ fprintf(stderr, "----- Additional Usage -----\n");
++}
--- /dev/null
--- /dev/null
++<HTML>
++<HEAD>
++<TITLE>mrc2DFTto3DFT</TITLE>
++</HEAD>
++<BODY>
++<H1>mrc2DFTto3DFT</H1>
++<H2>Usage</H2>
++<PRE>
++Usage: mrc2DFTto3DFT
++Options:
++ [-i[nput] In (NULL ).as(inFile ) ] :Essential :InputDataFile
++ [-t[emplate]3d temp3d (NULL ).as(inFile::mrcImage ) ] :Essential :Input: mrcFFT(3D)
++ [-o[utput] Out (NULL ).as(outFile::mrcImage ) ] :Essential :Output
++ [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile
++ [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode
++----- Additional Usage -----
++</PRE>
++</BODY>
++</HTML>
--- /dev/null
--- /dev/null
++-F 4.3 1 0 52x1+0+0 +0+0 'Cantata' cantata
++ -M 1 1 52x1+0+0 +1+0 ' ' subform
++ -P 1 0 52x1+0+1 +0+0 ' ' mrc2DFTto3DFT
++ -D 1 0 9x1+0+0 'Options' _gui_options
++ -H 1 6x1+0+0 'License' 'license' $BOOTSTRAP/repos/license/License license
++ -E
++ -R 1 0 1 5x1+35+0 'Run' 'execute operation' $EOS/bin/mrc2DFTto3DFT
++ -H 1 5x1+41+0 'Help' 'help page' $EOS/src/Tools/rec3d/mrc2DFTto3DFT/doc/mrc2DFTto3DFT.doc help
++ -Q 1 0 5.25x1+47+0 'Close'
++ -I 1 0 1 1 0 1 -1x1+1+1.500000 ' ' 'In' 'InputDataFile' i
++ -I 1 0 1 1 0 1 -1x1+1+3.000000 ' ' 'temp3d' 'Input: mrcFFT(3D)' t3d
++ -O 1 0 1 1 0 1 -1x1+1+4.500000 ' ' 'Out' 'Output' o
++ -I 1 0 1 0 0 1 -1x1+1+6.000000 ' ' 'configFile' 'ConfigurationFile' c
++ -i 1 0 1 0 0 -1x1+1+7.500000 0 0 0 0 0 'mode' 'Mode' m
++ -E
++ -E
++-E
--- /dev/null
--- /dev/null
++include ../../Config/Define.inc
++include ../../../Config/Define.inc
++include ../../../../Config/Define.inc
++include ../../../../../Config/Define.inc
++
++all: help exec
++
++help:
++ @echo "----- Help Message Check -----"
++ @../$(OSTYPE)/$(OBJECTNAME) -h
++
++exec:
++ @echo "----- Execution Check -----"
++ ../$(OSTYPE)/$(OBJECTNAME) -i /Users/nakanosaki/Eos/src/Tools/mrcImage/mrcMultiFFTCentralSectionsCompare/src/test/Test3dlidt.txt -t3d data/121p.fft3d -o TestOutdata.3d
++ @echo "----- Calc check -----"
++
++init:
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.10.mrc2d -Rot1 30 30 10 -Rot2 0 0 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.11.mrc2d -Rot1 45 45 10 -Rot2 0 0 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.12.mrc2d -Rot1 60 60 10 -Rot2 0 0 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.14.mrc2d -Rot1 120 120 10 -Rot2 0 0 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.15.mrc2d -Rot1 150 150 10 -Rot2 0 0 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.20.mrc2d -Rot1 0 0 10 -Rot2 30 30 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.21.mrc2d -Rot1 0 0 10 -Rot2 45 45 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.23.mrc2d -Rot1 0 0 10 -Rot2 90 90 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.24.mrc2d -Rot1 0 0 10 -Rot2 120 120 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.25.mrc2d -Rot1 0 0 10 -Rot2 150 150 10 -Rot3 0 0 10 -EulerMode YOYS -InterpolationMode 1
++
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.30.mrc2d -Rot1 0 0 10 -Rot2 0 0 10 -Rot3 30 30 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.32.mrc2d -Rot1 0 0 10 -Rot2 0 0 10 -Rot3 60 60 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.33.mrc2d -Rot1 0 0 10 -Rot2 0 0 10 -Rot3 90 90 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.34.mrc2d -Rot1 0 0 10 -Rot2 0 0 10 -Rot3 120 120 10 -EulerMode YOYS -InterpolationMode 1
++ mrc3Dto2D -i data/121p.mrc3d -o data/121p.35.mrc2d -Rot1 0 0 10 -Rot2 0 0 10 -Rot3 150 150 10 -EulerMode YOYS -InterpolationMode 1
++
++ mrcImageFFT -i data/121p.10.mrc2d -o data/121p.10.fft2d
++ mrcImageFFT -i data/121p.11.mrc2d -o data/121p.11.fft2d
++ mrcImageFFT -i data/121p.12.mrc2d -o data/121p.12.fft2d
++ mrcImageFFT -i data/121p.14.mrc2d -o data/121p.14.fft2d
++ mrcImageFFT -i data/121p.15.mrc2d -o data/121p.15.fft2d
++ mrcImageFFT -i data/121p.20.mrc2d -o data/121p.20.fft2d
++ mrcImageFFT -i data/121p.21.mrc2d -o data/121p.21.fft2d
++ mrcImageFFT -i data/121p.23.mrc2d -o data/121p.23.fft2d
++ mrcImageFFT -i data/121p.24.mrc2d -o data/121p.24.fft2d
++ mrcImageFFT -i data/121p.25.mrc2d -o data/121p.25.fft2d
++ mrcImageFFT -i data/121p.30.mrc2d -o data/121p.30.fft2d
++ mrcImageFFT -i data/121p.32.mrc2d -o data/121p.32.fft2d
++ mrcImageFFT -i data/121p.33.mrc2d -o data/121p.33.fft2d
++ mrcImageFFT -i data/121p.34.mrc2d -o data/121p.34.fft2d
++ mrcImageFFT -i data/121p.35.mrc2d -o data/121p.45.fft2d
++clean:
--- /dev/null
--- /dev/null
++../../../../../..//data/mrc2DFTto3DFT
--- /dev/null
- fprintf(stderr, " [-i[nput] In (NULL )] :Optional :InputDataFile\n");
- fprintf(stderr, " [-o[utput] Out (NULL )] :Optional :OutputDataFile\n");
- fprintf(stderr, " [-c[onfig] configFile (NULL )] :Optional :ConfigurationFile\n");
- fprintf(stderr, " [-m[ode] mode (0 )] :Optional :Mode\n");
- fprintf(stderr, " [-n[umber] number (0 )] :Optional :Number\n");
+#include <stdio.h>
+#include <stdlib.h>
+#include "../inc/config.h"
+
+void
+usage(char* thisProgram)
+{
+ fprintf(stderr, "Usage: %s\n", thisProgram);
+ fprintf(stderr, "Options:\n");
++ fprintf(stderr, " [-i[nput] In (NULL ).as(inFile ) ] :Essential :InputDataFile\n");
++ fprintf(stderr, " [-t[emplate]3d temp3d (NULL ).as(inFile::mrcImage ) ] :Essential :Input: mrcFFT(3D)\n");
++ fprintf(stderr, " [-o[utput] Out (NULL ).as(outFile::mrcImage ) ] :Essential :Output\n");
++ fprintf(stderr, " [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile\n");
++ fprintf(stderr, " [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode\n");
+ additionalUsage();
+}
+
+void
+htmlBeforeUsage(char* thisProgram)
+{
+ fprintf(stderr, "<HTML>\n");
+ fprintf(stderr, "<HEAD>\n");
+ fprintf(stderr, "<TITLE>%s</TITLE>\n", thisProgram);
+ fprintf(stderr, "</HEAD>\n");
+ fprintf(stderr, "<BODY>\n");
+ fprintf(stderr, "<H1>%s</H1>\n", thisProgram);
+ fprintf(stderr, "<H2>Usage</H2>\n");
+ fprintf(stderr, "<PRE>\n");
+}
+
+void
+htmlAfterUsage(char* thisProgram)
+{
+ fprintf(stderr, "</PRE>\n");
+ fprintf(stderr, "</BODY>\n");
+ fprintf(stderr, "</HTML>\n");
+}