Giter Club home page Giter Club logo

sass's People

Contributors

kmdouglass avatar mstefko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sass's Issues

Displayed image in the live view of the IJplugin is off by one

Problem

The image that is displayed in the SASS Image Dataset window is always the one before the most recently generated image. This makes the displayed image appear out-of-sync with an analyzer's live view window.

This is not a major problem since you can click the right arrow button on the slider bar to display the most recent image. However, if you restart a paused simulation after doing this, the live image lags the actual image by one again.

How to reproduce

  1. Launch ImageJ / Fiji.
  2. In the menubar: Plugins > SASS > Simulator
  3. Set the analyzer to SpotCounter and the controller to Manual
  4. Click Initialize.
  5. Start the simulation by clicking Start
  6. Pause the simulation by clicking Stop
  7. Observe that the displayed image is N-1 / N in the SASS Image Dataset window, instead of N/N, where N is the number of simulated images.

Versions affected

  • 0.8.0
  • 0.9.0-SNAPSHOT

Remove MATLAB folder?

Is the MATLAB folder still necessary, or can it be removed from the project directory without breaking functionality?

Create a model for the illumination profile

Currently the rate coefficients in the photodynamics models depend on the laser power, but a more accurate physical model would have them depend on the illumination irradiance (power per area). This necessitates a model for the illumination profile on the sample. It should

  • return the irradiance as a function of x and y (and z?)
  • change with the laser power

Furthermore, the fluorophore models will need to be changed to respond to their local irradiance values. Currently they output a fixed number of photons per frame; instead, their photon counts should depend on the irradiance. See https://gist.github.com/hadim/6021276da3d41e246ff688e5a05d07e1 for an example of how to model this in Python.

Ambiguity over coordinate system

In the FAQ, the coordinate system is defined twice, but differently:
How is the coordinate system in SASS defined?
"Please note that the origin of the Cartesian coordinate system lies at the center of a pixel, not at a corner."
How are custom fluorophore position lists formatted?:
"The units of the values are in pixels, and the origin is in the upper left-hand corner of the generated image stacks."
Is one wrong or are there two different coordinate systems?

dStormProperties constructor fails at the creation of a StateSystem instance

bsh % source("/home/kmdouglass/src/SASS/scripts/example_run_generator_dSTORM.bsh");
// Error: // Uncaught Exception: Method Invocation this.interpreter.source : at Line: 14 : in file: /bsh/commands/source.bsh : this .interpreter .source ( filename , this .caller .namespace ) 

Called from method: source : at Line: 17 : in file: <unknown file> : source ( "/home/kmdouglass/src/SASS/scripts/example_run_generator_dSTORM.bsh" ) 
Target exception: Sourced file: /home/kmdouglass/src/SASS/scripts/example_run_generator_dSTORM.bsh : Typed variable declaration : Object constructor : at Line: 28 : in file: /home/kmdouglass/src/SASS/scripts/example_run_generator_dSTORM.bsh : new dStormProperties ( 2500 , 50 , 0.001 , 5 , 2 , 15 , 100 , 500 ) 

Target exception: java.lang.IllegalArgumentException: Rate scaling matrix dimensions do not match the number of states.


java.lang.IllegalArgumentException: Rate scaling matrix dimensions do not match the number of states.
	at ch.epfl.leb.sass.simulator.generators.realtime.StateSystem.<init>(StateSystem.java:73)
	at ch.epfl.leb.sass.simulator.generators.realtime.fluorophores.dStormProperties.<init>(dStormProperties.java:80)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at bsh.Reflect.constructObject(Reflect.java:621)
	at bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:117)
	at bsh.BSHAllocationExpression.objectAllocation(BSHAllocationExpression.java:108)
	at bsh.BSHAllocationExpression.eval(BSHAllocationExpression.java:56)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41)
	at bsh.BSHVariableDeclarator.eval(BSHVariableDeclarator.java:80)
	at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:78)
	at bsh.Interpreter.eval(Interpreter.java:659)
	at bsh.Interpreter.source(Interpreter.java:577)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at bsh.Reflect.invokeMethod(Reflect.java:131)
	at bsh.Reflect.invokeObjectMethod(Reflect.java:77)
	at bsh.Name.invokeMethod(Name.java:852)
	at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:69)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41)
	at bsh.BSHReturnStatement.eval(BSHReturnStatement.java:42)
	at bsh.BSHBlock.evalBlock(BSHBlock.java:125)
	at bsh.BSHBlock.eval(BSHBlock.java:75)
	at bsh.BshMethod.invokeImpl(BshMethod.java:356)
	at bsh.BshMethod.invoke(BshMethod.java:252)
	at bsh.BshMethod.invoke(BshMethod.java:180)
	at bsh.Name.invokeLocalMethod(Name.java:911)
	at bsh.Name.invokeMethod(Name.java:798)
	at bsh.Bbsh % SHMethodInvocation.eval(BSHMethodInvocation.java:69)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41)
	at bsh.Interpreter.run(Interpreter.java:471)
	at java.lang.Thread.run(Thread.java:745)

