use of uk.ac.sussex.gdsc.core.data.utils.IdentityTypeConverter in project GDSC-SMLM by aherbert.
the class PeakResultConversionHelper method getConverters.
/**
* Gets the converters for the peak results parameters. This includes the standard parameters and
* any additional parameters defined in the PSF. If a parameter unit type is undefined then an
* identity converter is created.
*
* @return the converters
*/
public Converter[] getConverters() {
final LocalList<Converter> list = new LocalList<>(5);
getIntensityConverter();
getDistanceConverter();
list.add(intensityConverter);
list.add(intensityConverter);
list.add(distanceConverter);
list.add(distanceConverter);
list.add(distanceConverter);
if (psf != null) {
try {
for (final PSFParameter p : PsfHelper.getParameters(psf)) {
switch(p.getUnit()) {
case DISTANCE:
list.add(distanceConverter);
break;
case INTENSITY:
list.add(intensityConverter);
break;
case ANGLE:
list.add(getAngleConverter());
break;
default:
list.add(new IdentityTypeConverter<>(p.getUnit()));
}
}
} catch (final ConfigurationException ex) {
// Ignore
}
}
return list.toArray(new Converter[0]);
}
Aggregations