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);
}
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);
}
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));
}
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);
}
Aggregations