LidkeLab/smite

smi_core.FindROI issue: multiple ROI candidates generated for single emitter

Opened this issue · 1 comments

It seems that smi_core.FindROI is (sometimes) generating multiple boxes for the same emitter in a single frame.

Example where this does happen:

SMD = smi_core.SingleMoleculeData.createSMD();
SMD.X = 16;
SMD.Y = SMD.X;
SMD.FrameNum = 1:numel(SMD.X);
SMD.Photons = 1e3 * ones(size(SMD.X));
SMD.Bg = zeros(size(SMD.X));
SMD.YSize = 32;
SMD.XSize = 32;
SMD.NFrames = numel(SMD.X);
SMD.NDatasets = 1;
SMD.PSFSigma = 1.3;
[Model] = smi_sim.GaussBlobs.gaussBlobImage(SMD);
SMF = smi_core.SingleMoleculeFitting;
SMF.Fitting.PSFSigma = mean(SMD.PSFSigma);
LD = smi_core.LocalizeData(Model, SMF);
[SMD, SMDPreThresh] = LD.genLocalizations();

Looking at smi_core.LocalizeData.genLocalizations() line 30 there are two ROIs output from FindROI.findROI()

Example where this doesn't happen:

SMD = smi_core.SingleMoleculeData.createSMD();
SMD.X = 8;
SMD.Y = SMD.X;
SMD.FrameNum = 1:numel(SMD.X);
SMD.Photons = 1e3 * ones(size(SMD.X));
SMD.Bg = zeros(size(SMD.X));
SMD.YSize = 16;
SMD.XSize = 16;
SMD.NFrames = numel(SMD.X);
SMD.NDatasets = 1;
SMD.PSFSigma = 1.3;
[Model] = smi_sim.GaussBlobs.gaussBlobImage(SMD);
SMF = smi_core.SingleMoleculeFitting;
SMF.Fitting.PSFSigma = mean(SMD.PSFSigma);
LD = smi_core.LocalizeData(Model, SMF);
[SMD, SMDPreThresh] = LD.genLocalizations();

The box finder uses the operation pixel==maxpixel from a maximum pixel filter. In rare cases, much more likely in noise-free model data, there can be two identical pixels. Boxes will be returned for both. We should implement a localization combiner algorithm somewhere in LocalizeData.