--- /dev/null
+../sbin/MachineIndependent
\ No newline at end of file
-Subproject commit 3945d5ca7a6d2264f89d912e6bfe1ec82046d1b4
+Subproject commit 2cbaa2f6559d92addc0ff7492082e5fd5e7f20be
int* data;
} intVector;
+typedef struct doubleVector {
+ unsigned long size;
+ double* data;
+} doubleVector;
+
/* struct end */
-/* prototype begin */
extern floatVector* floatVectorInit(floatVector* v, long size);
extern floatVector* floatVectorFree(floatVector* v);
extern void lVectorSpline2D(double t, double* px, double* py,
floatVector* p, floatVector* x, floatVector* y,
floatVector* a, floatVector* b);
-/* prototype end */
-
-/* struct begin */
-typedef struct doubleVector {
- unsigned long size;
- double* data;
-} doubleVector;
-/* struct end */
-/* prototype begin */
extern doubleVector* doubleVectorInit(doubleVector* v, long size);
extern doubleVector* doubleVectorFree(doubleVector* v);
extern doubleVector* doubleVectorAdd(doubleVector* v, doubleVector* u, doubleVector* w);
#
*/
/* $Log$ */
-#ifndef EOS_MATH_H
-#define EOS_MATH_H
+#ifndef EOS_MATH_H
+#define EOS_MATH_H
#include <stdio.h>
#endif
/* prototype begin */
-
-extern void eosMathSorting(double* v, int n);
-extern double eosMathMedian(double* v, int n);
-extern double eosMathAverage(double* v, int n);
-extern double eosMathWeightedAverage(double* v, int n);
-extern double eosMathStdDev(double* v, double avg, int n);
-extern double eosMathMedianAbsoluteDeviation(double* v, double median, int n);
-extern double eosMathMedianAbsoluteDeviationNormal(double* v, double median, int n);
-extern double eosMathInterquantileRange(double* v, int n);
-extern double eosMathInterquantileRangeNormal(double* v, int n);
-extern double* eosMathTrimming(double** vv, int* nn, double* v, int n, double trim);
-extern double eosMathTrimmedAverage(double* v, int n, double trim);
-extern double eosMathHodgesLehmannEstimator(double* v, int n);
+double eosBeseel_I(double x, int n);
/* prototype end */
};
#endif
-#endif /* EOS_MATH_H */
+#endif /* XXXX */
--- /dev/null
+/*
+# eosNonLinearFitting.h : $Revision$
+# $Date$
+# Created by $Author$
+# Usage : eosNonLinearFitting.h
+# Attention
+# $Loccker$
+# $State$
+#
+*/
+/* $Log$ */
+#ifndef EOS_NON_LINEAR_FITTING_H
+#define EOS_NON_LINEAR_FITTING_H
+
+#include <stdio.h>
+#include <gsl/gsl_randist.h>
+#include <gsl/gsl_matrix.h>
+#include <gsl/gsl_vector.h>
+#include <gsl/gsl_blas.h>
+#include <gsl/gsl_multifit_nlinear.h>
+
+/* constant begin */
+typedef enum eosNonLinearFittingMode {
+ eosNonLinearFittingModeSingleExpDecay = 0
+} eosNonLinearFittingMode;
+
+/* constant end */
+
+/* struct begin */
+typedef struct eosNonLinearFittingParams {
+ /* Input */
+ size_t maxIter;
+ double xtol;
+ double gtol;
+ double ftol;
+
+ //
+ char** message;
+
+ /* Output */
+ size_t numOfp;
+ char* method;
+ char* iterationStopReason;
+ int iter;
+ double functionEvaluations;
+ double JacobianEvaluations;
+ double initialChisq;
+ double finalChisq;
+ char* reason;
+ char* status;
+ double c;
+ double degreeOfFreedom;
+ double chisq_per_degreeOfFreedom;
+
+ /* exp */
+ /* y = A* exp (K* x) + B */
+ // In
+ double Ainit;
+ double Kinit;
+ double Binit;
+ double High;
+ double Low;
+
+ // Out
+ double A;
+ double sigA;
+ double K;
+ double sigK;
+ double B;
+ double sigB;
+} eosNonLinearFittingParams;
+
+/*
+summary from method 'trust-region/levenberg-marquardt'
+number of iterations: 11
+function evaluations: 16
+Jacobian evaluations: 12
+reason for stopping: small gradient
+initial |f(x)| = 88.444756
+final |f(x)| = 10.477801
+chisq/dof = 1.1318
+A = 4.79653 +/- 0.18704
+lambda = 1.43937 +/- 0.07390
+b = 1.00368 +/- 0.03473
+status = success
+
+*/
+
+/* struct end */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* prototype begin */
+
+extern int
+eosNonLinearFitting(eosNonLinearFittingParams* out, double* t, double* y, double* sigy, int n, int mode);
+
+
+/* prototype end */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* XXXX */
lmrcImageNormalizingModeUsingContourWithSolventFlattening=3,
lmrcImageNormalizingModeNoEstimation=4,
lmrcImageNormalizingModeAssumeGaussian=5,
- lmrcImageNormalizingModeMin75percent=6
+ lmrcImageNormalizingModeMin75percent=6,
+ lmrcImageNormalizingModeUsingLowValueAreaToHighValueArea=7
} lmrcImageNormalizingMode ;
typedef struct lmrcImageNormalizingInfo {
lmrcImageNormalizingParaTypeReal ContourMin;
lmrcImageNormalizingParaTypeReal ContourMax;
lmrcImageNormalizingParaTypeReal ContourSolvent;
+ lmrcImageNormalizingParaTypeReal thresOfLowValueArea;
+ lmrcImageNormalizingParaTypeReal thresOfHighValueArea;
lmrcImageNormalizingMode Mode;
} lmrcImageNormalizingInfo;
/* struct end */
RMSofAllPixels = 7,
sdOfAllAxis = 8,
meanOfHighValueArea = 9,
- meanOfLowValueArea = 10
+ meanOfLowValueArea = 10,
+ meanOfLowValueAreaAndHighValueArea = 11
} mrcImageInformationMode;
/*
AR = /usr/bin/ar
-SHARED = gcc --std=gnu99 -shared -L$(EOS_HOME)/lib/$(OSTYPE)/ -lEosObjects -L$(EOS_HOME)/util/$(OSTYPE)/lib/ruby/1.9.1/x86_64-darwin13.2.0 -o
+#SHARED = gcc --std=gnu99 -shared -L$(EOS_HOME)/lib/$(OSTYPE)/ -lEosObjects -L$(EOS_HOME)/util/$(OSTYPE)/lib/ruby/1.9.1/x86_64-darwin13.2.0 -o
+SHARED = libtool -dynamic -noall_load -o
RM = /bin/rm
OBJECTNAME = eosMATH
EXTRA_INC =
-EXTRA_CCOPTS =
+EXTRA_CCOPTS =
#endif
/* prototype begin */
-double eosBeseel_I(double x, int n);
+extern double eosBeseel_I(double x, int n);
/* prototype end */
CHeader = \
+eosNonLinearFitting.h \
nr2.h \
--- /dev/null
+/*
+# %M% %Y% %I%
+# The latest update : %G% at %U%
+#
+#%Z% eosNonLinearFitting ver %I%
+#%Z% Created by
+#%Z%
+#%Z% Usage : eosNonLinearFitting
+#%Z% Attention
+#%Z%
+*/
+static char __sccs_id[] = "%Z%eosNonLinearFitting ver%I%; Date:%D% %Z%";
+#define DEBUG
+#include "genUtil.h"
+#include "Vector.h"
+#include "./eosNonLinearFitting.h"
+
+struct data {
+ size_t n;
+ double* t;
+ double* y;
+};
+
+static int
+_expb_f(const gsl_vector * x, void *data, gsl_vector * f)
+{
+ size_t n = ((struct data *)data)->n;
+ double* t = ((struct data *)data)->t;
+ double* y = ((struct data *)data)->y;
+ double Yi;
+
+ double A = gsl_vector_get (x, 0);
+ double K = gsl_vector_get (x, 1);
+ double B = gsl_vector_get (x, 2);
+
+ size_t i;
+
+ for (i = 0; i < n; i++) {
+ /* Model Yi = A * exp(-K * t_i) + B */
+ Yi = A * exp (- K * t[i]) + B;
+ gsl_vector_set (f, i, Yi - y[i]); // f: difference
+ //DEBUGPRINT5("%zu %f %f %f %f\n", i, t[i], y[i], Yi, Yi-y[i]);
+ }
+
+ return GSL_SUCCESS;
+}
+
+static int
+_expb_df(const gsl_vector * x, void *data, gsl_matrix * J)
+{
+ size_t n = ((struct data *)data)->n;
+ double *t = ((struct data *)data)->t;
+
+ double A = gsl_vector_get (x, 0);
+ double K = gsl_vector_get (x, 1);
+ double B = gsl_vector_get (x, 2);
+
+ size_t i;
+
+ for (i = 0; i < n; i++) {
+ /* Jacobian matrix J(i,j) = dfi / dxj, */
+ /* where fi = (Yi - yi)/sigma[i], */
+ /* Yi = A * exp(-lambda * t_i) + b */
+ /* and the xj are the parameters (A,K,B) */
+ double e = exp( - K * t[i]);
+ gsl_matrix_set (J, i, 0, e); // df/dA
+ gsl_matrix_set (J, i, 1, - t[i] * A * e); // df/dK
+ gsl_matrix_set (J, i, 2, 1.0); // df/dB
+ //DEBUGPRINT5("%zu %f %f %f %f\n", i, t[i], e, - t[i] * A * e, 1.0);
+ }
+
+ return GSL_SUCCESS;
+}
+
+static void
+_callback(const size_t iter, void *params,
+ const gsl_multifit_nlinear_workspace *w)
+{
+ gsl_vector *f = gsl_multifit_nlinear_residual(w);
+ gsl_vector *x = gsl_multifit_nlinear_position(w);
+ double rcond;
+ char stmp[1024];
+
+ /* compute reciprocal condition number of J(x) */
+ gsl_multifit_nlinear_rcond(&rcond, w);
+ //
+ eosNonLinearFittingParams* param;
+ param = (eosNonLinearFittingParams*)params;
+
+ if(0!=rcond) {
+ sprintf(stmp, "iter %2zu: A = %.4f, K = %.4f, B = %.4f, cond(J) = %8.4f, |f(x)| = %.4f",
+ iter,
+ gsl_vector_get(x, 0),
+ gsl_vector_get(x, 1),
+ gsl_vector_get(x, 2),
+ 1.0 / rcond,
+ gsl_blas_dnrm2(f));
+
+ DEBUGPRINT6("iter %2zu: A = %.4f, K = %.4f, B = %.4f, cond(J) = %8.4f, |f(x)| = %.4f\n",
+ iter,
+ gsl_vector_get(x, 0),
+ gsl_vector_get(x, 1),
+ gsl_vector_get(x, 2),
+ 1.0 / rcond,
+ gsl_blas_dnrm2(f));
+ } else {
+ sprintf(stmp, "iter %2zu: A = %.4f, K = %.4f, B = %.4f, cond(J) = %8.4f, |f(x)| = %.4f",
+ iter,
+ gsl_vector_get(x, 0),
+ gsl_vector_get(x, 1),
+ gsl_vector_get(x, 2),
+ 0.0,
+ gsl_blas_dnrm2(f));
+
+ DEBUGPRINT6("iter %2zu: A = %.4f, K = %.4f, B = %.4f, cond(J) = %8.4f, |f(x)| = %.4f\n",
+ iter,
+ gsl_vector_get(x, 0),
+ gsl_vector_get(x, 1),
+ gsl_vector_get(x, 2),
+ 0.0,
+ gsl_blas_dnrm2(f));
+ }
+
+ param->message[iter] = strdup(stmp);
+}
+
+
+int
+eosNonLinearFitting(eosNonLinearFittingParams* out, double* t, double* y, double* sigy, int n, int mode)
+{
+ // data
+ double* weights;
+ struct data d;
+ d.n = n;
+ d.t = (double*)malloc(sizeof(double)*n);
+ d.y = (double*)malloc(sizeof(double)*n);
+ weights = (double*)malloc(sizeof(double)*n);
+ gsl_vector_view wts = gsl_vector_view_array(weights, n);
+
+ double* x_init;
+ size_t maxIter = out->maxIter;
+ double xtol = out->xtol;
+ double gtol = out->gtol;
+ double ftol = out->ftol;
+
+
+ char s[1024];
+ gsl_vector *f;
+ gsl_matrix *J;
+ int status, info;
+ size_t i;
+
+ for(i=0; i<n; i++) {
+ d.t[i] = t[i];
+ d.y[i] = y[i];
+ //weights[i] = sigy[i];
+ weights[i] = 1.0;
+ }
+
+ //
+ const gsl_multifit_nlinear_type *T = gsl_multifit_nlinear_trust;
+ gsl_multifit_nlinear_workspace *w;
+ gsl_multifit_nlinear_fdf fdf;
+ gsl_multifit_nlinear_parameters fdf_params = gsl_multifit_nlinear_default_parameters();
+
+ // depending upon n, p
+ gsl_matrix* covar;
+ gsl_vector_view x;
+
+ // p
+ size_t p;
+
+ // function
+ out->message = (char**)malloc(sizeof(char*)*(maxIter+1));
+ for(i=0; i<=maxIter; i++) {
+ out->message[i] = NULL;
+ }
+ switch(mode) {
+ case eosNonLinearFittingModeSingleExpDecay: {
+ out->numOfp = p = 3;
+ fdf.f = _expb_f;
+ fdf.df = _expb_df;
+ fdf.fvv = NULL; // Not using geodesic acceleration
+ fdf.n = n;
+ fdf.p = p;
+ fdf.params = &d;
+ x_init = (double*)malloc(sizeof(double)*p);
+ x_init[0] = out->Ainit;
+ x_init[1] = out->Kinit;
+ x_init[2] = out->Binit;
+
+ break;
+ }
+ default: {
+ fprintf(stderr, "Not supported mode: %d in eosNonLinearFitting\n", mode);
+ exit(EXIT_FAILURE);
+ break;
+ }
+ }
+ covar = gsl_matrix_alloc (p, p);
+ x = gsl_vector_view_array (x_init, p);
+
+ /* allocate workspace with default parameters */
+ w = gsl_multifit_nlinear_alloc(T, &fdf_params, n, p);
+
+ /* initialize solver with starting point and weights */
+ gsl_multifit_nlinear_winit (&x.vector, &wts.vector, &fdf, w);
+
+ /* compute initial cost function */
+ f = gsl_multifit_nlinear_residual(w);
+ gsl_blas_ddot(f, f, &out->initialChisq); //
+
+ /* solve the system with a maximum of 100 iterations */
+ DEBUGPRINT("Start gsl_multifit_nlinear_driver\n");
+ status = gsl_multifit_nlinear_driver(maxIter, xtol, gtol, ftol,
+ _callback, out, &info, w);
+
+ /* compute covariance of best fit parameters */
+ DEBUGPRINT("Start gsl_multifit_nlinear_jac\n");
+ J = gsl_multifit_nlinear_jac(w);
+ gsl_multifit_nlinear_covar (J, 0.0, covar);
+
+ /* compute final cost */
+ gsl_blas_ddot(f, f, &out->finalChisq); //
+
+ //
+ sprintf(s, "%s/%s", gsl_multifit_nlinear_name(w), gsl_multifit_nlinear_trs_name(w));
+ out->method = strdup(s);
+ out->iter = gsl_multifit_nlinear_niter(w);
+ out->functionEvaluations = fdf.nevalf;
+ out->JacobianEvaluations = fdf.nevaldf;
+ out->reason = strdup((info == 1) ? "small step size" : "small gradient");
+ out->status = strdup(gsl_strerror(status));
+ out->degreeOfFreedom = n-p;
+ out->c = GSL_MAX_DBL(1,sqrt(out->finalChisq/out->degreeOfFreedom));
+ out->chisq_per_degreeOfFreedom = out->finalChisq/out->degreeOfFreedom;
+
+ switch(mode) {
+ case eosNonLinearFittingModeSingleExpDecay: {
+ out->A = gsl_vector_get(w->x, 0);
+ out->sigA = sqrt(gsl_matrix_get(covar, 0, 0));
+ out->K = gsl_vector_get(w->x, 1);
+ out->sigK = sqrt(gsl_matrix_get(covar, 1, 1));
+ out->B = gsl_vector_get(w->x, 2);
+ out->sigB = sqrt(gsl_matrix_get(covar, 2, 2));
+ break;
+ }
+ default: {
+ fprintf(stderr, "Not supported mode: %d in eosNonLinearFitting\n", mode);
+ exit(EXIT_FAILURE);
+ break;
+ }
+ }
+
+ gsl_multifit_nlinear_free (w);
+ gsl_matrix_free (covar);
+
+ return status;
+}
+
+
--- /dev/null
+/*
+# eosNonLinearFitting.h : $Revision$
+# $Date$
+# Created by $Author$
+# Usage : eosNonLinearFitting.h
+# Attention
+# $Loccker$
+# $State$
+#
+*/
+/* $Log$ */
+#ifndef EOS_NON_LINEAR_FITTING_H
+#define EOS_NON_LINEAR_FITTING_H
+
+#include <stdio.h>
+#include <gsl/gsl_randist.h>
+#include <gsl/gsl_matrix.h>
+#include <gsl/gsl_vector.h>
+#include <gsl/gsl_blas.h>
+#include <gsl/gsl_multifit_nlinear.h>
+
+/* constant begin */
+typedef enum eosNonLinearFittingMode {
+ eosNonLinearFittingModeSingleExpDecay = 0
+} eosNonLinearFittingMode;
+
+/* constant end */
+
+/* struct begin */
+typedef struct eosNonLinearFittingParams {
+ /* Input */
+ size_t maxIter;
+ double xtol;
+ double gtol;
+ double ftol;
+
+ //
+ char** message;
+
+ /* Output */
+ size_t numOfp;
+ char* method;
+ char* iterationStopReason;
+ int iter;
+ double functionEvaluations;
+ double JacobianEvaluations;
+ double initialChisq;
+ double finalChisq;
+ char* reason;
+ char* status;
+ double c;
+ double degreeOfFreedom;
+ double chisq_per_degreeOfFreedom;
+
+ /* exp */
+ /* y = A* exp (K* x) + B */
+ // In
+ double Ainit;
+ double Kinit;
+ double Binit;
+ double High;
+ double Low;
+
+ // Out
+ double A;
+ double sigA;
+ double K;
+ double sigK;
+ double B;
+ double sigB;
+} eosNonLinearFittingParams;
+
+/*
+summary from method 'trust-region/levenberg-marquardt'
+number of iterations: 11
+function evaluations: 16
+Jacobian evaluations: 12
+reason for stopping: small gradient
+initial |f(x)| = 88.444756
+final |f(x)| = 10.477801
+chisq/dof = 1.1318
+A = 4.79653 +/- 0.18704
+lambda = 1.43937 +/- 0.07390
+b = 1.00368 +/- 0.03473
+status = success
+
+*/
+
+/* struct end */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* prototype begin */
+
+extern int
+eosNonLinearFitting(eosNonLinearFittingParams* out, double* t, double* y, double* sigy, int n, int mode);
+
+
+/* prototype end */
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* XXXX */
RMSofAllPixels = 7,
sdOfAllAxis = 8,
meanOfHighValueArea = 9,
- meanOfLowValueArea = 10
+ meanOfLowValueArea = 10,
+ meanOfLowValueAreaAndHighValueArea = 11
} mrcImageInformationMode;
/*
RMSofAllPixels = 7,
sdOfAllAxis = 8,
meanOfHighValueArea = 9,
- meanOfLowValueArea = 10
+ meanOfLowValueArea = 10,
+ meanOfLowValueAreaAndHighValueArea = 11
} mrcImageInformationMode;
/*
#include <stdio.h>
static char __sccs_id[] = "%Z%lmrcImageNormalizing ver%I%; Date:%D% %Z%";
-#undef DEBUG
+#define DEBUG
#include "genUtil.h"
#include "mrcImage.h"
#include "nr2.h"
fprintf(fpt, " data = A*Normalized(data) + B , where normalized means (average=0, SD=1)\n");
fprintf(fpt, "%3d: Min-75percent: Background and Object(75)\n", lmrcImageNormalizingModeMin75percent);
fprintf(fpt, " data = A*(data-Min)/(75percent-Min)x0.75 + B \n");
+ fprintf(fpt, "%3d: LowValueArea to HighValueArea: \n", lmrcImageNormalizingModeUsingLowValueAreaToHighValueArea);
+ fprintf(fpt, " data = A*(data-MeanOfLowValueArea)/(meanOfHighValue-meanOfLowValueArea) + B, using LowValueArea and HighValueArea\n");
}
void
}
break;
}
+ case lmrcImageNormalizingModeUsingLowValueAreaToHighValueArea: {
+ mrcImageInformation imageInfo;
+ imageInfo.mode = meanOfLowValueAreaAndHighValueArea;
+ imageInfo.thresHigh = linfo->thresOfHighValueArea;
+ imageInfo.thresLow = linfo->thresOfLowValueArea;
+ lmrcImageInformation(&imageInfo, in);
+ DEBUGPRINT2("LowArea %f HighArea %f\n", imageInfo.meanOfLowValueArea, imageInfo.meanOfHighValueArea);
+ for(x=0; x<in->HeaderN.x; x++) {
+ for(y=0; y<in->HeaderN.y; y++) {
+ for(z=0; z<in->HeaderN.z; z++) {
+ mrcPixelDataGet(in, x, y, z, &data, mrcPixelRePart, mrcPixelHowNearest);
+ data = linfo->A*(data-imageInfo.meanOfLowValueArea)/(imageInfo.meanOfHighValueArea - imageInfo.meanOfLowValueArea) + linfo->B;
+ mrcPixelDataSet(out, x, y, z, data, mrcPixelRePart);
+ }
+ }
+ }
+ break;
+ }
default: {
fprintf(stderr, "Not supported Mode: %d\n", linfo->Mode);
exit(EXIT_FAILURE);
lmrcImageNormalizingModeUsingContourWithSolventFlattening=3,
lmrcImageNormalizingModeNoEstimation=4,
lmrcImageNormalizingModeAssumeGaussian=5,
- lmrcImageNormalizingModeMin75percent=6
+ lmrcImageNormalizingModeMin75percent=6,
+ lmrcImageNormalizingModeUsingLowValueAreaToHighValueArea=7
} lmrcImageNormalizingMode ;
typedef struct lmrcImageNormalizingInfo {
lmrcImageNormalizingParaTypeReal ContourMin;
lmrcImageNormalizingParaTypeReal ContourMax;
lmrcImageNormalizingParaTypeReal ContourSolvent;
+ lmrcImageNormalizingParaTypeReal thresOfLowValueArea;
+ lmrcImageNormalizingParaTypeReal thresOfHighValueArea;
lmrcImageNormalizingMode Mode;
} lmrcImageNormalizingInfo;
/* struct end */
med = thres/2.0;
sort = (double*)memoryAllocate(sizeof(double)*N, "in mrcImageInfo");
lmrcImagePixelValueSort(sort, img, 0);
- info->thresOfHighValueArea = sort[thres];
- info->maxOfHighValueArea = sort[thres];
- info->minOfHighValueArea = sort[0];
- info->medianOfHighValueArea = sort[med];
+ info->thresOfLowValueArea = sort[thres];
+ info->maxOfLowValueArea = sort[thres];
+ info->minOfLowValueArea = sort[0];
+ info->medianOfLowValueArea = sort[med];
n = 0;
- //DEBUGPRINT2("thresHigh %f %f\n", info->thresLow, sort[thres]);
+ //DEBUGPRINT2("thresLow %f %f\n", info->thresLow, sort[thres]);
//DEBUGPRINT6("N %d thres %d med %d %f %f %f \n", N, thres, med, sort[thres], sort[med], sort[N-1]);
sum = 0;
for(i=0; i<thres; i++) {
info->seOfLowValueArea = sqrt(sum/n)/sqrt(n);
break;
}
+ case meanOfLowValueAreaAndHighValueArea: {
+ int N, i, thres, med;
+ double* sort;
+ double sum, n;
+
+ //
+ N = img->HeaderN.x*img->HeaderN.y*img->HeaderN.z;
+ sort = (double*)memoryAllocate(sizeof(double)*N, "in mrcImageInfo");
+ lmrcImagePixelValueSort(sort, img, 0);
+
+ // Low
+ thres = N*info->thresLow;
+ med = thres/2.0;
+ info->thresOfLowValueArea = sort[thres];
+ info->maxOfLowValueArea = sort[thres];
+ info->minOfLowValueArea = sort[0];
+ info->medianOfLowValueArea = sort[med];
+ n = 0;
+ DEBUGPRINT2("thresLow %f %f\n", info->thresLow, sort[thres]);
+ DEBUGPRINT6("N %d thres %d med %d %f %f %f \n", N, thres, med, sort[thres], sort[med], sort[0]);
+ sum = 0;
+ for(i=0; i<thres; i++) {
+ sum += sort[i];
+ n++;
+ }
+ info->meanOfLowValueArea = sum/n;
+
+ sum = 0;
+ for(i=0; i<thres; i++) {
+ sum += SQR( sort[i] - info->meanOfLowValueArea);
+ }
+ info->sdOfLowValueArea = sqrt(sum/n);
+ info->seOfLowValueArea = sqrt(sum/n)/sqrt(n);
+
+
+ // High
+ thres = N*info->thresHigh;
+ med = (N-1 + thres)/2.0;
+ info->thresOfHighValueArea = sort[thres];
+ info->minOfHighValueArea = sort[thres];
+ info->maxOfHighValueArea = sort[N-1];
+ info->medianOfHighValueArea = sort[med];
+ n = 0;
+ DEBUGPRINT2("thresHigh %f %f\n", info->thresHigh, sort[thres]);
+ DEBUGPRINT6("N %d thres %d med %d %f %f %f \n", N, thres, med, sort[thres], sort[med], sort[N-1]);
+ sum = 0;
+ for(i=thres; i<N; i++) {
+ sum += sort[i];
+ n++;
+ }
+ info->meanOfHighValueArea = sum/n;
+
+ sum = 0;
+ for(i=thres; i<N; i++) {
+ sum += SQR( sort[i] - info->meanOfHighValueArea);
+ }
+ info->sdOfHighValueArea = sqrt(sum/n);
+ info->seOfHighValueArea = sqrt(sum/n)/sqrt(n);
+
+ break;
+ }
default:{
fprintf(stderr, "Not supported mode :%d", info->mode);
exit(EXIT_FAILURE);
int* data;
} intVector;
+typedef struct doubleVector {
+ unsigned long size;
+ double* data;
+} doubleVector;
+
/* struct end */
-/* prototype begin */
extern floatVector* floatVectorInit(floatVector* v, long size);
extern floatVector* floatVectorFree(floatVector* v);
extern void lVectorSpline2D(double t, double* px, double* py,
floatVector* p, floatVector* x, floatVector* y,
floatVector* a, floatVector* b);
-/* prototype end */
-
-/* struct begin */
-typedef struct doubleVector {
- unsigned long size;
- double* data;
-} doubleVector;
-/* struct end */
-/* prototype begin */
extern doubleVector* doubleVectorInit(doubleVector* v, long size);
extern doubleVector* doubleVectorFree(doubleVector* v);
extern doubleVector* doubleVectorAdd(doubleVector* v, doubleVector* u, doubleVector* w);
int* data;
} intVector;
+typedef struct doubleVector {
+ unsigned long size;
+ double* data;
+} doubleVector;
+
/* struct end */
-/* prototype begin */
extern floatVector* floatVectorInit(floatVector* v, long size);
extern floatVector* floatVectorFree(floatVector* v);
extern void lVectorSpline2D(double t, double* px, double* py,
floatVector* p, floatVector* x, floatVector* y,
floatVector* a, floatVector* b);
-/* prototype end */
-
-/* struct begin */
-typedef struct doubleVector {
- unsigned long size;
- double* data;
-} doubleVector;
-/* struct end */
-/* prototype begin */
extern doubleVector* doubleVectorInit(doubleVector* v, long size);
extern doubleVector* doubleVectorFree(doubleVector* v);
extern doubleVector* doubleVectorAdd(doubleVector* v, doubleVector* u, doubleVector* w);
if(NULL!=stringGetFromFile(s, "", fpt, stdout, 0)) {
floatVectorInit(v, v->size);
for(i=0; i<v->size; i++) {
- v->data[i] = stringNthRealData(s, i, " ,");
+ v->data[i] = stringGetNthRealData(s, i, " ,");
}
return v->size;
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
mrcImageSamplingUnitChange \
mrcImageScalarAdd \
mrcImageSectionGet \
+mrcImageSeriesNormalizing \
mrcImageSetFunction \
mrcImageShapeOrientation \
mrcImageShapePCA \
"-o","-o[utput]","OutputDataFile","Essential","1","1","Out","outFile","NULL"
"-A","-A","A","Optional","1","1","A","Real","1.0"
"-B","-B","B","Optional","1","1","B","Real","0.0"
-"-ContourMin","-ContourMin","ContourMin","Optional","1","1","ContourMin","Real","0.0"
-"-ContourMax","-ContourMax","ContourMax","Optional","1","1","ContourMax","Real","1.0"
+"-ContourMin","-ContourMin","ContourMin: density value","Optional","1","1","ContourMin","Real","0.0"
+"-ContourMax","-ContourMax","ContourMax: density value","Optional","1","1","ContourMax","Real","10.0"
"-ContourSolvent","-ContourSolvent","ContourSolvent","Optional","1","1","ContourSolvent","Real","0.0"
+"-Low","-Low[ValueArea]","LowValueArea: rate","Optional","1","1","thresOfLowValueArea","Real","0.1"
+"-High","-High[ValueArea]","HighValueArea: rate","Optional","1","1","thresOfHighValueArea","Real","0.9"
"-c","-c[onfig]","ConfigurationFile","Optional","1","1","configFile","inFile","NULL"
"-m","-m[ode]","Mode","Optional","1","1","mode","Integer","0"
long flagContourSolvent;
float ContourSolvent;
+ long flagthresOfLowValueArea;
+ float thresOfLowValueArea;
+
+ long flagthresOfHighValueArea;
+ float thresOfHighValueArea;
+
long flagconfigFile;
char* configFile;
FILE* fptconfigFile;
}
SBREAK;
}
+ SCASE("Low") {
+ if(i+1<argc) {
+ info->thresOfLowValueArea = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagthresOfLowValueArea++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("High") {
+ if(i+1<argc) {
+ info->thresOfHighValueArea = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagthresOfHighValueArea++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
SCASE("c") {
if(i+1<argc) {
info->configFile = stringGetNthWord(argv[i+1], 1, " ,");
info->A = 1.0; info->flagA = 0;
info->B = 0.0; info->flagB = 0;
info->ContourMin = 0.0; info->flagContourMin = 0;
- info->ContourMax = 1.0; info->flagContourMax = 0;
+ info->ContourMax = 10.0; info->flagContourMax = 0;
info->ContourSolvent = 0.0; info->flagContourSolvent = 0;
+ info->thresOfLowValueArea = 0.1; info->flagthresOfLowValueArea = 0;
+ info->thresOfHighValueArea = 0.9; info->flagthresOfHighValueArea = 0;
info->fptconfigFile = NULL; info->flagconfigFile = 0;
info->mode = 0; info->flagmode = 0;
}
if(info->flagContourSolvent) {
}
+ if(info->flagthresOfLowValueArea) {
+ }
+
+ if(info->flagthresOfHighValueArea) {
+ }
+
if(info->flagconfigFile) {
info->fptconfigFile = fileOpen(info->configFile, "r");
}
linfo.ContourMin = info.ContourMin;
linfo.ContourMax = info.ContourMax;
linfo.ContourSolvent = info.ContourSolvent;
+ linfo.thresOfLowValueArea = info.thresOfLowValueArea;
+ linfo.thresOfHighValueArea = info.thresOfHighValueArea;
linfo.Mode = info.mode;
lmrcImageNormalizing(&out, &in, &linfo, 0);
{
fprintf(stderr, "----- mode -----\n");
lmrcImageNormalizingModePrint(stderr, 0);
+ fprintf(stderr, "----- HighValueArea and LowValueArea for %03d -----\n", lmrcImageNormalizingModeUsingLowValueAreaToHighValueArea);
}
[-o[utput] Out (NULL ).as(outFile ) ] :Essential :OutputDataFile
[-A A (1.0 ).as(Real ) ] :Optional :A
[-B B (0.0 ).as(Real ) ] :Optional :B
- [-ContourMin ContourMin (0.0 ).as(Real ) ] :Optional :ContourMin
- [-ContourMax ContourMax (1.0 ).as(Real ) ] :Optional :ContourMax
+ [-ContourMin ContourMin (0.0 ).as(Real ) ] :Optional :ContourMin: density value
+ [-ContourMax ContourMax (10.0 ).as(Real ) ] :Optional :ContourMax: density value
[-ContourSolvent ContourSolvent (0.0 ).as(Real ) ] :Optional :ContourSolvent
+ [-Low[ValueArea] thresOfLowValueArea (0.1 ).as(Real ) ] :Optional :LowValueArea: rate
+ [-High[ValueArea] thresOfHighValueArea(0.9 ).as(Real ) ] :Optional :HighValueArea: rate
[-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile
[-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode
----- mode -----
data = A*Normalized(data) + B , where normalized means (average=0, SD=1)
6: Min-75percent: Background and Object(75)
data = A*(data-Min)/(75percent-Min)x0.75 + B
+ 7: LowValueArea to HighValueArea:
+ data = A*(data-MeanOfLowValueArea)/(meanOfHighValue-meanOfLowValueArea) + B, using LowValueArea and HighValueArea
+----- HighValueArea and LowValueArea for 007 -----
</PRE>
</BODY>
</HTML>
-O 1 0 1 1 0 1 -1x1+1+3.000000 ' ' 'Out' 'OutputDataFile' o
-f 1 0 1 0 0 -1x1+1+4.500000 0 0 1.000000 0 0 0 'A' 'A' A
-f 1 0 1 0 0 -1x1+1+6.000000 0 0 0.000000 0 0 0 'B' 'B' B
- -f 1 0 1 0 0 -1x1+1+7.500000 0 0 0.000000 0 0 0 'ContourMin' 'ContourMin' ContourMin
- -f 1 0 1 0 0 -1x1+1+9.000000 0 0 1.000000 0 0 0 'ContourMax' 'ContourMax' ContourMax
+ -f 1 0 1 0 0 -1x1+1+7.500000 0 0 0.000000 0 0 0 'ContourMin' 'ContourMin: density value' ContourMin
+ -f 1 0 1 0 0 -1x1+1+9.000000 0 0 10.000000 0 0 0 'ContourMax' 'ContourMax: density value' ContourMax
-f 1 0 1 0 0 -1x1+1+10.500000 0 0 0.000000 0 0 0 'ContourSolvent' 'ContourSolvent' ContourSolvent
- -I 1 0 1 0 0 1 -1x1+1+12.000000 ' ' 'configFile' 'ConfigurationFile' c
- -i 1 0 1 0 0 -1x1+1+13.500000 0 0 0 0 0 'mode' 'Mode' m
+ -f 1 0 1 0 0 -1x1+1+12.000000 0 0 0.100000 0 0 0 'thresOfLowValueArea' 'LowValueArea: rate' Low
+ -f 1 0 1 0 0 -1x1+1+13.500000 0 0 0.900000 0 0 0 'thresOfHighValueArea' 'HighValueArea: rate' High
+ -I 1 0 1 0 0 1 -1x1+1+15.000000 ' ' 'configFile' 'ConfigurationFile' c
+ -i 1 0 1 0 0 -1x1+1+16.500000 0 0 0 0 0 'mode' 'Mode' m
-E
-E
-E
exec:
@echo "----- Execution Check -----"
../$(OSTYPE)/$(OBJECTNAME) -i data/121p-GC.mrc3d -o data/121p-GC.mode5.mrc3d -m 5 -A 1 -B 0
+ ../$(OSTYPE)/$(OBJECTNAME) -i data/121p-GC.mrc3d -o data/121p-GC.mode7.mrc3d -m 7 -Low 0.1 -High 0.99 -A 0.9 -B 0.1
@echo "----- Calc check -----"
init:
fprintf(stderr, " [-o[utput] Out (NULL ).as(outFile ) ] :Essential :OutputDataFile\n");
fprintf(stderr, " [-A A (1.0 ).as(Real ) ] :Optional :A\n");
fprintf(stderr, " [-B B (0.0 ).as(Real ) ] :Optional :B\n");
- fprintf(stderr, " [-ContourMin ContourMin (0.0 ).as(Real ) ] :Optional :ContourMin\n");
- fprintf(stderr, " [-ContourMax ContourMax (1.0 ).as(Real ) ] :Optional :ContourMax\n");
+ fprintf(stderr, " [-ContourMin ContourMin (0.0 ).as(Real ) ] :Optional :ContourMin: density value\n");
+ fprintf(stderr, " [-ContourMax ContourMax (10.0 ).as(Real ) ] :Optional :ContourMax: density value\n");
fprintf(stderr, " [-ContourSolvent ContourSolvent (0.0 ).as(Real ) ] :Optional :ContourSolvent\n");
+ fprintf(stderr, " [-Low[ValueArea] thresOfLowValueArea (0.1 ).as(Real ) ] :Optional :LowValueArea: rate\n");
+ fprintf(stderr, " [-High[ValueArea] thresOfHighValueArea(0.9 ).as(Real ) ] :Optional :HighValueArea: rate\n");
fprintf(stderr, " [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile\n");
fprintf(stderr, " [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode\n");
additionalUsage();
--- /dev/null
+OBJECTNAME = mrcImageSeriesNormalizing
+EXTRA_LIB = -lgsl -lgslcblas
+EXTRA_CCOPTS =
+EXTRA_INC =
--- /dev/null
+# OptionControlFile
+# FileFormat
+"-i","-i[nput]","Input: name list of mrcImage","Essential","1","1","In","inFileList","NULL"
+"-o","-o[utput]","Output: name list of mrcImage","Essential","1","1","Out","outFileList","NULL"
+"-param","-param[eters]","Output: Parameters","Optional","1","1","Param","outFile","stdout"
+"-Low","-Low[ValueArea]","LowValueArea: rate","Optional","1","1","thresOfLowValueArea","Real","0.01"
+"-High","-High[ValueArea]","HighValueArea: rate","Optional","1","1","thresOfHighValueArea","Real","0.99"
+"-L","-L[ow]","Low","Optional","1","1","Low","Real","0.1"
+"-H","-H[igh]","High","Optional","1","1","High","Real","0.9"
+"-LowExp","-Low[ValueArea]Exp","Alow * exp(-Klow * i) + Blow","Optional","3","1","ALow","Real","1.0","2","KLow","Real","0.1","3","BLow","Real","1.0"
+"-HighExp","-High[ValueArea]Exp","Ahigh * exp(-Khigh * i) + Bhigh","Optional","3","1","AHigh","Real","0.1","2","KHigh","Real","0.1","3","BHigh","Real","0.0"
+"-maxIter","-maxIter","maxIteration","Optional","1","1","maxIter","Integer","100"
+"-xtol","-xtol","xtol","Optional","1","1","xtol","Real","1e-8"
+"-gtol","-gtol","gtol","Optional","1","1","gtol","Real","1e-8"
+"-ftol","-ftol","ftol","Optional","1","1","ftol","Real","0.0"
+"-c","-c[onfig]","ConfigurationFile","Optional","1","1","configFile","inFile","NULL"
+"-m","-m[ode]","Mode","Optional","1","1","mode","Integer","0"
--- /dev/null
+include ../../../Config/Define.inc
+include ../../Config/Define.inc
+include ../Config/Define.inc
+include Config/Define.inc
+
+all:
+ cd src; make all; cd ..
+
+install:
+ cd src; make install; cd ..
+
+
+putSF:
+ if [ -f private ] ; \
+ then \
+ echo "$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME) is private"; \
+ else \
+ cvs -z4 -d:ext:$$USER@$$EOS_SOURCEFORGE commit || cvs -z4 -d:ext:$$USER@$$EOS_SOURCEFORGE import src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME); \
+ fi
+
+put:
+ cd src; make put; cd ..
+
+clean:
+ cd src; make clean; cd ..
+
+depend:
+ cd src; make depend; cd ..
+
+check:
+ @if [ ! -d $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) ] ; then \
+ echo making directory; \
+ mkdir -p $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE); \
+ fi
+ ln -sf ../../../../../hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) src/$(OSTYPE);
+ @$(RM) src/Makefile
+ @echo "New src/Makefile"
+ @$(CP) ../../../Config/Template/$(WORLDNAME)Template.Dir/src/Makefile src/Makefile
+ @cd src; rm -f $(OSTYPE)/.Depend; touch $(OSTYPE)/.Depend; make depend
+
+update:
+ @if [ ! -d $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) ] ; then \
+ echo making directory; \
+ mkdir -p $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE); \
+ fi
+ ln -sf ../../../../../hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) src/$(OSTYPE);
+ @$(RM) src/Makefile
+ @echo "New src/Makefile"
+ @$(CP) ../../../Config/Template/$(WORLDNAME)Template.Dir/src/Makefile src/Makefile
+ @cd src; rm -f $(OSTYPE)/.Depend; touch $(OSTYPE)/.Depend; echo "Y" | make update
+
+cvsupdate::
+ cvs -d $(EOS_CVSROOT) update -d
+
+cvscommit::
+ cvs -d $(EOS_CVSROOT) commit
+
+backup:
+ @cd ../../../..; \
+ echo $(OBJECTNAME) ; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \
+ tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile
+
+backup-all:
+ @cd ../../../..; \
+ echo $(OBJECTNAME) ; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \
+ tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile
+
+distribute:
+ cd ../../../..; \
+ echo $(OBJECTNAME) ; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile ; \
+ tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE)
+
+distribute-all:
+ @cd ../../../..; \
+ echo $(OBJECTNAME) ; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile ; \
+ tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE)
+
+eosintroduce:
+ ${EOS_HOME}/sbin/eosintroduce ${WORLDNAME} ${CLASSNAME} ${OBJECTNAME} ./
+
+include Config/Target.inc
--- /dev/null
+install:
+ cd ../src; make install-doc; cd ../doc
--- /dev/null
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include "../inc/mrcImageSeriesNormalizing.h"
+
+#endif /* CONFIG_H */
--- /dev/null
+#ifndef MRCIMAGESERIESNORMALIZING_H
+#define MRCIMAGESERIESNORMALIZING_H
+#include <stdio.h>
+#include <stdlib.h>
+
+#define OPTION_FLAG '-'
+#define OPTION_FLAG_POS (0)
+#define OPTION_POS (1)
+
+
+
+
+typedef struct mrcImageSeriesNormalizingInfo {
+ long flagRedirect;
+
+ long flagIn;
+ char** In;
+ char* InList;
+ FILE** fptIn;
+ FILE* fptInList;
+
+ long flagOut;
+ char** Out;
+ char* OutList;
+ FILE** fptOut;
+ FILE* fptOutList;
+
+ long flagParam;
+ char* Param;
+ FILE* fptParam;
+
+ long flagthresOfLowValueArea;
+ float thresOfLowValueArea;
+
+ long flagthresOfHighValueArea;
+ float thresOfHighValueArea;
+
+ long flagLow;
+ float Low;
+
+ long flagHigh;
+ float High;
+
+ long flagALow;
+ float ALow;
+
+ long flagKLow;
+ float KLow;
+
+ long flagBLow;
+ float BLow;
+
+ long flagAHigh;
+ float AHigh;
+
+ long flagKHigh;
+ float KHigh;
+
+ long flagBHigh;
+ float BHigh;
+
+ long flagmaxIter;
+ long maxIter;
+
+ long flagxtol;
+ float xtol;
+
+ long flaggtol;
+ float gtol;
+
+ long flagftol;
+ float ftol;
+
+ long flagconfigFile;
+ char* configFile;
+ FILE* fptconfigFile;
+
+ long flagmode;
+ long mode;
+
+} mrcImageSeriesNormalizingInfo;
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void argCheck(mrcImageSeriesNormalizingInfo* info, int argc, char* avgv[]);
+extern void khorosInit(int argc, char* avgv[]);
+extern void init0(mrcImageSeriesNormalizingInfo* info);
+extern void init1(mrcImageSeriesNormalizingInfo* info);
+extern void usage(char* usage);
+extern void additionalUsage(void);
+extern void htmlBeforeUsage(char* usage);
+extern void htmlAfterUsage(char* usage);
+#ifdef __cplusplus
+};
+#endif
+#endif /* MRCIMAGESERIESNORMALIZING_H */
--- /dev/null
+../../../../../hostdepend/ARM64MAC64/src/Tools/mrcImage/mrcImageSeriesNormalizing/src/ARM64MAC64
\ No newline at end of file
--- /dev/null
+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
+ @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
+ @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;\
+ 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)/* ; \
+ 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)/* ; \
+ 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)/*; \
+ 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) ../../ ; \
+ $(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 ; \
+ $(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
+
+updateNoAns:../Config/OptionControlFile
+ maketool $(CLASSNAME) $(OBJECTNAME) update N
+
+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
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "../inc/config.h"
+#include "genUtil.h"
+#include "eosString.h"
+#include "File.h"
+#include "Memory.h"
+
+
+void
+argCheck(mrcImageSeriesNormalizingInfo* info, int argc, char* argv[])
+{
+ 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->InList = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagIn++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("o") {
+ if(i+1<argc) {
+ info->OutList = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagOut++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("param") {
+ if(i+1<argc) {
+ info->Param = stringGetNthWord(argv[i+1], 1, " ,");
+ i++;
+ info->flagParam++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("Low") {
+ if(i+1<argc) {
+ info->thresOfLowValueArea = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagthresOfLowValueArea++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("High") {
+ if(i+1<argc) {
+ info->thresOfHighValueArea = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagthresOfHighValueArea++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("L") {
+ if(i+1<argc) {
+ info->Low = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagLow++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("H") {
+ if(i+1<argc) {
+ info->High = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagHigh++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("LowExp") {
+ if(i+3<argc) {
+ info->ALow = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagALow++;
+ info->KLow = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagKLow++;
+ info->BLow = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagBLow++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("HighExp") {
+ if(i+3<argc) {
+ info->AHigh = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagAHigh++;
+ info->KHigh = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagKHigh++;
+ info->BHigh = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagBHigh++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("maxIter") {
+ if(i+1<argc) {
+ info->maxIter = stringGetNthIntegerData(argv[i+1], 1, " ,");
+ i++;
+ info->flagmaxIter++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("xtol") {
+ if(i+1<argc) {
+ info->xtol = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagxtol++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("gtol") {
+ if(i+1<argc) {
+ info->gtol = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flaggtol++;
+ } else {
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ SBREAK;
+ }
+ SCASE("ftol") {
+ if(i+1<argc) {
+ info->ftol = stringGetNthRealData(argv[i+1], 1, " ,");
+ i++;
+ info->flagftol++;
+ } 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
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include "../inc/config.h"
+#include "genUtil.h"
+#include "eosString.h"
+#include "File.h"
+#include "Memory.h"
+
+
+void
+init0(mrcImageSeriesNormalizingInfo* info)
+{
+ info->fptIn = NULL; info->fptInList = NULL; info->flagIn = 0;
+ info->fptOut = NULL; info->fptOutList = NULL; info->flagOut = 0;
+ info->fptParam = stdout; info->flagParam = 0;
+ info->thresOfLowValueArea = 0.01; info->flagthresOfLowValueArea = 0;
+ info->thresOfHighValueArea = 0.99; info->flagthresOfHighValueArea = 0;
+ info->Low = 0.1; info->flagLow = 0;
+ info->High = 0.9; info->flagHigh = 0;
+ info->ALow = 1.0; info->flagALow = 0;
+ info->KLow = 0.1; info->flagKLow = 0;
+ info->BLow = 1.0; info->flagBLow = 0;
+ info->AHigh = 0.1; info->flagAHigh = 0;
+ info->KHigh = 0.1; info->flagKHigh = 0;
+ info->BHigh = 0.0; info->flagBHigh = 0;
+ info->maxIter = 100; info->flagmaxIter = 0;
+ info->xtol = 1e-8; info->flagxtol = 0;
+ info->gtol = 1e-8; info->flaggtol = 0;
+ info->ftol = 0.0; info->flagftol = 0;
+ info->fptconfigFile = NULL; info->flagconfigFile = 0;
+ info->mode = 0; info->flagmode = 0;
+}
+
+void
+init1(mrcImageSeriesNormalizingInfo* info)
+{
+ char s[1024];
+ int i;
+ if(!info->flagIn) {
+ stringGetFromFile(s, "In", stdin, stdout, 0);
+ info->InList = stringGetNthWord(s, 1, " ,\t");
+ info->flagIn++;
+ }
+ if(info->flagIn) {
+ info->fptInList = fileOpen(info->InList, "r");
+ fseek(info->fptInList, 0L, SEEK_SET);
+ i=0;
+ while(NULL!=stringGetFromFile(s, "", info->fptInList, stdout, 1)) {
+ i++;
+ }
+ info->fptIn = (FILE**)memoryAllocate(i*sizeof(FILE*), "in init1");
+ info->In = (char**)memoryAllocate(i*sizeof(char*), "in init1");
+ info->flagIn = i;
+ fseek(info->fptInList, 0L, SEEK_SET);
+ i=0;
+ while(NULL!=stringGetFromFile(s, "", info->fptInList, stdout, 1)) {
+ info->In[i] = stringGetNthWord(s, 1, " ,\t");
+ info->fptIn[i] = fileOpen(info->In[i],"r");
+ i++;
+ }
+ }
+
+ if(!info->flagOut) {
+ stringGetFromFile(s, "Out", stdin, stdout, 0);
+ info->OutList = stringGetNthWord(s, 1, " ,\t");
+ info->flagOut++;
+ }
+ if(info->flagOut) {
+ info->fptOutList = fileOpen(info->OutList, "r");
+ fseek(info->fptOutList, 0L, SEEK_SET);
+ i=0;
+ while(NULL!=stringGetFromFile(s, "", info->fptOutList, stdout, 1)) {
+ i++;
+ }
+ info->fptOut = (FILE**)memoryAllocate(i*sizeof(FILE*), "in init1");
+ info->Out = (char**)memoryAllocate(i*sizeof(char*), "in init1");
+ info->flagOut = i;
+ fseek(info->fptOutList, 0L, SEEK_SET);
+ i=0;
+ while(NULL!=stringGetFromFile(s, "", info->fptOutList, stdout, 1)) {
+ info->Out[i] = stringGetNthWord(s, 1, " ,\t");
+ info->fptOut[i] = fileOpen(info->Out[i],"w");
+ i++;
+ }
+ }
+
+ if(info->flagParam) {
+ info->fptParam = fileOpen(info->Param, "w");
+ }
+
+ if(info->flagthresOfLowValueArea) {
+ }
+
+ if(info->flagthresOfHighValueArea) {
+ }
+
+ if(info->flagLow) {
+ }
+
+ if(info->flagHigh) {
+ }
+
+ if(info->flagALow) {
+ }
+
+ if(info->flagKLow) {
+ }
+
+ if(info->flagBLow) {
+ }
+
+ if(info->flagAHigh) {
+ }
+
+ if(info->flagKHigh) {
+ }
+
+ if(info->flagBHigh) {
+ }
+
+ if(info->flagmaxIter) {
+ }
+
+ if(info->flagxtol) {
+ }
+
+ if(info->flaggtol) {
+ }
+
+ if(info->flagftol) {
+ }
+
+ 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");
+ sprintf(panepath, "%s/src/Tools/mrcImage/mrcImageSeriesNormalizing/src/mrcImageSeriesNormalizing.pane", eospath);
+ khoros_initialize(argc, argv, "EOS");
+ fpt = fopen(panepath, "r"); if(NULL!=fpt) {
+ fclose(fpt);
+ kclui_initialize(panepath, KGEN_NONE, "EOS", "mrcImageSeriesNormalizing",
+ func_usage_additions,
+ func_get_args,
+ func_free_args);
+ }
+}
+#endif /* KHOROS */
--- /dev/null
+/*
+# mrcImageSeriesNormalizing : $Revision$
+# $Date$
+# Created by $Author$
+# Usage : mrcImageSeriesNormalizing
+# Attention
+# $Loccker$
+# $State$
+#
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#define GLOBAL_DECLARATION
+#include "../inc/config.h"
+
+#define DEBUG
+#include "genUtil.h"
+#include "Memory.h"
+#include "mrcImage.h"
+#include "eosNonLinearFitting.h"
+
+typedef struct lmrcImageSeriesNormalizingInfo {
+ int N;
+ float High;
+ float Low;
+ float thresOfLowValueArea;
+ float thresOfHighValueArea;
+ double A;
+ double B;
+ eosNonLinearFittingParams outHigh;
+ eosNonLinearFittingParams outLow;
+ int maxIter;
+} lmrcImageSeriesNormalizingInfo;
+
+typedef enum lmrcImageSeriesNormalizingMode {
+ lmrcImageSeriesNormalizingModeLowValueAreaToHighValueArea=0
+} lmrcImageSeriesNormalizingMode;
+
+
+extern int lmrcImageSeriesNormalizingOutputParam(FILE* fpt, lmrcImageSeriesNormalizingInfo linfo, lmrcImageSeriesNormalizingMode mode);
+extern int lmrcImageSeriesNormalizing(mrcImage* out, mrcImage* in, lmrcImageSeriesNormalizingInfo* linfo, lmrcImageSeriesNormalizingMode mode);
+
+int
+main(int argc, char* argv[])
+{
+ mrcImageSeriesNormalizingInfo info;
+ lmrcImageSeriesNormalizingInfo linfo;
+ mrcImage* in;
+ mrcImage* out;
+ int i, j;
+
+ init0(&info);
+ argCheck(&info, argc, argv);
+ init1(&info);
+
+ DEBUGPRINT("Program Start\n");
+ linfo.thresOfLowValueArea = info.thresOfLowValueArea;
+ linfo.thresOfHighValueArea = info.thresOfHighValueArea;
+ linfo.High = info.High;
+ linfo.Low = info.Low;
+ linfo.outHigh.Ainit = info.AHigh;
+ linfo.outHigh.Kinit = info.KHigh;
+ linfo.outHigh.Binit = info.BHigh;
+ linfo.outLow.Ainit = info.ALow;
+ linfo.outLow.Kinit = info.KLow;
+ linfo.outLow.Binit = info.BLow;
+ linfo.N = info.flagIn;
+ linfo.outLow.xtol = linfo.outHigh.xtol = info.xtol;
+ linfo.outLow.gtol = linfo.outHigh.gtol = info.gtol;
+ linfo.outLow.ftol = linfo.outHigh.ftol = info.ftol;
+ linfo.outLow.maxIter = linfo.outHigh.maxIter = linfo.maxIter = info.maxIter;
+ if(info.flagIn!=info.flagOut) {
+ fprintf(stderr, "In num %ld is diffrenct from Out num %ld\n", info.flagIn, info.flagOut);
+ }
+ in = (mrcImage*)memoryAllocate(sizeof(mrcImage)*info.flagIn, "in main");
+ out = (mrcImage*)memoryAllocate(sizeof(mrcImage)*info.flagOut, "in main");
+
+ for(i=0; i<info.flagIn; i++) {
+ mrcFileRead(&(in[i]), info.In[i], "in main", 0);
+ }
+
+ lmrcImageSeriesNormalizing(out, in, &linfo, info.mode);
+
+ lmrcImageSeriesNormalizingOutputParam(info.fptParam, linfo, info.mode);
+
+ for(i=0; i<info.flagOut; i++) {
+ mrcFileWrite(&(out[i]), info.Out[i], "in main", 0);
+ }
+
+ exit(EXIT_SUCCESS);
+}
+
+void
+additionalUsage()
+{
+ fprintf(stderr, "----- Additional Usage -----\n");
+ fprintf(stderr, "mode: %d\n", lmrcImageSeriesNormalizingModeLowValueAreaToHighValueArea);
+ fprintf(stderr, " t = i/N\n" );
+ fprintf(stderr, " low = Alow * exp(-Klow t) * Blow\n" );
+ fprintf(stderr, " high = Ahigh * exp(-Khigh t) * Bhigh\n" );
+ fprintf(stderr, " Dnor= High*(D-low)/(high-low) + Low\n" );
+}
+
+int
+lmrcImageSeriesNormalizingOutputParam(FILE* fpt, lmrcImageSeriesNormalizingInfo linfo, lmrcImageSeriesNormalizingMode mode)
+{
+ int i;
+ switch(mode) {
+ case lmrcImageSeriesNormalizingModeLowValueAreaToHighValueArea: {
+ for(i=0; i<=linfo.maxIter; i++) {
+ if(linfo.outHigh.message[i]!=NULL) {
+ fprintf(fpt, "%s\n",linfo.outHigh.message[i]);
+ }
+ if(linfo.outLow.message[i]!=NULL) {
+ fprintf(fpt, "%s\n",linfo.outLow.message[i]);
+ }
+ }
+ fprintf(fpt, "method: %s\n", linfo.outHigh.method);
+ fprintf(fpt, "iter(low,high): %d %d\n", linfo.outLow.iter, linfo.outHigh.iter);
+ fprintf(fpt, "functionEval(low,high): %f %f\n", linfo.outLow.functionEvaluations, linfo.outHigh.functionEvaluations);
+ fprintf(fpt, "JacobianEval(low,high): %f %f\n", linfo.outLow.JacobianEvaluations, linfo.outHigh.JacobianEvaluations);
+ fprintf(fpt, "reason(low,high): %s %s\n", linfo.outLow.reason, linfo.outHigh.reason);
+ fprintf(fpt, "status(low,high): %s %s\n", linfo.outLow.status, linfo.outHigh.status);
+ fprintf(fpt, "DegreeOfFreedom(low,high): %f %f\n", linfo.outLow.degreeOfFreedom, linfo.outHigh.degreeOfFreedom);
+ fprintf(fpt, "c(low,high): %f %f\n", linfo.outLow.c, linfo.outHigh.c);
+ fprintf(fpt, "chisq/degreeOfFreedom(low,high): %f %f\n", linfo.outLow.chisq_per_degreeOfFreedom, linfo.outHigh.chisq_per_degreeOfFreedom);
+ fprintf(fpt, "high(A,dA,K,dK,B,dB): %f %f %f %f %f %f\n", linfo.outHigh.A, linfo.outHigh.sigA, linfo.outHigh.K, linfo.outHigh.sigK, linfo.outHigh.B, linfo.outHigh.sigB);
+ fprintf(fpt, "low(A,dA,K,dK,B,dB): %f %f %f %f %f %f\n", linfo.outLow.A, linfo.outLow.sigA, linfo.outLow.K, linfo.outLow.sigK, linfo.outLow.B, linfo.outLow.sigB);
+ break;
+ }
+ default: {
+ fprintf(stderr, "Not supported mode: %d\n", mode);
+ exit(EXIT_FAILURE);
+ break;
+ }
+ }
+ return 0;
+}
+
+int
+lmrcImageSeriesNormalizing(mrcImage* out, mrcImage* in, lmrcImageSeriesNormalizingInfo* linfo, lmrcImageSeriesNormalizingMode mode)
+{
+ double* frame;
+ double* high;
+ double* sighigh;
+ double* low;
+ double* siglow;
+ int i;
+ double data, highi, lowi;
+ mrcImageParaTypeReal x, y, z;
+
+ frame = (double*)memoryAllocate(sizeof(double)*linfo->N, "in main");
+ low = (double*)memoryAllocate(sizeof(double)*linfo->N, "in main");
+ high = (double*)memoryAllocate(sizeof(double)*linfo->N, "in main");
+ siglow = (double*)memoryAllocate(sizeof(double)*linfo->N, "in main");
+ sighigh = (double*)memoryAllocate(sizeof(double)*linfo->N, "in main");
+ switch(mode) {
+ case lmrcImageSeriesNormalizingModeLowValueAreaToHighValueArea: {
+ // low/high= A*exp(-Kt) + B
+ // ln low/high = ln A - K log t
+ mrcImageInformation inInfo;
+ inInfo.mode = meanOfLowValueAreaAndHighValueArea;
+ inInfo.thresLow = linfo->thresOfLowValueArea;
+ inInfo.thresHigh = linfo->thresOfHighValueArea;
+ for(i=0; i<linfo->N; i++) {
+ lmrcImageInformation(&inInfo, &(in[i]));
+ frame[i] = (double)i/(double)linfo->N;
+ high[i] = inInfo.meanOfHighValueArea;
+ sighigh[i] = inInfo.sdOfHighValueArea;
+ low[i] = inInfo.meanOfLowValueArea;
+ siglow[i] = inInfo.sdOfLowValueArea;
+ }
+ DEBUGPRINT("HIGH\n");
+ eosNonLinearFitting(&linfo->outHigh, frame, high, sighigh, linfo->N, eosNonLinearFittingModeSingleExpDecay);
+ DEBUGPRINT("LOW\n");
+ eosNonLinearFitting(&linfo->outLow, frame, low, siglow, linfo->N, eosNonLinearFittingModeSingleExpDecay);
+
+ for(i=0; i<linfo->N; i++) {
+ out[i].Header = in[i].Header;
+ mrcInit(&out[i], NULL);
+ for(z=0; z<in[i].HeaderN.z; z++) {
+ for(y=0; y<in[i].HeaderN.y; y++) {
+ for(x=0; x<in[i].HeaderN.x; x++) {
+ mrcPixelDataGet(&in[i], x, y, z, &data, mrcPixelRePart, mrcPixelHowNearest);
+ lowi = linfo->outLow.A *exp( - linfo->outLow.K * frame[i] ) + linfo->outLow.B;
+ highi = linfo->outHigh.A*exp( - linfo->outHigh.K * frame[i] ) + linfo->outHigh.B;
+ data = linfo->High*(data-lowi)/(highi -lowi) + linfo->Low;
+ mrcPixelDataSet(&out[i], x, y, z, data, mrcPixelRePart);
+ }
+ }
+ }
+ }
+ break;
+ }
+ default: {
+ fprintf(stderr, "Not supported mode: %d\n", mode);
+ exit(EXIT_FAILURE);
+ break;
+ }
+ }
+ return 0;
+}
--- /dev/null
+<HTML>
+<HEAD>
+<TITLE>mrcImageSeriesNormalizing</TITLE>
+</HEAD>
+<BODY>
+<H1>mrcImageSeriesNormalizing</H1>
+<H2>Usage</H2>
+<PRE>
+Usage: mrcImageSeriesNormalizing
+Options:
+ [-i[nput] In (NULL ).as(inFileList ) ] :Essential :Input: name list of mrcImage
+ [-o[utput] Out (NULL ).as(outFileList ) ] :Essential :Output: name list of mrcImage
+ [-param[eters] Param (stdout ).as(outFile ) ] :Optional :Output: Parameters
+ [-Low[ValueArea] thresOfLowValueArea (0.01 ).as(Real ) ] :Optional :LowValueArea: rate
+ [-High[ValueArea] thresOfHighValueArea(0.99 ).as(Real ) ] :Optional :HighValueArea: rate
+ [-L[ow] Low (0.1 ).as(Real ) ] :Optional :Low
+ [-H[igh] High (0.9 ).as(Real ) ] :Optional :High
+ [-Low[ValueArea]Exp ALow (1.0 ).as(Real )
+ KLow (0.1 ).as(Real )
+ BLow (1.0 ).as(Real ) ] :Optional :Alow * exp(-Klow * i) + Blow
+ [-High[ValueArea]Exp AHigh (0.1 ).as(Real )
+ KHigh (0.1 ).as(Real )
+ BHigh (0.0 ).as(Real ) ] :Optional :Ahigh * exp(-Khigh * i) + Bhigh
+ [-maxIter maxIter (100 ).as(Integer ) ] :Optional :maxIteration
+ [-xtol xtol (1e-8 ).as(Real ) ] :Optional :xtol
+ [-gtol gtol (1e-8 ).as(Real ) ] :Optional :gtol
+ [-ftol ftol (0.0 ).as(Real ) ] :Optional :ftol
+ [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile
+ [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode
+----- Additional Usage -----
+mode: 0
+ t = i/N
+ low = Alow * exp(-Klow t) * Blow
+ high = Ahigh * exp(-Khigh t) * Bhigh
+ Dnor= High*(D-low)/(high-low) + Low
+</PRE>
+</BODY>
+</HTML>
--- /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 ' ' mrcImageSeriesNormalizing
+ -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/mrcImageSeriesNormalizing
+ -H 1 5x1+41+0 'Help' 'help page' $EOS/src/Tools/mrcImage/mrcImageSeriesNormalizing/doc/mrcImageSeriesNormalizing.doc help
+ -Q 1 0 5.25x1+47+0 'Close'
+ -I 1 0 1 1 0 1 -1x1+1+1.500000 ' ' 'In' 'Input: name list of mrcImage' i
+ -O 1 0 1 1 0 1 -1x1+1+3.000000 ' ' 'Out' 'Output: name list of mrcImage' o
+ -O 1 0 1 0 0 1 -1x1+1+4.500000 ' ' 'Param' 'Output: Parameters' param
+ -f 1 0 1 0 0 -1x1+1+6.000000 0 0 0.010000 0 0 0 'thresOfLowValueArea' 'LowValueArea: rate' Low
+ -f 1 0 1 0 0 -1x1+1+7.500000 0 0 0.990000 0 0 0 'thresOfHighValueArea' 'HighValueArea: rate' High
+ -f 1 0 1 0 0 -1x1+1+9.000000 0 0 0.100000 0 0 0 'Low' 'Low' L
+ -f 1 0 1 0 0 -1x1+1+10.500000 0 0 0.900000 0 0 0 'High' 'High' H
+ -I 1 0 0 1 0 1 -1x1+1+12 ' ' '1.0' 'ALow' Alow * exp(-Klow * i) + Blow
+ -I 1 0 0 1 0 1 -1x1+1+13 ' ' '0.1' 'AHigh' Ahigh * exp(-Khigh * i) + Bhigh
+ -i 1 0 1 0 0 -1x1+1+15.000000 0 0 100 0 0 'maxIter' 'maxIteration' maxIter
+ -f 1 0 1 0 0 -1x1+1+16.500000 0 0 0.000000 0 0 0 'xtol' 'xtol' xtol
+ -f 1 0 1 0 0 -1x1+1+18.000000 0 0 0.000000 0 0 0 'gtol' 'gtol' gtol
+ -f 1 0 1 0 0 -1x1+1+19.500000 0 0 0.000000 0 0 0 'ftol' 'ftol' ftol
+ -I 1 0 1 0 0 1 -1x1+1+21.000000 ' ' 'configFile' 'ConfigurationFile' c
+ -i 1 0 1 0 0 -1x1+1+22.500000 0 0 0 0 0 'mode' 'Mode' m
+ -E
+ -E
+-E
--- /dev/null
+include ../../Config/Define.inc
+include ../../../Config/Define.inc
+include ../../../../Config/Define.inc
+include ../../../../../Config/Define.inc
+
+all: help exec
+
+init:
+ rm -rf data/test.in.lst;
+ rm -rf data/test.out.lst;
+ while read i max min ; do \
+ echo $$i, $$min, $$max; \
+ mrcImageNormalizing -m 4 -A $$max -B $$min -i data/121p.mrc3d -o data/121p.$$i ; \
+ mrcImageNoiseAdd -i data/121p.$$i -o data/121p.$$i.mrc -SD 0.01 ; \
+ echo "data/121p.$$i.mrc" >> data/test.in.lst; \
+ echo "data/121p.$$i.out" >> data/test.out.lst; \
+ done < test.init;
+
+help:
+ @echo "----- Help Message Check -----"
+ @../$(OSTYPE)/$(OBJECTNAME) -h
+
+exec:
+ @echo "----- Execution Check -----"
+ ../$(OSTYPE)/$(OBJECTNAME) -i data/test.in.lst -o data/test.out.lst -H 0.9 -L 0.1 -High 0.95 -Low 0.7 -param data/test.param -m 0 -LowExp 0.32 5 0 -HighExp 32 5 0 -maxIter 100
+ cat data/test.param
+ @echo "----- Calc check -----"
+
+clean:
--- /dev/null
+../../../../../..//data/mrcImageSeriesNormalizing
\ No newline at end of file
--- /dev/null
+1 32.2 0.321
+2 16.1 0.162
+3 8.0 0.081
+4 4.2 0.043
+5 2.1 0.023
+6 1.3 0.011
+7 0.4 0.006
--- /dev/null
+#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(inFileList ) ] :Essential :Input: name list of mrcImage\n");
+ fprintf(stderr, " [-o[utput] Out (NULL ).as(outFileList ) ] :Essential :Output: name list of mrcImage\n");
+ fprintf(stderr, " [-param[eters] Param (stdout ).as(outFile ) ] :Optional :Output: Parameters\n");
+ fprintf(stderr, " [-Low[ValueArea] thresOfLowValueArea (0.01 ).as(Real ) ] :Optional :LowValueArea: rate\n");
+ fprintf(stderr, " [-High[ValueArea] thresOfHighValueArea(0.99 ).as(Real ) ] :Optional :HighValueArea: rate\n");
+ fprintf(stderr, " [-L[ow] Low (0.1 ).as(Real ) ] :Optional :Low\n");
+ fprintf(stderr, " [-H[igh] High (0.9 ).as(Real ) ] :Optional :High\n");
+ fprintf(stderr, " [-Low[ValueArea]Exp ALow (1.0 ).as(Real ) \n KLow (0.1 ).as(Real ) \n BLow (1.0 ).as(Real ) ] :Optional :Alow * exp(-Klow * i) + Blow\n");
+ fprintf(stderr, " [-High[ValueArea]Exp AHigh (0.1 ).as(Real ) \n KHigh (0.1 ).as(Real ) \n BHigh (0.0 ).as(Real ) ] :Optional :Ahigh * exp(-Khigh * i) + Bhigh\n");
+ fprintf(stderr, " [-maxIter maxIter (100 ).as(Integer ) ] :Optional :maxIteration\n");
+ fprintf(stderr, " [-xtol xtol (1e-8 ).as(Real ) ] :Optional :xtol\n");
+ fprintf(stderr, " [-gtol gtol (1e-8 ).as(Real ) ] :Optional :gtol\n");
+ fprintf(stderr, " [-ftol ftol (0.0 ).as(Real ) ] :Optional :ftol\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");
+}
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include "../inc/config.h"
+