use of uk.ac.sussex.gdsc.smlm.function.InterpolatedPoissonFunction in project GDSC-SMLM by aherbert.
the class CameraModelAnalysis method getLikelihoodFunction.
private static LikelihoodFunction getLikelihoodFunction(CameraModelAnalysisSettings settings) {
final double alpha = 1.0 / getGain(settings);
final double noise = getReadNoise(settings);
final Model model = Model.forNumber(settings.getModel());
switch(model) {
case POISSON_PMF:
return new PoissonFunction(alpha);
case POISSON_DISRECTE:
return new InterpolatedPoissonFunction(alpha, false);
case POISSON_CONTINUOUS:
return new InterpolatedPoissonFunction(alpha, true);
case POISSON_GAUSSIAN_PDF:
case POISSON_GAUSSIAN_PMF:
final PoissonGaussianConvolutionFunction f1 = PoissonGaussianConvolutionFunction.createWithStandardDeviation(alpha, noise);
f1.setComputePmf(model == Model.POISSON_GAUSSIAN_PMF);
return f1;
case POISSON_GAUSSIAN_APPROX:
return PoissonGaussianFunction2.createWithStandardDeviation(alpha, noise);
case POISSON_POISSON:
return PoissonPoissonFunction.createWithStandardDeviation(alpha, noise);
case POISSON_GAMMA_GAUSSIAN_PDF_CONVOLUTION:
return PoissonGammaGaussianConvolutionFunction.createWithStandardDeviation(alpha, noise);
case POISSON_GAMMA_PMF:
return PoissonGammaFunction.createWithAlpha(alpha);
case POISSON_GAMMA_GAUSSIAN_APPROX:
case POISSON_GAMMA_GAUSSIAN_PDF_INTEGRATION:
case POISSON_GAMMA_GAUSSIAN_PMF_INTEGRATION:
case POISSON_GAMMA_GAUSSIAN_SIMPSON_INTEGRATION:
case POISSON_GAMMA_GAUSSIAN_LEGENDRE_GAUSS_INTEGRATION:
final PoissonGammaGaussianFunction f2 = new PoissonGammaGaussianFunction(alpha, noise);
f2.setMinimumProbability(0);
f2.setConvolutionMode(getConvolutionMode(model));
// The function should return a PMF/PDF depending on how it is used
f2.setPmfMode(!settings.getSimpsonIntegration());
return f2;
default:
throw new IllegalStateException();
}
}
Aggregations