Adaptive Feedback Microscopy ImageJ/FiJi utilities
The repository adaptive_feedback_mic_fiji contains ImageJ/FiJi tools to be used with the Zeiss VBA macro MyPiC to perform adaptive feedback microscopy experiments.
Adaptive feedback microscopy Experiments where the microscopy software interacts with an image analysis software. The image is processed and depending on the results a different imaging protocol is started.
The Automated FCS plugin monitors a folder for new images generated by MyPiC and the LSM microscope. When a file matches a specified task in a pipeline the image is processed according to:
- Gaussian blur and threshold using a specified channel of the image
- Seeded watershed for objects that exceed a certain area size
- Pick objects of interest that are within an area size range and fluorescence intensity range
- If an object is found send stage position(s) and/or FCS position(s) (computed with respect to the object of interest) to MyPiC
- Send to MyPiC which action to perform, e.g. update stage position for tracking or FCS measurements
Installation
Install FiJi to a directory where you have writing rights.
Without compiling the jar files
- Create a directory in the FiJi plugin directory e.g.
Fiji.app\plugins\EMBL
- Copy the jar files and the python file contained in the
dist
directory of this repository to the newly create directory.
Compilation of the jar files
- Install maven
- Open a command line tool.
- Change directory to
automatedfcs
and typemvn package
to compile the package. If the compilation is successful the jar file is stored in a newly createdautomatedfcs\target
directory. - Repeat point 3. in the directory
segment_Particles
andCommMicroscope
. - Copy the jar files and the python file located in the
dist
directory to the FiJi plugins directory as explained before. - Get the commons-io java library (version >= 2.5, the plugin has been tested with common-io-2.5.jar) and copy the jar file to the FiJi plugins directory.
Running the Automated FCS plugin
The wiki contains following sections:
- Start the plugin
- Directory to monitor and parameters GUI
- Image to analyze parameters
- Segmentation parameters
- FCS measurement points parameters
- Test and save settings commands
- Start monitoring commands
Start the plugin
You can start the plugin from Plugins > EMBL > Automated Fcs
.
Directory to monitor and parameters GUI
This directory is the directory where MyPiC saves the data.
Main window | Parameter window |
---|---|
![]() |
![]() |
- In the field
Directory to monitor
specify the directory where the data from MyPiC is stored - Click on
Parameters
- This will open a window where the user can enter the specifications for the image analysis
Image to analyze parameters
The user can specify up to 3 images that will be analyzed by the plugin (Job1-3). The images should match to MyPiC task where processing is set to Online image Analysis
. Commands and parameters are written in the WindowsRegistry
HKEY_CURRENT_USER\Software\VB and VBA Program Settings\OnlineImageAnalysis\macro
for MyPiC to read.
-
Pipeline Name of MyPiC pipeline to analyze
- None: do not perform any analysis
-
Default: Analyze files containing string
*DE*
from default pipeline -
Trigger1: Analyze files containing name
*TR1*
from Trigger1 pipeline -
Trigger2: Analyze files containing name
*TR2*
from Trigger2 pipeline
-
Task: This is the image number in the order of acquisition of the pipeline
-
Command: Command passed to MyPiC upon successful segmentation. Written in the windows registry CodeMic.
-
nothing
: do not perform any action -
focus
: Useful for object based tracking in 3D. Compute center of mass of segmented binary object and pass coordinates to MyPiC (windows registry X, Y, Z). Microscopy position are updated if MyPiC options TrackXY and/or TrackZ are on . -
setFcsPos
: Pass coordinates for FCS measurements to MyPiC (registry fcsX,fcsY,fcsZ). Number of points and positions are specified in FCS measurement points parameters. MyPiC starts FCS measurements at these positions if the next task is a FCS job -
setFcsPos;focus
: Combination of 2 commands. MyPiC first performs FCS measurements and then updates the stage position according to the center of mass of segmented object -
trigger1
: MyPiC starts Trigger1 pipeline at XYZ of center of mass of segmented object(s). Several stage positions can be specified at once using Number of particles >1 -
trigger2
: MyPiC starts Trigger2 pipeline at XYZ of center of mass of segmented object(s). Several stage positions can be specified at once using Number of particles >1
-
Segmentation parameters
After segmentation objects that are within a certain area range and fluorescence intensity range are selected. From these objects the plugin picks one or more objects to be used for specifying imaging coordinates and FCS positions.
In object detection allows for object based tracking of a single cell using a nearest neighbor algorithm (Command: focus). This can be used to perform long term high-resolution imaging of objects that are moving in space using a small field of view.
- Channel segmentation: Channel to use for object segmentation
- Seg. Method: Method to find threshold to separate foreground and background pixels. The name refers to the method as implemented in ImageJ
- filter radius (px) Radius in pixels of the Gaussian and median filters applied on the image before thresholding
- Exclude objects > (um2): Exclude objects above area-size in micrometer^2
- Exclude objects < (um2): Exclude objects below area-size in micrometer^2
- Watershed if > (um2): Perform a watershed operation on objects that exceed area. This parameter is useful to separate objects that are in close proximity
- Exclude boundaries: If yes objects touching the boundary are excluded
- Channels intensity filter1: Specify channel number for which the fluorescence intensity must be in a certain range
- Min intensity filter 1: Minimal value for mean fluorescence intensity in segmented object of channel (Channels intensity filter1)
- Max intensity filter 1: Maximal value for mean fluorescence intensity in segmented object of channel (Channels intensity filter1)
- Channels intensity filter2: Additional channel to apply fluorescence intensity thresholds
- Number of particles Maximally allow for this number of objects to be picked
-
Pick particle in
- center choose particles closest to the center of the image. When Number of particles = 1 this option allows for tracking an object in space.
- random choose one particle at random.
Min and Max intensity The default values are for 8bit images. This needs to be increased for 12bit (maximum intensity 4093) or 16bit (maximum intensity 65536) images
FCS measurement points parameters
Note that FCS measurements are only performed by the microscope if the plugin sends the command setFcsPos
or setFcsPos;focus
to MyPiC. The points are placed with respect to the segmented primary object so that they are as distant as possible. For example for 4 points the FCS points are located on 2 orthogonal lines. The user can specify the distance from the boundary of the segmented primary object. FCS points can be placed only if a single object is chosen (Number of particle = 1). The rational is to associate a single image to each FCS measurement corresponding to one cell/object.
- FCS pts. region 1 (inside): Number of FCS in a region around the object of interest. The id of these points is nuc (nucleus)
- # oper. (erode < 0, dilate > 0): Number of pixels to erode or dilate depending on the sign. With negative values the FCS points are placed withing the object of interest
- FCS pts. region 2 (outside): umber of FCS in a region around the object of interest. The id of these points is cyt (cytoplasm)
- # oper. (erode < 0, dilate > 0): Number of pixels to erode or dilate depending on the sign. With positive values the FCS points are placed outside the object of interest
- Update z-pos for FCS: If Yes FCS measurements are performed on a new Z-position set from the center of mass of the segmented object of interest
Test and save settings commands
- Run on file: Test the analysis pipeline on a user defined file. The program will prompt for a file
- Load Para: Load parameters from a file named Automated_FCS.ini. Such a file is automatically generated after pressing Start.
- Save Para: Manually save parameters to a *.ini file
- OK: Close window and return to main window
Start monitoring commands
To start the plugin and automatically process files created in the directory to monitor press Start.
To process a whole directory and test the segmentation pipeline press RunOnDir.
When an objects of interest are found segmentation results jpg files are saved in the directories specified in Analyze results saving
If analyze only new files is clicked only new generated files are processed. In case you restart MyPiC in the same folder old files need to be deleted. If this option is not on, the plugin looks for changes in the files. In this situation it can occur that the plugin processes one file twice.
Example output for FCS-calibrated imaging
We show an example for Automated FCS using these parameters

Cells express a fluorescent protein and their DNA has been stained with SiR-DNA. The workflow of MyPiC is as following
- Default pipeline:
- task1: A XZ scan to find the reflection of the glass
- task2: A low resolution imaging of the fluorescent protein (Channel 1) and DNA (Channel 2)
- Trigger 1:
- task1: A XZ scan to find the reflection of the glass
- task2: A high resolution imaging of the fluorescent protein (Channel 1) and DNA (Channel 3)
- task3: FCS measurements
The Automated FCS plugins performs:
- Job1: Cell detection using DNA channel. Cells where the fluorescent protein is within a certain range are selected. The coordinates of cells that fulfill all criteria are passed to MyPiC to start the Trigger1 pipeline.
- Job2: detects cells using the DNA stain. Chooses the cell closest to the center where the fluorescent protein is within a certain range. Determines the coordinates of the FCS measurements and pass their values to MyPiC. In task 3 of Trigger1 MyPiC will start FCS measurements at these positions.