The problem is likely that the state system constructor inside the dStormProperties constructor is called with the wrong value for the number of states:

state_system = new StateSystem(5, Mk);

Above, you can see that 5 is passed as the argument, but there are 4 states in this implementation of the dSTORM model.

Self-tuning PI controller window is cropped

The window is cropped even if I increase the size of the panel (see below).

This is on my testing branch for upgrading SASS's version of ALICA to v0.2.4. I do not yet know whether it happens on v0.2.1 as well.

_016

Simulation status frame y-axis labels are misleading

  • Estimated signal should be changed to Analyzer output to indicate that its units are those of the analyzer and is not, in general, a spot count.
  • True signal should be changed to True count to indicate that it reflects the true number of emitting molecules in that frame.
  • Laser output should be changed to Controller output because other devices, not just lasers, could be controlled in future versions.

AlicaLogger class not found after ALICA jar file size reduction

I get the following class not found error after having merged the new, reduced-size ALICA .jar file in the project:

Exception in thread "Thread-12" java.lang.NoClassDefFoundError: ch/epfl/leb/alica/AlicaLogger
	at ch.epfl.leb.alica.controllers.selftuningpi.SelfTuningController.initSequence(SelfTuningController.java:92)
	at ch.epfl.leb.alica.controllers.selftuningpi.SelfTuningController.nextValue(SelfTuningController.java:86)
	at ch.epfl.leb.sass.ijplugin.Worker.run(App.java:222)
Caused by: java.lang.ClassNotFoundException: ch.epfl.leb.alica.AlicaLogger
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 3 more

This error appears immediately after clicking the Calibrate button for the self-tuning PI controller in the GUI simulation environment. Before clicking this button, everything works as expected. The simulation also works perfectly when using the Manual controller.

Dialog-based simulation setup fails on Linux due to hard-coded file separator

If I had a dime every time this happens to me...

bsh % source("/home/kmdouglass/src/SASS/scripts/example_run.bsh");
// Error: // Uncaught Exception: Method Invocation this.interpreter.source : at Line: 14 : in file: /bsh/commands/source.bsh : this .interpreter .source ( filename , this .caller .namespace ) 

Called from method: source : at Line: 8 : in file: <unknown file> : source ( "/home/kmdouglass/src/SASS/scripts/example_run.bsh" ) 
Target exception: Sourced file: /home/kmdouglass/src/SASS/scripts/example_run.bsh : Typed variable declaration : Constructor error: Can't find constructor: ch.epfl.leb.alica.controllers.selftuningpi.SelfTuningController( int, double, int, double, double ) in class: ch.epfl.leb.alica.controllers.selftuningpi.SelfTuningController : at Line: 23 : in file: /home/kmdouglass/src/SASS/scripts/example_run.bsh : new SelfTuningController ( 10 , 0.1 , 2 , 0.1 , 2.0 ) 

An error is thrown when asked to load the background .tif file because there is a method that is executed some time after clicking the "OK" button in the load dialog that automatically appends a backslash to the path.

image

The FluorophoreDynamics classes should be moved

They are currently in an internal path, which doesn't make sense given the rest of the project layout: ch.epfl.leb.sass.models.fluorophores.internal.dynamics

I should also think about whether it makes sense to make FluorophoreDynamics an interface, rather than an abstract class.

BeanShell console doesn't work in FIJI

No matter what I try, I can't properly launch the BeanShell console through FIJI. I think it might be a problem with the way PlugInFrame is implemented, will try to refactor it as PlugIn

Gamma distribution is not necessary for CMOS gain

Camera noise is currently modeled within Device.java, where the number of photoelectrons is determined from a Gamma distribution.

for (int row=0; row < image.length; row++) {
            for (int col=0; col < image[row].length; col++) {
                image[row][col] += camera.readout_noise*gaussian.nextDouble() +
                                   camera.thermal_noise*gaussian.nextDouble() +
                                   gamma.nextDouble(image[row][col]+0.01f,camera.quantum_gain); //0.01f so that we dont do nextDouble(0,c)
            }
}

However, I think that the Gamma distribution is used to model multiplicative noise from the EMCCD's multiplication register, which is absent on a CMOS device.

See Basden, Haniff, and MacKay, Mon. Not. R. Astron. Soc. 345, 1187-1197 (2003)

It may be worth creating a separate noise model for each type of camera that the user may select from.

Camera and optics logic should be separated

Numerical aperture, wavelength, and magnification are currently camera properties. They should be moved to a different abstraction layer (or a new one) representing the microscope system/optics.

Add build instructions for stand-alone installs to pom.xml

From @MStefko --

In order for SASS build to work independently, we need to do 2 things:

  1. Make maven-shade-plugin ignore the ALICA_ACpack.jar when creating the uber-jar (so that the classes in ALICA_ACpack are not included in SASS.jar)
  2. Make the build system manually copy ALICA_ACpack.jar from the repository into the output folder (SASS/target/).

For number 1, I haven't looked into it yet but should be a fairly simple entry of a few lines into the ... maven-shade-plugin ... section of pom.xml.

