keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/sample/SampleFactory_2016.java
.java
200
14
package smlms.sample; public class SampleFactory_2016 { public SampleFactory_2016() { new SampleFactoryDialog(); } public static void main(String args[]) { new SampleFactoryDialog(); } }
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/sample/Beads_Generator.java
.java
3,263
120
package smlms.sample; import ij.IJ; import java.util.ArrayList; import smlms.file.PositionFile; import smlms.tools.Point3D; import smlms.tools.PsRandom; import additionaluserinterface.WalkBar; public class Beads_Generator { private int nx = 6400; // 320 * 20 = 6400nm private int ny = 6400; // 320 * 20 = 640...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/Description.java
.java
6,919
222
package smlms.file; import ij.IJ; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import smlms.tools.Tools; public class Description { private HashMap<Integer, Fields> fields = new HashMap<Inte...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/FluorophoreComponent.java
.java
6,254
196
package smlms.file; import ij.IJ; import imageware.ImageWare; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JLabel; import ...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/Fluorophores_Explorer.java
.java
1,134
45
package smlms.file; import ij.IJ; import ij.gui.GUI; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import additionaluserinterface.GridPanel; import additionaluserinterface.Settings; public class Fluorophor...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/Fields.java
.java
1,203
56
package smlms.file; import java.util.HashMap; import java.util.Iterator; public enum Fields { ID ("id"), X ("x"), // in nm Y ("y"), // in nm Z ("z"), // in nm FRAME ("frame"), PHOTONS ("photons"), CHANNEL ("channel"), FRAMEON ("frameon"), // number of frame ON TOTAL ("total"), BACK...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/TableStatistics.java
.java
3,263
134
package smlms.file; import ij.IJ; import java.awt.Dimension; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTab...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/Fluorophores.java
.java
6,447
244
package smlms.file; import ij.IJ; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import javax.swing.JLabel; public class Fluorophores extends Ar...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/LinearTransformAxis.java
.java
568
37
package smlms.file; import java.util.ArrayList; public class LinearTransformAxis { public double a = 1.0; public double b = 0.0; public LinearTransformAxis() { } public LinearTransformAxis(double b) { this.b = b; } public LinearTransformAxis(double a, double b) { this.a = a; this.b = b; } public...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/Fluorophore.java
.java
5,217
182
// ========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), // http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique F�d�rale de Lausanne (EPFL), Lausanne, // Switzerland // ...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/Description_Builder.java
.java
4,863
173
package smlms.file; import ij.IJ; import ij.gui.GUI; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/PositionFile.java
.java
1,405
58
package smlms.file; import ij.IJ; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import smlms.tools.Point3D; import additionaluserinterface.WalkBar; public class PositionFile { private String path; private String filename; p...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/file/Statistics.java
.java
871
44
package smlms.file; public class Statistics { public String name; public int count; public double min; public double max; public double mean; public double stdev; public double histo[]; public double domain[]; public double evolution[] = new double[1]; private int nbins = 100; private boolean init = fals...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/SequenceFactory_Batch_2016.java
.java
7,840
222
package smlms.simulation; import ij.IJ; import ij.ImagePlus; import ij.ImageStack; import ij.gui.GenericDialog; import ij.io.FileSaver; import ij.io.Opener; import imageware.Builder; import imageware.ImageWare; import java.io.File; import java.util.ArrayList; import smlms.file.Description; import smlms.file.Fluoroph...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/SequenceFactory.java
.java
16,194
475
package smlms.simulation; import ij.IJ; import ij.ImagePlus; import ij.ImageStack; import ij.gui.Overlay; import ij.gui.Roi; import ij.gui.TextRoi; import ij.io.FileSaver; import ij.io.Opener; import ij.process.FloatProcessor; import imageware.ImageWare; import java.io.BufferedWriter; import java.io.File; import java...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/SequenceReporting.java
.java
18,608
418
package smlms.simulation; import ij.IJ; import ij.ImagePlus; import ij.io.FileSaver; import ij.io.Opener; import imageware.ImageWare; import java.io.File; import java.util.ArrayList; import smlms.tools.Tools; import smlms.tools.Zip; public class SequenceReporting { private SequenceFactoryDialog dialog; public ...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/SequenceFactory_2016.java
.java
212
14
package smlms.simulation; public class SequenceFactory_2016 { public SequenceFactory_2016() { new SequenceFactoryDialog(); } public static void main(String args[]) { new SequenceFactoryDialog(); } }
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/ProjectionModule.java
.java
3,016
97
package smlms.simulation; import ij.IJ; import ij.ImagePlus; import ij.io.FileSaver; import ij.process.FloatProcessor; import ij.process.ImageConverter; import java.io.File; public class ProjectionModule { private FloatProcessor maxPR; // Working resolution private FloatProcessor maxCR; // Camera resolution pri...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/DownsamplingModule.java
.java
532
23
package smlms.simulation; public class DownsamplingModule { public float[][] run(float[][] image, int downsampling) { int mx = image.length; int my = image[0].length; int nx = mx / downsampling; int ny = my / downsampling; float[][] camera = new float[nx][ny]; for(int x=0; x<nx; x++) for(int y=0; y<ny;...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/Generate_Beads.java
.java
2,321
72
package smlms.simulation; import ij.IJ; import smlms.file.Description; import smlms.file.Fluorophores; public class Generate_Beads { public static String path = "/Users/sage/Desktop/beads/beads6/"; public static String pathPSF = "/Users/sage/Desktop/beads/psf/"; public static String filename = path + "activations...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/NoiseModule.java
.java
7,383
250
package smlms.simulation; import ij.IJ; import imageware.Builder; import imageware.ImageWare; import java.io.PrintStream; import org.apache.commons.math3.distribution.GammaDistribution; import org.apache.commons.math3.distribution.PoissonDistribution; import smlms.tools.ArrayOperations; import smlms.tools.Chrono; im...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/AutofluorescenceModule.java
.java
6,558
228
package smlms.simulation; import ij.IJ; import ij.ImagePlus; import ij.ImageStack; import ij.process.FloatProcessor; import imageware.Builder; import imageware.ImageWare; import java.util.Vector; import org.apache.commons.math3.distribution.PoissonDistribution; import smlms.file.Fluorophores; import smlms.tools.Arr...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/ReportHTML.java
.java
2,542
80
package smlms.simulation; import ij.IJ; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.PrintStream; public class ReportHTML extends PrintStream { public ReportHTML(Strin...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/SequenceFactoryDialog.java
.java
40,587
985
package smlms.simulation; import ij.IJ; import ij.gui.GUI; import imageware.ImageWare; import java.awt.Color; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.io.File; import java.util.A...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/AutofluorescenceSource.java
.java
2,289
74
package smlms.simulation; import imageware.ImageWare; import smlms.tools.PsRandom; public class AutofluorescenceSource { private double xo; private double yo; private double scale; private double size; private double xdiffusion[] = new double[10]; private double ydiffusion[] = new double[10]; private PsRandom...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/Viewport.java
.java
4,452
193
package smlms.simulation; import ij.IJ; import java.io.PrintStream; import smlms.file.Fluorophore; import smlms.tools.Point3D; import smlms.tools.Tools; public class Viewport { private double fovx; // nano private double fovy; // nano private double thickness; // nano private double pixelsize; // nano priv...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/CameraModule.java
.java
3,099
103
package smlms.simulation; import ij.ImagePlus; import ij.io.FileSaver; import imageware.Builder; import imageware.ImageWare; import smlms.tools.Tools; public class CameraModule { public static String[] names = new String[] {"TIFF 8-bits", "TIFF 16-bits", "TIFF 32-bits", "JPEG"}; public static String[] quantization...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/Zip_Sequences.java
.java
1,563
53
package smlms.simulation; import ij.IJ; import ij.ImagePlus; import ij.ImageStack; import ij.io.FileSaver; import ij.io.Opener; import java.io.File; import smlms.plugins.Merge_Sequence_Frames; import smlms.tools.Zip; public class Zip_Sequences { public static String path = "/Users/dsage/Desktop/beads/beads6/"; p...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/PSFModule.java
.java
19,151
584
package smlms.simulation; import ij.IJ; import ij.ImagePlus; import ij.WindowManager; import ij.io.FileSaver; import ij.io.Opener; import ij.process.ImageProcessor; import imageware.Builder; import imageware.ImageWare; import java.io.File; import smlms.file.Fluorophore; import smlms.file.Fluorophores; import smlms.s...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/gl/Bessel.java
.java
2,709
76
package smlms.simulation.gl; //import ij.IJ; /* * This class evaluates the Bessel function J0(x). * It uses the polynomial approximations on p. 369-70 of Abramowitz & Stegun. * The error in J0 is supposed to be less than or equal to 5 x 10^-8. * The error in J1 is supposed to be less than or equal to 4 x 10^-8, relat...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/gl/PSFParameters.java
.java
3,686
144
package smlms.simulation.gl; //import ij.IJ; public class PSFParameters { public double affineTransformA[][] = new double[][] {{1, 0}, {0, 1}}; public double affineTransformB[] = new double[] {0, 0}; /* Optical acquisition Parameters (from the user) */ /* ------------------------------------------------ */ ...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/gl/PSFValue.java
.java
4,981
164
package smlms.simulation.gl; /** * Calculating values of the Gibson and Lanni PSF model * **/ public class PSFValue { // Gibson & Lanni parameters of the acquisition public PSFParameters p; // Gibson and Lanni parameters public double NA = 1.4; public double LAMBDA = 500E-9; public int MAGNIFICATION = 100...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Cosine.java
.java
1,218
40
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/ZFunction.java
.java
1,262
54
package smlms.simulation.defocussed2dfunction; public class ZFunction { final static public int ZFUNC_EXPO = 0; final static public int ZFUNC_ANGLE = 1; final static public int ZFUNC_EXPO2 = 2; final static public int ZFUNC_CONSTANT = 3; static public String[] names = new String[] {"Exponential", "Li...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Lorentz.java
.java
1,309
43
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Support.java
.java
818
22
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Rectangle.java
.java
1,136
39
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/DoubleHelix.java
.java
1,501
48
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Defocussed2DFunction.java
.java
862
21
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Airy.java
.java
1,284
42
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Linear.java
.java
1,140
38
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/ElongatedGaussian.java
.java
1,568
52
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Astigmatism.java
.java
1,305
43
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Simulator/Simulator-Java/src/smlms/simulation/defocussed2dfunction/Gaussian.java
.java
1,257
40
//========================================================================================= // // Project: Localization Microscopy // // Author : Daniel Sage, Biomedical Imaging Group (BIG), http://bigwww.epfl.ch/sage/ // // Organization: Ecole Polytechnique Federale de Lausanne (EPFL), Lausanne, Switzerland // // Cond...
Java
2D
SMLM-Challenge/Challenge2016
Tools/verifications/check_psf.py
.py
2,928
85
#!/usr/bin/env python # # Check that the PSF in the simulations matches the reference PSF. # # Hazen 04/16 # import numpy import sys import tifffile if (len(sys.argv) != 4): print "usage: <psf.tiff> <images dir> <activations.csv>" exit() # # This assumes that the z values in the activations file are # in the...
Python
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computeSplineBasis3.m
.m
276
12
function x = computeSplineBasis3(x) %n = 3 x = abs(x); %ind = (x >= 0 & x < 1); %x(ind) = 2/3 - x(ind).^2 + x(ind).^3/2; %ind = (x >= 1 & x < 2); %x(ind) = (2 - x(ind)).^3/6; %ind = (x >= 2); %x(ind) = 0; x = 1/12*(abs(x - 2).^3 - 4*abs(x - 1).^3 + 3*(x - 2).*x.^2 + 4); end
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/ktensor.m
.m
196
8
function GR = ktensor(gr) if length(gr)==2 GR = kron(gr{1}, gr{2}'); else GRXY = kron(gr{1}, gr{2}'); GR = arrayfun(@(z) z*GRXY,gr{3},'UniformOutput',false); GR = cat(3,GR{:}); end
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/prob_dens.m
.m
675
21
function prob_distr = prob_dens(camera_model,gain,eta,u) %Probability density of camera model for a single initial photonelectron if min(u)<0 error('u must be positive'); end switch camera_model case 'EMCCD' %2004 Basden / 2016 Chao, exponential distribbution with param %1/gain, plot p(u) for ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/main_EMCCD.m
.m
509
22
%Implementation from m = 300; p = 3e2; c = unique(max(-2e3:2e4 + m*p,0)); n = 1; gpm = @(c) 1/(factorial(n-1).*m.^n).*c.^(n-1).*exp(-c/m); %figure(2); %plot(c,gpm(c)); Gpm = @(c) exp(-p).*(c==0) + sqrt(p./(c.*m)).*exp(-c./m - p).*besseli(1,2*sqrt(c.*p./m)); prob_distr = prob_dens('EMCCD',m, p, c); figure(3); plot...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computeIntegralDer.m
.m
5,856
110
function integr = computeIntegralDer(coeffxy,pos_mol,NsplPix,delta,cam_siz,der) %Output: siz %Integrate spline basis function of degree 2/3 for der/other dimension rsp. %Use integral relation with (sum of shifted) basis func of degree 3/4 rsp. %For one camera pixel (others are shifted version of this integral) siz = si...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computeEta.m
.m
2,211
58
function eta = computeEta(pos_mol,c,delta,cam_siz) %siz = sqrt(Ntotpix)*ones(1,2); %siz = ceil([Nx*step(1)/sqrt(Ntotpix),Ny*step(2)/sqrt(Ntotpix)]);% %campix_step = step(1:2).*NsplPix; siz = size(c); Bz = computeSplineBasis3(pos_mol(3)/delta(3) - (1:siz(3))');% Nz x 1 NsplPix = ceil(siz(1:2)./cam_siz);%# splines b...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/save_parfor.m
.m
449
21
function save_parfor(name_mat, struct2save) % save_parfor % % Inputs: name_mat: where the .mat will be saved, absolute path is % recommended. % varargin: the variables will be saved, don't pass on the names of % the variables, i.e, strings. % % Outputs: % % % EXAM...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/main_hist_z_photon.m
.m
283
8
ind = diff(activations.xnano([1:end,end]))==0 & diff(activations.ynano([1:end,end]))==0 & diff(activations.znano([1:end,end]))==0; Nmol = nnz(ind); ind = ~ind; tmp = cumsum(ind); for kk = 1:Nmol Nphotons(kk) = sum(activations.intensity(kk==tmp)); Nact(kk) = nnz(kk==tmp); end
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/main_extract_photons_mat.m
.m
720
22
z_oi = [-15,15]; fold_name = 'res'; modality = 'DH'; tmp = struct2table(dir(fullfile(fold_name,modality,'stack_*'))); Np_set = height(tmp); %% z_vec = -750:10:750; ind_oi = z_vec > z_oi(1) & z_vec < z_oi(2); fprintf('Number of z-slices per bin : %i\n', nnz(ind_oi)); CRLB = table(ones(Np_set,1),ones(Np_set,1),ones(N...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computeCubicSplineCoefs.m
.m
2,203
69
function coefs=computeCubicSplineCoefs(im) %------------------------------------------------- % function coefs=computeCubicSplineCoefs(im) % % Decompose the image im on a B-spline basis % % Exemple (in 2D): % im=double(imread('cell.tif')); % coefs=computeCubicSplineCoefs(im); % sz=size(im); % [C,R]=mesh...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/probCamera.m
.m
1,820
47
function pkz = probCamera(z,nu,sig,umin,umax,gain,cam_model,eta,mode,reltol,abstol,Npoints) %,step_int %reltol = 1e-8; %abstol = 1e-11; %z = vpa(z); switch cam_model case 'EMCCD' switch mode case 0 %simplified expr. %integrate over u from umin to umax pkz = integ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/noise_coef_fct_vec.m
.m
672
27
function coeff = noise_coef_fct_vec(z, umin, umax, eta, sig, nu, gain, cam_model, reltol, abstol,Npoints) %fprintf('doing vectorial way...'); %arrayfun is slower than a loop (+0.05 sec/element) %tic %coeff = arrayfun(@(x) noise_coef_fct(x, umin, umax, eta, sig, nu, gain, cam_model, reltol, abstol),z); %toc %tic coef...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/main_test_bounds.m
.m
4,873
134
%U: 75, Z: 50 for nu = 0.000213528237267334 maxsigU = 100;%25:25:200; maxsigZ = 100;%[25:25:200];%[10,25,50,75,100,125,150,175]; minSigU = 100; minSigZ = 100; minNu = 1e-5; maxNu = 250; Ninterval = 16; Npoints = 5e3; parpool(min(feature('NumCores'),Ninterval)); camera_model = 'EMCCD';%'none';% %nphoton = 5e8; QE = 0.9...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/main_cramer_rao.m
.m
3,710
133
%Cramer-Rao bounds clear dir_name = '~/Documents/SMLM/analysis/psf/';%'~/Downloads/PSF GL 200x200x151.tif';% modality = 'AS'; Nz = 151; [PSF,summedPSF,Nx,Ny] = load_PSF(dir_name,modality,Nz); %% Fit cubic spline from 3D psf %[Nx,Ny,Nz] = size(PSF); d = [3*ones(1,3),0,0,0];%degree of Bsplines dx = 10;%nm dy = 10;%nm dz...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computeSplineBasis2.m
.m
64
5
function y = computeSplineBasis2(x) y = max(1 - abs(x),0); end
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/noise_coef_fct.m
.m
2,558
62
function coeff = noise_coef_fct(z, umin, umax, eta, sig, nu, gain,cam_model,reltol,abstol,Npoints) %NOISE_COEF_FCT %syms u; integr_type = 2; if true %max(-(umin:umax).*((umin:umax) + 2*eta - 2*z)/(2*sig^2) - (umin:umax)/gain) > 70 % No simplification pkz = probCamera(z,nu,sig,umin,umax,gain,cam_model,eta,...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computedEta.m
.m
3,192
73
function deta = computedEta(N, c, Ntotpix, delta, pos_mol,mu,cam_siz) %Output : Ncampix x ndims(c) %Ncampix: total number of camera pixel deta = zeros(Ntotpix,ndims(c)); [Nx,Ny,Nz] = size(c);% V := prod(size(c)) %cam_siz = sqrt(Ntotpix)*ones(1,2); NsplPix = ceil([Nx,Ny]./cam_siz);%# splines basis fct per camera pixel...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computeCramerRao.m
.m
3,941
110
function [I,cam_coef,nu,deta,par] = computeCramerRao(c,delta,cam_pix,pos_mol,varargin) %c: spline coefficients of PSF fitting %step: step between knot %cam_pix: camera pixel size in the object plane %pos: molecule position (0,0) at the top left par = inputParser; addParameter(par,'QE',0.9,@isnumeric); addParameter(par...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/load_PSF.m
.m
1,605
57
function [PSF,summed,Nx,Ny] = load_PSF(dir_name, modality,Nz) switch modality case {'2D','AS','DH'} fname = fullfile(dir_name, sprintf('%s-Exp.tif', modality)); case 'BP' fname{1} = fullfile(dir_name, sprintf('%s+250.tif', modality)); fname{2} = fullfile(dir_name, sprintf('%s-250.tif', ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/evaluateCubicSpline.m
.m
5,357
148
function y=evaluateCubicSpline(coefs,x) %------------------------------------------------- % function y=evaluateCubicSpline(coefs,x) % % See the functions below for a description of the parameters % % Exemple (in 2D): % im=double(imread('cell.tif')); % coefs=computeCubicSplineCoefs(im); % sz=size(im); % ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/main_auto_run.m
.m
3,867
140
%Cramer-Rao bounds clear modality_set = {'BP','AS','DH','2D'}; Nmod = length(modality_set); dir_name = '~/Documents/SMLM/analysis/psf/';%'~/Downloads/PSF GL 200x200x151.tif';% Nz = 151; %%0 for l = 1%:Nmod modality = modality_set{l}; [PSF,summedPSF,Nx,Ny] = load_PSF(dir_name,modality,Nz); %% Fit cubic ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/CramerRao/computeSplineBasis4.m
.m
259
7
function x = computeSplineBasis4(x) x = 1/48*((x - 5/2).^4.*(-sign(x - 5/2)) + 5*(x - 3/2).^4.*sign(x - 3/2)... - 10*(x - 1/2).^4.*sign(x - 1/2) + 10*(x + 1/2).^4.*sign(x + 1/2) ... - 5*(x + 3/2).^4.*sign(x + 3/2) + (x + 5/2).^4.*sign(x + 5/2)); end
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/wobble_correction/generateWobbleStandalone.m
.m
25
2
mcc -mv wobble_correct.m
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/wobble_correction/wobble_correct.m
.m
39,024
1,267
function varargout = wobble_correct(varargin) % WOBBLE_CORRECT MATLAB code for wobble_correct.fig % WOBBLE_CORRECT, by itself, creates a new WOBBLE_CORRECT or raises the existing % singleton*. % % H = WOBBLE_CORRECT returns the handle to a new WOBBLE_CORRECT or the handle to % the existing singleton...
MATLAB
2D
SMLM-Challenge/Challenge2016
Tools/FileConversionUtilities/tiffs_to_tiff.py
.py
466
23
#!/usr/bin/env python # # Convert a mess of tiff files into a single multi-page tiff file. # # Hazen 04/16 # import glob import sys import tifffile if (len(sys.argv) != 3): print("usage: <tiff file> <tiff dir>") exit() tiff_files = sorted(glob.glob(sys.argv[2] + "*.tif")) with tifffile.TiffWriter(sys.argv[1...
Python
2D
SMLM-Challenge/Challenge2016
Tools/pupil_functions/zernike.c
.c
3,009
152
/* * C library for calculating Zernike polynomials. * Has issues for polynomials where n >= 13? * * Hazen 10/14 * * Compilation instructions: * * Linux: * gcc -fPIC -g -c -Wall zernike.c * gcc -shared -Wl,-soname,zernike.so.1 -o zernike.so.1.0.1 zernike.o -lc * ln -s zernike.so.1.0.1 zernike.so * * Wind...
C
2D
SMLM-Challenge/Challenge2016
Tools/pupil_functions/pupil_math.py
.py
8,308
241
#!/usr/bin/python # # Some math for calculating PSFs from pupil functions. # # All units are in microns. # # Hazen 03/16 # import math import numpy import scipy import scipy.fftpack import tifffile import zernike_c as zernikeC class Geometry(object): ## __init__ # # @param size The number of pixels in t...
Python
2D
SMLM-Challenge/Challenge2016
Tools/pupil_functions/zernike_c.py
.py
1,741
65
#!/usr/bin/python # # Simple Python interface to zernike.c # # Hazen 10/14 # import ctypes import numpy from numpy.ctypeslib import ndpointer import os import sys directory = os.path.dirname(__file__) if (directory == ""): directory = "./" else: directory += "/" if(sys.platform == "win32"): zernike = cty...
Python
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/NPC_plotter.m
.m
4,545
133
function NPC_plotter(fname,savename); %savename = fname(1:end-4); data =importdata(fname); fr = data(:,1); x= data(:,2); y= data(:,3); z= data(:,4); phot= data(:,5); %whole image rangez=[-500,500] rangex = [0,20000]; rangey = [0,20000] pixSz=20; satVal3d=0.005 satVal2d=0.005 blurSigma=3; box = [rangex(1),rangey...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/renderStormData.m
.m
5,683
229
function [srIm,yIm,xIm,density] = renderStormData(X,Y,varargin) %TODO saturate Xpercent before gamma correction %TODO use a faster gaussian filter % box = [xstart ystart xwidth yheight] %Author: S Holden pixSize=20; sigma=10; gammaVal = 1; satVal =0.0; zlim = [-600 600]; nz =10; satVal=0; isBox = false; box=[]; is3D ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/plotZcrossSection.m
.m
1,431
47
function [srIm_XZ X1] = plotZcrossSection(x,y,z,xyPos,lineWidth,rangez, pixSz,satVal,blurSigma,useAngleFormat) if ~exist('useAngleFormat','var') useAngleFormat=false; end if ~useAngleFormat Dx = (xyPos(2,1)-xyPos(1,1)); Dy = (xyPos(2,2)-xyPos(1,2)); X0 = [xyPos(1,1),xyPos(1,2)] lineLength = sqrt(D...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/stormCmap.m
.m
424
15
%--------------------- function [cmap stormHue linearHue]=stormCmap(ncolor); linearHue = linspace(0,1,ncolor); cmap=colormap(jet(ncolor)); cmaphsv=rgb2hsv(cmap); stormHue= cmaphsv(:,1); stormHue=unique(stormHue,'stable'); nVal = numel(stormHue); stormHue = [interp1(1:nVal,stormHue,linspace(1,nVal,ncolor))]'; sat = one...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/lmCompDriftCor.m
.m
679
35
function savename = lmCompDriftCor(fname ) data =importdata(fname); fr = data(:,1); x= data(:,2); y= data(:,3); z= data(:,4); if size(data,2)>4 phot= data(:,5); end drift=driftcorrection3D_so(x,y,z,fr,[]);%4th arg is the parameters arg %have to supply p even if its just empty (standard) figname = [fname(1:end-4),...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/tubulin_plotter.m
.m
5,905
178
function tubulin_plotter(fname,savename) data =importdata(fname); fr = data(:,1); x= data(:,2); y= data(:,3); z= data(:,4); phot= data(:,5); %whole image rangez=[-750,500] rangex = [0,40000]; rangey = [0,40000] pixSz=30; satVal3d=0.005 satVal2d=0.005 blurSigma=3; box = [rangex(1),rangey(1),rangex(2)-rangex(1),ran...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/driftCorrectAll.m
.m
1,316
39
%run this on a directory containing the real data csv files % Or copy to said directory %modify this list to match the files you want to analyse %Need to add to the matlab path: % 'Challenge2016\Assessment\RealDataAssessment' % 'Challenge2016\Assessment\Matlab\driftCorrection' fnameTubulinList = {... '3D-DAOSTOR...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/real3dAnalysis.m
.m
1,886
54
%run this on a directory containing the real data csv files % Or copy to said directory %modify this list to match the files you want to analyse %Need to add to path: % 'lm-challenge2016\Challenge2016\Assessment\Matlab\3dPlotTools' % 'lm-challenge2016\Challenge2016\Assessment\Matlab\driftCorrection\driftcorrection3...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/RealDataAssessment/plot3DSTORMcolorbar.m
.m
2,619
88
function h = plot3DSTORMcolorbar(dims, orientation,zLim,nTick,varargin) % PLOT_COLORBAR plot a standalone colorbar for inclusion in a publication % H = PLOT_COLORBAR(DIMS, ORIENTATION TITLE_STRING) Plot a colorbar for % inclusion in a publication. DIMS sets the length and width of the % colorbar (in v...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/rnd_loc.m
.m
431
21
function loc = rnd_loc(ave_dens,nframes,fov) %RND_LOC Random Localization % ave_dens : Number of fluorophores per frame on average % nframes : number of frame % fov : Field Of View Nmol_tot = ave_dens*nframes; if iscolumn(fov) fov = fov'; end maxInt = 1e4; loc = repmat([fov, maxInt], Nmol_tot, 1).*rand(Nmo...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/importFullPairings.m
.m
3,220
86
function pairingsMT1 = importFullPairings(filename, startRow, endRow) %IMPORTFILE Import numeric data from a text file as a matrix. % PAIRINGSMT1 = IMPORTFILE(FILENAME) Reads data from text file FILENAME % for the default selection. % % PAIRINGSMT1 = IMPORTFILE(FILENAME, STARTROW, ENDROW) Reads data from % rows...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/main_3dcolor_winners.m
.m
7,136
173
%Script for winners visualisations %2D LD 3D-DAOSTORM %2D HD SMfit %AS LD CSpline %AS HD SMolPhot %BP LD MIATool %BP HD ThunderSTORM %DH LD CSpline %DH HD CSpline clear winners = table(cell(10,1),cell(10,1),cell(10,1),'VariableNames',{'modality','density','software'}); winners.modality{1} = 'AS';winners.density{1} = '...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/gauss_render_intensity.m
.m
2,836
100
function im = gauss_render_intensity(data, sig, pix_size, im_size,doCorr) % data : list of particles Nparticles x 2-3 => (x,y)+z (opt) (nm) % sig : sigma (nm) for each dimension % pix_size % im_size, size of obtained image % varargin{1} : do the Z correction or not doNorm = 1; D = size(data,2); if isscalar(sig) si...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/main_set_param_plot.m
.m
2,145
68
%% Load pairings file resulting from assessment program clear pos path = '~/Dropbox/smlm/figures/'; software = 'SMAP';%'STORMChaser';% modality = 'BP'; dataset = 'MT1.N1.LD'; wobble = true; photonT = true; %File must be in the path fname = dir(fullfile('assessment_results',software,... sprintf('pairings____%s____%s...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/saveResults.m
.m
10,448
214
function saveResults(results, results_mol, results_graph, res_folder) %SAVERESULTS Save all the results %Save results in final file fname = ['results____',... results{1}.participant,'.csv']; fileID = fopen(strcat(res_folder,filesep,... results{1}.participant,filesep,fname),'w'); formatSpec = strcat('%s,%s,%s,%...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/importLocations.m
.m
2,519
67
function [VarName27,VarName28,VarName29,VarName30,VarName31] = importLocations(filename, startRow, endRow) %IMPORTFILE Import numeric data from a text file as column vectors. % [VARNAME27,VARNAME28,VARNAME29,VARNAME30,VARNAME31] = % IMPORTFILE(FILENAME) Reads data from text file FILENAME for the default % selecti...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/gauss_render.m
.m
2,493
88
function im = gauss_render(data, sig, pix_size, im_size,doCorr) % data : list of particles Nparticles x 2-3 => (x,y)+z (opt) (nm) % sig : sigma (nm) for each dimension % pix_size % im_size, size of obtained image % varargin{1} : do the Z correction or not D = size(data,2); for k=1:D if k==3 && doCorr data...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/main_brut_loc_plot.m
.m
2,393
65
%% Load Brut loc locup = dir(fullfile(software,'standard',sprintf('%s____%s____%s*',... dataset,modality,software))); %header = textscan(fullfile(software,'upload',locup(1).name),'Delimiter',',',0,0); locup = csvread(fullfile(software,'standard',locup(1).name),1,0); locup = array2table(locup(:,1:end),'VariableName...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/main_cmp_RMSEz_vs_z.m
.m
3,724
103
%% LOAD RMSEz vs z from one software for all modalities and plot them clear data software = 'SMAP';%'SMAP';%'MIATool'; photonT = true; dataset = 'MT3.N2.LD'; modalities = {'AS','BP','DHNPC'}; metrics = {'Jaccard','RMSEloc z','RMSEloc xy'}; path = fullfile('assessment_results',software); fdname = metrics; for kk = 1...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/savePublic_old.m
.m
9,792
194
function savePublic_old(results, results_mol, results_graph,res_folder) %SAVEPUBLIC_OLD save results in public.csv for k=1:length(results) strMod{k} = results{k}.modality; end strMod = unique(strMod); fname = 'public.csv'; if isempty(results_graph) results_graph = fill_results_graph(results); end initLen = ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/loc_metrics.m
.m
6,566
210
function [out,pairings,fig_corr] = loc_metrics(testPos, truePos, radTol, pairings, dim3D, varargin) %EVALUATION localization assessment with radius tolerance radTol % INSPIRED BY JAVA CODE OF LOCALIZATION AVAILABLE ON 2016 ISBI CHALLENGE WEBSITE % Provides usual metrics such as recall, precision, etc. % Follows Sage's ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/main_PerfvsTolRadius.m
.m
3,775
120
%% Plot the performance vs radius tolerance curves clear pos path = '~/Dropbox/smlm/figures/'; software = 'MIATool-RMS';%'SMAP' modality = 'AS'; dataset = 'MT1.N1.LD'; wobble = false; photonT = true; %File must be in the path if wobble fname = dir(fullfile('assessment_results',software,... sprintf('pairing...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/assessment_frame.m
.m
12,706
299
function perf_metrics = assessment_frame(param_input) %ASSESSMENT Performance assessment for SMLM Challenge 2016 % INPUT % param_input : parameters structure % OUTPUT % perf_metrics : structure regrouping the performance assessment results % and Gaussian rendered of gt and res in addition % Written by Thanh-an Pham, ...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/assessment_main.m
.m
6,802
169
%% ASSESSMENT PROGRAM (MAIN) NOT THE MOST RECENT (SEE ASSESSMENT_MAIN_AUTOMATIC.M) % ASSESSMENT SCRIPT written by Thanh-an Pham (EPFL): 12-Jul-2016 % Expect standardized input files in folder 'participant_name/standard' % converted by participant-specific converter script "convert_(participant_name).m" %% Parameters cl...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/main_load_4_fig.m
.m
5,708
149
%% MAIN FOR FIGURE WHEN MAT FILES AVAILABLE clear res_fold = 'assessment_results'; participants = dir(pwd); ind2rm = false(length(participants),1); for k=1:length(participants) ind2rm(k) = ~participants(k).isdir... || ~exist(fullfile(participants(k).name,'standard'),'dir'); end participants(ind2rm) = []; m...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/savePublic.m
.m
10,724
207
function savePublic(results, results_mol, results_graph,res_folder) %SAVEPUBLIC save results in public.csv for k=1:length(results) strMod{k} = results{k}.modality; end strMod = unique(strMod); fname = 'public.csv'; if isempty(results_graph) results_graph = fill_results_graph(results); end initLen = length(r...
MATLAB
2D
SMLM-Challenge/Challenge2016
Assessment/Matlab/depthcolor3D.m
.m
1,774
74
function [im2D,T1,T2,T3,L] = depthcolor3D(im,colormapType,t,dim,varargin) %DEPTHCOLOR3D Color code for depth in 3D image im %im : 3D intensity image (e.g. 3D Gaussian rendered) %colormapType : string indicating colormap type (e.g. jet, parula) %t : quantile for max intensity (0 to 1). Change the scaling of color (and %...
MATLAB