Search in sources :

Example 1 with StandardFloatValueProcedure

use of uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure in project GDSC-SMLM by aherbert.

the class FloatDht2DTest method createData.

private static FloatDht2D createData(double cx, double cy) {
    final Gaussian2DFunction f = GaussianFunctionFactory.create2D(1, size, size, GaussianFunctionFactory.FIT_ERF_FREE_CIRCLE, null);
    final double[] a = new double[1 + Gaussian2DFunction.PARAMETERS_PER_PEAK];
    a[Gaussian2DFunction.SIGNAL] = 1;
    a[Gaussian2DFunction.X_POSITION] = cx;
    a[Gaussian2DFunction.Y_POSITION] = cy;
    a[Gaussian2DFunction.X_SD] = 1.2;
    a[Gaussian2DFunction.Y_SD] = 1.1;
    final StandardFloatValueProcedure p = new StandardFloatValueProcedure();
    p.getValues(f, a);
    return new FloatDht2D(size, size, p.values, false);
}
Also used : Gaussian2DFunction(uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction) StandardFloatValueProcedure(uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure)

Example 2 with StandardFloatValueProcedure

use of uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure in project GDSC-SMLM by aherbert.

the class Image3DAlignerTest method createData.

private FloatImage3D createData(int x, int y, int z, double cx, double cy, double cz) {
    final Gaussian2DFunction f = GaussianFunctionFactory.create2D(1, x, y, GaussianFunctionFactory.FIT_ASTIGMATISM, zModel);
    final int length = x * y;
    final float[] data = new float[z * length];
    final double[] a = new double[1 + Gaussian2DFunction.PARAMETERS_PER_PEAK];
    a[Gaussian2DFunction.SIGNAL] = 1;
    a[Gaussian2DFunction.X_POSITION] = cx;
    a[Gaussian2DFunction.Y_POSITION] = cy;
    a[Gaussian2DFunction.X_SD] = 1;
    a[Gaussian2DFunction.Y_SD] = 1;
    final StandardFloatValueProcedure p = new StandardFloatValueProcedure();
    for (int zz = 0; zz < z; zz++) {
        final double dz = zz - cz;
        // if (zz == 0 || zz == z - 1)
        // logger.fine(FunctionUtils.getSupplier("%f %f %f", dz, zModel.getSx(dz), zModel.getSy(dz));
        a[Gaussian2DFunction.Z_POSITION] = dz;
        p.getValues(f, a, data, zz * length);
    }
    return new FloatImage3D(x, y, z, data);
}
Also used : Gaussian2DFunction(uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction) StandardFloatValueProcedure(uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure)

Example 3 with StandardFloatValueProcedure

use of uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure in project GDSC-SMLM by aherbert.

the class Image2DAlignerTest method createData.

private static FloatImage2D createData(int x, int y, double cx, double cy) {
    final Gaussian2DFunction f = GaussianFunctionFactory.create2D(1, x, y, GaussianFunctionFactory.FIT_ERF_FREE_CIRCLE, null);
    final double[] a = new double[1 + Gaussian2DFunction.PARAMETERS_PER_PEAK];
    a[Gaussian2DFunction.SIGNAL] = 1;
    a[Gaussian2DFunction.X_POSITION] = cx;
    a[Gaussian2DFunction.Y_POSITION] = cy;
    a[Gaussian2DFunction.X_SD] = 1.2;
    a[Gaussian2DFunction.Y_SD] = 1.1;
    final StandardFloatValueProcedure p = new StandardFloatValueProcedure();
    return new FloatImage2D(x, y, p.getValues(f, a));
}
Also used : Gaussian2DFunction(uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction) StandardFloatValueProcedure(uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure)

Example 4 with StandardFloatValueProcedure

use of uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure in project GDSC-SMLM by aherbert.

the class FloatDht3DTest method createData.

private static FloatDht3D createData(double cx, double cy, double cz) {
    final Gaussian2DFunction f = GaussianFunctionFactory.create2D(1, size, size, GaussianFunctionFactory.FIT_ASTIGMATISM, zModel);
    final int length = size * size;
    final float[] data = new float[size * length];
    final double[] a = new double[1 + Gaussian2DFunction.PARAMETERS_PER_PEAK];
    a[Gaussian2DFunction.SIGNAL] = 1;
    a[Gaussian2DFunction.X_POSITION] = cx;
    a[Gaussian2DFunction.Y_POSITION] = cy;
    a[Gaussian2DFunction.X_SD] = 1;
    a[Gaussian2DFunction.Y_SD] = 1;
    final StandardFloatValueProcedure p = new StandardFloatValueProcedure();
    for (int z = 0; z < size; z++) {
        a[Gaussian2DFunction.Z_POSITION] = z - cz;
        p.getValues(f, a, data, z * length);
    }
    return new FloatDht3D(size, size, size, data, false);
}
Also used : Gaussian2DFunction(uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction) StandardFloatValueProcedure(uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure)

Aggregations

StandardFloatValueProcedure (uk.ac.sussex.gdsc.smlm.function.StandardFloatValueProcedure)4 Gaussian2DFunction (uk.ac.sussex.gdsc.smlm.function.gaussian.Gaussian2DFunction)4