For number 2, the following snippet entered into ... works:

       <!-- This plugin will download ALICA_ACPack and put it in output
            directory.   -->    
       <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <artifactItems>
            <artifactItem>
            <groupId>com.github.LEB-EPFL</groupId>
            <artifactId>ALICA_ACPack</artifactId>
            <version>0.0.0</version>
              <type>jar</type>
              <overWrite>false</overWrite>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <destFileName>ALICA_ACPack.jar</destFileName>
            </artifactItem>
          </artifactItems>
        </configuration>
      </plugin>

Loggers fail to save to file if it already exists and it's the first time saving

The loggers will raise the following error when calling saveLogFile() if a log file with the same name exists and the logger has never been called before.

Nov 05, 2017 10:34:37 AM ch.epfl.leb.sass.commandline.CommandLineInterfa
ce main                                                                
SEVERE: EvalError while executing shell script.
Sourced file: scripts/example_loggers.bsh : Method Invocation positionLo
gger.saveLogFile : at Line: 131 : in file: scripts/example_loggers.bsh :
 positionLogger .saveLogFile ( )                                       

Target exception: java.io.IOException: No such file or directory

        at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:91)
        at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96)
        at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41)
        at bsh.Interpreter.eval(Interpreter.java:659)
        at bsh.Interpreter.source(Interpreter.java:577)
        at bsh.Interpreter.source(Interpreter.java:590)
        at ch.epfl.leb.sass.commandline.CommandLineInterface.main(Comman
dLineInterface.java:104)                                               
Caused by: java.io.IOException: No such file or directory
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createNewFile(File.java:1012)
        at ch.epfl.leb.sass.simulator.loggers.PositionLogger.saveLogFile
(PositionLogger.java:104)                                              
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:62)                                                       
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:43)                                               
        at java.lang.reflect.Method.invoke(Method.java:498)
        at bsh.Reflect.invokeMethod(Reflect.java:131)
        at bsh.Reflect.invokeObjectMethod(Reflect.java:77)
        at bsh.Name.invokeMethod(Name.java:852)
        at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:69)
        ... 6 more

The loggers will gracefully avoid an error by appending a number to the filename, but only if the the saveLogFile() method has already been called.

New feature: increase the simulation time-step without generating an image

I'm currently testing AutoLase and for this I need to simulate images that are uncorrelated in time. One way to do this would be to increment the simulation time step and record every N'th image, where N is chosen to be suitably large so that all the molecules have undergone several switching cycles.

I therefore propose adding an additional method to the STORMsim that is similar to getNextImage but does not add an image to the stack.

Add STORM photophysical model to simulations

The current photophysical model only supports PALM-like photophysics; i.e. the off state lifetime is inversely proportional to the laser irradiance. This means that we never see any fluorescence in the simulations if the set point starts at and remains zero.

In the near future, we'll likely want to add a direct STORM model whereby the off state lifetime is modeled as

t_off = c_0 + c_1 / I_{UV}

The value c_0 is actually proportional to the visible light irradiance (to first order) and depends on the buffer conditions. It can be easily measured in the lab.

Remove methods get/setCustomParameters from ImageGenerator interface

Interfaces should be implementation-agnostic, i.e. you shouldn't care which specific implementation of the interface you are talking to when you use one of the interface's methods.

setCustomParameters(Map map) obviously breaks this pattern, since you need to know what are the keys that the class expects to find inside map.

getCustomParameters() could in theory be kept, since you could iterate over the returned map to e.g. print all parameters of the simulation, but that is again skimming the implementation-specific line.

These two methods are not required for the interface to work and should be removed.

Is Camera.acq_speed needed?

Can the Camera field acq_speed be deprecated and eventually removed without problems? I could not find where it's linked to any functionality...

Compatibility issue with ALICA

Since STEADIER-SAILOR uses a different version of ImageJ (FIJI runs on Java 1.8.0, MicroManager runs on 1.6.0), loading Analyzers and Controllers from ALICA can fail (java.lang.UnsupportedClassVersionError is thrown). We need to reconcile the JDK versions.

Release JAR files too big.

I pulled the 0.6.0 release, and built it myself using NetBeans 7.1 with JDK 8u152 (I didn't modify the build.xml). The resulting JAR file is 27MB (left) instead of 57MB (right).

jar_comparison

Comparing the two JARs shows that the released JAR (right) includes the /lib/ directory with all source JAR files. However I think this is not necessary, since the build script automatically includes all the dependent classes (as can be seen, that for example the org.micromanager.... folder is included). It's probably a NetBeans glitch. @kmdouglass can you check that your Project Properties setting looks the same? The key is probably the /lib/ entry in the Exclude From JAR File field.

project_properties

getFOVSizeUm2 and getPixelSizeUm should be renamed

Now that the distance units in the simulator are agnostic, these method names should change to remove the Um2.

The getPixelSize() method of the Microscope class should also possibly be renamed to reflect the fact that it is the image space pixel size, not the object space pixel size.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.