use of uk.ac.sussex.gdsc.smlm.model.FluorophoreSequenceModel in project GDSC-SMLM by aherbert.
the class CreateData method removeFilteredFluorophores.
/**
* Remove all fluorophores which were not drawn.
*
* @param fluorophores the fluorophores
* @param localisations the localisations
* @return the filtered list
*/
private List<? extends FluorophoreSequenceModel> removeFilteredFluorophores(List<? extends FluorophoreSequenceModel> fluorophores, List<LocalisationModel> localisations) {
if (fluorophores == null) {
return null;
}
// movingMolecules will be created with an initial capacity to hold all the unique IDs
final TIntHashSet idSet = new TIntHashSet((movingMolecules != null) ? movingMolecules.capacity() : 0);
for (final LocalisationModel l : localisations) {
idSet.add(l.getId());
}
final List<FluorophoreSequenceModel> newFluorophores = new ArrayList<>(idSet.size());
for (final FluorophoreSequenceModel f : fluorophores) {
if (idSet.contains(f.getId())) {
newFluorophores.add(f);
}
}
return newFluorophores;
}
Aggregations