Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The empty tile threshold is wrong #181

Open
raacampbell opened this issue Dec 10, 2020 · 1 comment
Open

The empty tile threshold is wrong #181

raacampbell opened this issue Dec 10, 2020 · 1 comment

Comments

@raacampbell
Copy link
Contributor

raacampbell commented Dec 10, 2020

Just looking at fm_167 is obvious this threshold is wrong. I will need it soon for the comb correction so ought to go back and get this working well. All tiles are larger than the threshold. I don't even understand how that happens.

bottomFivePercent = mu(1:round(length(mu)*0.05));
if std(bottomFivePercent)>0.6
  fprintf('%s - Empty tile threshold not trustworthy (STD=%0.2f), setting to mean of dimmest tile.\n',...
   mfilename, std(bottomFivePercent))
  emptyTileThresh=mu(1);
else
  STDvals=zeros(size(mu));
  for ii=1:length(mu)
       STDvals(ii)=std(mu(1:ii));
  end
  f=find(STDvals<0.085); %A threshold that we'll consider to represent the empty tiles
  emptyTileThresh=mu(f(end))*1.01;
end

This is currently done by writeTileStats in the private directory in preProcessTiles. emptyTileThresh is currently only used by calcAverageMatFiles.

In any case, we might well have sections with no empty tiles because of autoROI.

One way that could work is to take a histogram of the tile intensities. Take the mode. Then add a bin or two and call that the the empty tile threshold. This will work for sections with enough tiles. Remember we may have sections with no empty tiles because of the autoROI. Cases where the user changes wavelength during an acquisition might also throw things off.

@raacampbell
Copy link
Contributor Author

Use a gmm? This is working well for the autoROI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant