コード例 #1
0
ファイル: blobs.cpp プロジェクト: josegutab/scipion
/* Fourier value of a blob ------------------------------------------------- */
double kaiser_Fourier_value(double w, double a, double alpha, int m)
{
    if (m != 2 && m !=0)
        REPORT_ERROR(ERR_VALUE_INCORRECT, "m out of range in kaiser_Fourier_value()");
    double sigma = sqrt(ABS(alpha * alpha - (2. * PI * a * w) * (2. * PI * a * w)));
    if (m == 2)
    {
        if (2.*PI*a*w > alpha)
            return  pow(2.*PI, 3. / 2.)*pow(a, 3.)*pow(alpha, 2.)*bessj3_5(sigma)
                    / (bessi0(alpha)*pow(sigma, 3.5));
        else
            return  pow(2.*PI, 3. / 2.)*pow(a, 3.)*pow(alpha, 2.)*bessi3_5(sigma)
                    / (bessi0(alpha)*pow(sigma, 3.5));
    }
    else if (m == 0)
    {
        if (2*PI*a*w > alpha)
            return  pow(2.*PI, 3. / 2.)*pow(a, 3)*bessj1_5(sigma)
                    / (bessi0(alpha)*pow(sigma, 1.5));
        else
            return  pow(2.*PI, 3. / 2.)*pow(a, 3)*bessi1_5(sigma)
                    / (bessi0(alpha)*pow(sigma, 1.5));
    }
    else
    	REPORT_ERROR(ERR_ARG_INCORRECT,"Invalid blob order");
}
コード例 #2
0
	double kaiser_Fourier_value(double w, double a, double alpha, int m)
	{
		double sigma = sqrt(abs(alpha * alpha - (PI2 * a * w) * (PI2 * a * w)));
		if (m == 2)
		{
			if (PI2 * a * w > alpha)
				return  pow(PI2, 1.5) * pow(a, 3.) * pow(alpha, 2.) * bessj3_5(sigma) / (bessi0(alpha) * pow(sigma, 3.5));
			else
				return  pow(PI2, 1.5) * pow(a, 3.) * pow(alpha, 2.) * bessi3_5(sigma) / (bessi0(alpha) * pow(sigma, 3.5));
		}
		else if (m == 0)
		{
			if (PI2 * a * w > alpha)
				return  pow(PI2, 1.5) * pow(a, 3.) * bessj1_5(sigma) / (bessi0(alpha)*pow(sigma, 1.5));
			else
				return  pow(PI2, 1.5) * pow(a, 3.) * bessi1_5(sigma) / (bessi0(alpha)*pow(sigma, 1.5));
		}
		else
			throw;
	}