FluorophoreGenerator

public class FluorophoreGenerator

Populates a field of view with fluorophores. The FluorophoreGenerator contains a number of methods for creating actual fluorophore instances and in different arrangements, such as placing them on a grid, randomly distributing them in the FOV, and placing them according to input from a text file.

Author:Marcel Stefko, Kyle M. Douglass

Methods

generate3DFluorophoresGrid

public static ArrayList<Fluorophore3D> generate3DFluorophoresGrid(int spacing, Camera cam, FluorophoreProperties fluo)
Parameters:
  • spacing
  • cam
  • fluo

generateFluorophoresFromCSV

public static ArrayList<DefaultFluorophore> generateFluorophoresFromCSV(File file, Camera camera, PSFBuilder psfBuilder, FluorophoreProperties fluorProp, boolean rescale)

Parse a CSV file and generate fluorophores from it.

Parameters:
  • file – The CSV file. If this is null, then a dialog is opened.
  • camera – The camera for determining the size of the field of view.
  • psfBuilder – Builder for calculating microscope PSFs.
  • fluorProp – The fluorophore dynamics properties.
  • rescale – if true, positions are rescaled to fit into frame, otherwise positions outside of frame are cropped
Throws:
  • IOException
  • FileNotFoundException
Returns:

list of fluorophores.

generateFluorophoresGrid

public static ArrayList<DefaultFluorophore> generateFluorophoresGrid(int spacing, Camera cam, FluorophoreProperties fluo)

Generate a rectangular grid of fluorophores

Parameters:
  • spacing – distance between nearest neighbors
  • cam – Camera
  • fluo – type of fluorophore
Returns:

The list of fluorophores.

generateFluorophoresGrid2D

public static ArrayList<DefaultFluorophore> generateFluorophoresGrid2D(int spacing, Camera camera, PSFBuilder psfBuilder, FluorophoreProperties fluorProp)

Generate a rectangular grid of fluorophores.

Parameters:
  • spacing – The distance along the grid between nearest neighbors.
  • camera – The camera for determining the size of the field of view.
  • psfBuilder – Builder for calculating microscope PSFs.
  • fluorProp – The fluorophore dynamics properties.
Returns:

The list of fluorophores.

generateFluorophoresGrid3D

public static ArrayList<DefaultFluorophore> generateFluorophoresGrid3D(int spacing, double zLow, double zHigh, Camera camera, PSFBuilder psfBuilder, FluorophoreProperties fluorProp)

Create fluorophores on a 2D grid and step-wise in the axial direction.

Parameters:
  • spacing – The distance along the grid between nearest neighbors.
  • zLow – The lower bound on the range in z in units of pixels.
  • zHigh – The upper bound on the range in z in units of pixels.
  • camera – The camera for determining the size of the field of view.
  • psfBuilder – Builder for calculating microscope PSFs.
  • fluorProp – The fluorophore dynamics properties.
Returns:

The list of fluorophores.

generateFluorophoresRandom

public static ArrayList<DefaultFluorophore> generateFluorophoresRandom(int n_fluos, Camera cam, FluorophoreProperties fluo)

Randomly populate the field of view with fluorophores.

Parameters:
  • n_fluos – number of emitters to be generated
  • cam – camera properties
  • fluo – fluorophore properties

generateFluorophoresRandom2D

public static ArrayList<DefaultFluorophore> generateFluorophoresRandom2D(int numFluors, Camera camera, PSFBuilder psfBuilder, FluorophoreProperties fluorProp)

Randomly populate the field of view with fluorophores.

Parameters:
  • numFluors – The number of fluorophores to add to the field of view.
  • camera – The camera for determining the size of the field of view.
  • psfBuilder – Builder for calculating microscope PSFs.
  • fluorProp – The fluorophore dynamics properties.
Returns:

The list of fluorophores.

generateFluorophoresRandom3D

public static ArrayList<DefaultFluorophore> generateFluorophoresRandom3D(int numFluors, double zLow, double zHigh, Camera camera, PSFBuilder psfBuilder, FluorophoreProperties fluorProp)

Randomly populate the field of view with fluorophores in three dimensions.

Parameters:
  • numFluors – The number of fluorophores to add to the field of view.
  • zLow – The lower bound on the range in z in units of pixels
  • zHigh – The upper bound on the range in z in units of pixels
  • camera – The camera for determining the size of the field of view.
  • psfBuilder – Builder for calculating microscope PSFs.
  • fluorProp – The fluorophore dynamics properties.
Returns:

The list of fluorophores.

parseFluorophoresFromCsv

public static ArrayList<DefaultFluorophore> parseFluorophoresFromCsv(File file, Camera camera, FluorophoreProperties fluo, boolean rescale)

Parses fluorophore positions from csv file. All lines which don’t start with “#” have to contain at least 2 doubles, which are interpreted as x and y positions in pixels.

Parameters:
  • file – csv file, if null, a dialog is opened
  • camera – camera settings
  • fluo – fluorophore settings
  • rescale – if true, positions are rescaled to fit into frame, otherwise positions outside of frame are cropped
Throws:
  • IOException
  • FileNotFoundException
Returns:

list of fluorophores

parseMovingFluorophoresFromCsv

public static ArrayList<MovingFluorophore> parseMovingFluorophoresFromCsv(File file, Camera camera, SimpleProperties fluo)

Parses moving fluorophores and their trajectories from a csv file. CSV file column format: emitter_no[-],frame_no[-],x[px],y[px] Frame and emitter numbers must be strictly increasing, but don’t have to be consecutive (gaps in frame numbers are interpolated).

Parameters:
  • file – csv file, if null, a dialog is opened
  • camera – camera settings
  • fluo – moving fluorophore settings
Throws:
  • IOException
  • FileNotFoundException
Returns:

list of fluorophores