Search in sources :

Example 1 with NotNull

use of uk.ac.sussex.gdsc.core.annotation.NotNull in project GDSC-SMLM by aherbert.

the class TsfPeakResultsReader method getOptions.

/**
 * Gets the options for reading the results.
 *
 * @return the options
 */
@NotNull
public ResultOption[] getOptions() {
    if (!isMulti()) {
        return ResultOption.EMPTY_ARRAY;
    }
    final ResultOption[] options = new ResultOption[4];
    int count = 0;
    if (spotList.getNrChannels() > 1) {
        options[count++] = createOption(1, "Channel", spotList.getNrChannels(), 1, false);
    }
    if (spotList.getNrSlices() > 1) {
        options[count++] = createOption(2, "Slice", spotList.getNrSlices(), 0, true);
    }
    if (spotList.getNrPos() > 1) {
        options[count++] = createOption(3, "Position", spotList.getNrPos(), 0, true);
    }
    if (spotList.getFluorophoreTypesCount() > 1) {
        // Build a string for the allowed value to provide space for the description
        final String[] values = new String[spotList.getFluorophoreTypesCount()];
        for (int i = 0; i < spotList.getFluorophoreTypesCount(); i++) {
            final FluorophoreType type = spotList.getFluorophoreTypes(i);
            String value = Integer.toString(type.getId());
            if (type.hasDescription()) {
                value += ":" + type.getDescription();
            }
            if (type.hasIsFiducial()) {
                value += ":fiducial=" + type.getIsFiducial();
            }
            values[i] = value;
        }
        options[count++] = new ResultOption(4, "Fluorophore type", values[0], values);
    }
    return Arrays.copyOf(options, count);
}
Also used : FluorophoreType(uk.ac.sussex.gdsc.smlm.tsf.TSFProtos.FluorophoreType) NotNull(uk.ac.sussex.gdsc.core.annotation.NotNull)

Aggregations

NotNull (uk.ac.sussex.gdsc.core.annotation.NotNull)1 FluorophoreType (uk.ac.sussex.gdsc.smlm.tsf.TSFProtos.FluorophoreType)1