... | ... | @@ -7,14 +7,14 @@ The repository [adaptive\_feedback\_mic\_fiji](https://git.embl.de/politi/adapti |
|
|
|
|
|
|
|
|
|
|
|
> *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.
|
|
|
> *Adaptive feedback microscopy* are 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:
|
|
|
|
|
|
1. Gaussian blur and threshold using a specified channel of the image
|
|
|
2. Seeded watershed for objects that exceed a certain area size
|
|
|
3. Pick objects of interest that are within an area size range and fluorescence intensity range
|
|
|
4. If an object is found send stage position(s) and/or FCS position(s) (computed with respect to the object of interest) to MyPiC
|
|
|
4. If an object is found, send stage position(s) and/or FCS position(s) (computed with respect to the object of interest) to MyPiC
|
|
|
5. Send to MyPiC which action to perform, e.g. update stage position for tracking or FCS measurements
|
|
|
|
|
|
|
... | ... | @@ -23,24 +23,25 @@ Install [FiJi](http://fiji.sc/#download) to a directory where you have writing r |
|
|
|
|
|
## Without compiling the jar files
|
|
|
|
|
|
1. Create a directory in the FiJi plugin directory e.g. `Fiji.app\plugins\EMBL`
|
|
|
2. Copy the jar files and the python file contained in the `dist` directory of this repository to the newly create directory.
|
|
|
1. Create a directory in the FiJi plugin directory e.g. `Fiji.app\plugins\EMBL`
|
|
|
2. 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
|
|
|
1. Install [maven](https://maven.apache.org/index.html)
|
|
|
2. Open a command line tool.
|
|
|
3. Change directory to `automatedfcs` and type `mvn package` to compile the package. If the compilation is successful the jar file is stored in a newly created `automatedfcs\target` directory.
|
|
|
4. Repeat point (3) in the directory `segment_Particles` and `CommMicroscope`.
|
|
|
5. Copy the jar files located in the respective `target` directories and the python file located in `dist\Automated_FCS_.py` to the FiJi plugins directory as explained before.
|
|
|
6. Get the [commons-io](https://commons.apache.org/proper/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.
|
|
|
2. Open a command line tool
|
|
|
3. Change directory to `automatedfcs` and type `mvn package` to compile the package. If the compilation is successful the jar file is stored in a newly created `automatedfcs\target` directory
|
|
|
4. Repeat point (3) in the directory `segment_Particles` and `CommMicroscope`
|
|
|
5. Copy the jar files located in the respective `target` directories and the python file located in `dist\Automated_FCS_.py` to the FiJi plugins directory as explained before
|
|
|
6. Get the [commons-io](https://commons.apache.org/proper/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:
|
|
|
The user starts the plugin from `Plugins > EMBL > Automated Fcs`.
|
|
|
|
|
|
The wiki contains the following sections:
|
|
|
|
|
|
<a name="back"></a>
|
|
|
|
|
|
* [**Start the plugin**](#start)
|
|
|
* [**Directory to monitor and parameters GUI**](#dirmon)
|
|
|
* [**Image to analyze parameters**](#image)
|
|
|
* [**Segmentation parameters**](#segmentation)
|
... | ... | @@ -49,21 +50,19 @@ The wiki contains following sections: |
|
|
* [**Start monitoring commands**](#start)
|
|
|
* [**Example workflow**](#example)
|
|
|
|
|
|
## [<img src="./images/up.PNG">](#back) <a name="start"></a>Start the plugin
|
|
|
You can start the plugin from `Plugins > EMBL > Automated Fcs`.
|
|
|
|
|
|
## [<img src="./images/up.PNG">](#back) <a name="dirmon"></a> Directory to monitor and parameters GUI
|
|
|
|
|
|
This directory is the directory where MyPiC saves the data.
|
|
|
|
|
|
|
|
|
Main window | Parameter window|
|
|
|
:--- | :---
|
|
|
<img src = './images/AutomatedFCS_GUI_Artboard1.png' width = "400px" > | <img src = './images/AutomatedFCS_GUI_Artboard2.png' width = "400px" >
|
|
|
|
|
|
|
|
|
1. In the field **Directory to monitor** specify the directory where the data from MyPiC is stored.
|
|
|
2. Click on **Parameters**.
|
|
|
3. Paramter window.
|
|
|
1. In the field **Directory to monitor** specify the directory where the data from MyPiC is stored
|
|
|
2. Click on **Parameters**
|
|
|
3. Parameter window
|
|
|
|
|
|
## [<img src="./images/up.PNG">](#back) <a name = "image"></a>Image to analyze parameters
|
|
|
|
... | ... | @@ -71,7 +70,7 @@ Main window | Parameter window| |
|
|
<div align = "center" > <img src = './images/AutomatedFCS_GUI_Artboard3.png' width = "400px" > </div>
|
|
|
|
|
|
|
|
|
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
|
|
|
The user can specify up to three images that will be analyzed by the plugin (Job1-3). The images should match with MyPiC tasks in which 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
|
... | ... | @@ -80,47 +79,47 @@ HKEY_CURRENT_USER\Software\VB and VBA Program Settings\OnlineImageAnalysis\macro |
|
|
for MyPiC to read.
|
|
|
|
|
|
1. **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.
|
|
|
* **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
|
|
|
|
|
|
2. **Task**: This is the image number in the order of acquisition of the pipeline.
|
|
|
2. **Task**: This is the image number in the order of acquisition in the pipeline.
|
|
|
3. **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](#fcspos). MyPiC starts FCS measurements at these positions if the next pipeline 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.
|
|
|
* **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 positions 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](#fcspos). MyPiC starts FCS measurements at these positions if the next pipeline 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 the 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** >
|
|
|
* **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
|
|
|
|
|
|
## [<img src="./images/up.PNG">](#back) <a name="segmentation"></a> 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 plugin allows for object based tracking of a single cell using a nearest neighbor algorithm (Command: **focus** and **Number of particles** = 1). This can be used to perform long term high-resolution imaging of moving objects.
|
|
|
The plugin allows for object based tracking of a single cell using a nearest neighbor algorithm (Command: **focus** and **Number of particles** = 1). This can be used to perform long-term high resolution imaging of moving objects.
|
|
|
|
|
|
<div align = "center" > <img src = './images/AutomatedFCS_GUI_Artboard4.png' width = "400px" > </div>
|
|
|
|
|
|
|
|
|
|
|
|
1. **Channel segmentation**: Channel to use for object segmentation.
|
|
|
2. **Seg. Method**: Method to find threshold to separate foreground and background pixels. The name refers to the method as implemented in ImageJ.
|
|
|
3. **filter radius (px)** Radius in pixels of the Gaussian and median filters applied on the image before thresholding.
|
|
|
4. **Exclude objects > (um2)**: Exclude objects above area-size in micrometer^2.
|
|
|
5. **Exclude objects < (um2)**: Exclude objects below area-size in micrometer^2.
|
|
|
6. **Watershed if > (um2)**: Perform a watershed operation on objects that exceed area. This parameter is useful to separate objects that are in close proximity.
|
|
|
7. **Exclude boundaries**: If yes objects touching the boundary are excluded.
|
|
|
8. **Channels intensity filter1**: Specify channel number for which the fluorescence intensity must be in a certain range.
|
|
|
9. **Min intensity** filter 1: Minimal value of object mean fluorescence intensity of channel **Channels intensity filter1**.
|
|
|
10. **Max intensity** filter 1: Maximal value of object mean fluorescence intensity of channel **Channels intensity filter1**.
|
|
|
11. **Channels intensity filter2**: Additional channel to apply fluorescence intensity thresholds.
|
|
|
12. **Number of particles**: Maximally allow for this number of objects to be picked.
|
|
|
1. **Channel segmentation**: Channel to use for object segmentation
|
|
|
2. **Seg. Method**: Method to find threshold to separate foreground and background pixels. The name refers to the method as implemented in ImageJ
|
|
|
3. **filter radius (px)** Radius in pixels of the Gaussian and median filters applied on the image before thresholding
|
|
|
4. **Exclude objects > (um2)**: Exclude objects above area-size in micrometer^2
|
|
|
5. **Exclude objects < (um2)**: Exclude objects below area-size in micrometer^2
|
|
|
6. **Watershed if > (um2)**: Perform a watershed operation on objects that exceed the area. This parameter is useful to separate objects that are in close proximity
|
|
|
7. **Exclude boundaries**: If yes, objects touching the boundary are excluded
|
|
|
8. **Channels intensity filter1**: Specify the channel number for which the fluorescence intensity must be in a certain range
|
|
|
9. **Min intensity** filter 1: Minimal value of object mean fluorescence intensity of channel **Channels intensity filter1**
|
|
|
10. **Max intensity** filter 1: Maximal value of object mean fluorescence intensity of channel **Channels intensity filter1**
|
|
|
11. **Channels intensity filter2**: Additional channel to apply fluorescence intensity thresholds
|
|
|
12. **Number of particles**: Maximally allow for this number of objects to be picked
|
|
|
12. <a name=pickpoints></a>**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 particles at random.
|
|
|
* **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 particles 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
|
|
|
> **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.
|
|
|
>
|
|
|
|
|
|
## [<img src="./images/up.PNG">](#back) <a name=fcspos></a> FCS measurement points parameters
|
... | ... | @@ -128,11 +127,11 @@ Note that FCS measurements are only performed by the microscope if the plugin se |
|
|
|
|
|
<div align = "center" > <img src = './images/AutomatedFCS_GUI_Artboard5.png' width = "400px" > </div>
|
|
|
|
|
|
1. **FCS pts. region 1 (inside)**: Number of FCS in a region around the object of interest. The id of these points is *nuc* (nucleus).
|
|
|
2. **# 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.
|
|
|
3. **FCS pts. region 2 (outside)**: Number of FCS in a region around the object of interest. The id of these points is *cyt* (cytoplasm).
|
|
|
4. **# 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.
|
|
|
5. **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.
|
|
|
1. **FCS pts. region 1 (inside)**: Number of FCS points in a region around the object of interest. The id of these points is *nuc* (nucleus)
|
|
|
2. **# oper. (erode < 0, dilate > 0)**: Number of pixels to erode or dilate depending on the sign. With negative values the FCS points are placed within the object of interest
|
|
|
3. **FCS pts. region 2 (outside)**: Number of FCS points in a region around the object of interest. The id of these points is *cyt* (cytoplasm)
|
|
|
4. **# 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
|
|
|
5. **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
|
|
|
|
|
|
## [<img src="./images/up.PNG">](#back) <a name=save></a> Test and save settings commands
|
|
|
|
... | ... | @@ -146,44 +145,42 @@ Note that FCS measurements are only performed by the microscope if the plugin se |
|
|
## [<img src="./images/up.PNG">](#back) <a name=start></a>Start monitoring commands
|
|
|
<div align = "center" > <img src = './images/AutomatedFCS_GUI_Artboard7.png' width = "400px" > </div>
|
|
|
|
|
|
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**.
|
|
|
Press **Start** to start the plugin and automatically process files created in the directory to monitor. Press **RunOnDir** to process a whole directory and test the segmentation pipeline.
|
|
|
|
|
|
When objects of interest are found the segmentation results are saved to a jpg file. The output directoy is set in **Analyze results saving**.
|
|
|
When objects of interest are found, the segmentation results are saved to a *jpg* file. The output directoy is set 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.
|
|
|
If **analyze only new files** is clicked, only new generated files are processed. In case the user restarts 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.
|
|
|
|
|
|
|
|
|
## [<img src="./images/up.PNG">](#back) <a name=start></a>Example workflow
|
|
|
We show an example for **Automated FCS** workflow that can be applied for a FCS-Calibrated pipeline or a high-throughput FCS experiments.
|
|
|
We show an example for an **Automated FCS** workflow that can be applied for a FCS-calibrated imaging pipeline or high-throughput FCS experiments.
|
|
|
|
|
|
Following parameters are used
|
|
|
The following parameters are used:
|
|
|
|
|
|
<div align = "center" > <img src = './images/automatedfcs2.png' width = "400px" ></div>
|
|
|
|
|
|
Cells express a fluorescent protein and their DNA has been stained with SiR-DNA. The workflow of MyPiC is as following
|
|
|
Cells express a fluorescent protein and their DNA has been stained with SiR-DNA. The workflow of MyPiC is as follows:
|
|
|
|
|
|
* 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)
|
|
|
* task 1: A XZ scan to find the reflection of the glass
|
|
|
* task 2: 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
|
|
|
* task 1: A XZ scan to find the reflection of the glass
|
|
|
* task 2: A high resolution imaging of the fluorescent protein (Channel 1) and DNA (Channel 3)
|
|
|
* task 3: FCS measurements
|
|
|
|
|
|
The **Automated FCS** plugins performs:
|
|
|
The **Automated FCS** plugin 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.
|
|
|
* Job1: Cell detection using DNA channel. Cells expressing the fluorescent protein within a certain range are selected. The coordinates of cells fulfilling 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.
|
|
|
* Job2: Cell detection using the DNA stain. Chooses the cell closest to the center in which fluorescent protein is expressed within a certain range. Determines the coordinates of the FCS measurements and passes their values to MyPiC. In task 3 of Trigger1 MyPiC will start FCS measurements at these positions.
|
|
|
|
|
|
**JOB1: Output generated for every processed image** | **JOB1: Output generated when objects of interest are found**
|
|
|
:--- | :---
|
|
|
<img src = './images/example_output.png' width = "400px" > | <img src = './images/example_output2.png' width = "400px" >
|
|
|
Segmentation of the DNA channel (red) returned 17 ROIs. <br/>Only for ROI 10 and 13 is the intensity of the fluorescent protein (green) within the specified range. | Outlines for the two cells picked are shown in green.<br/> The coordinates are passed to MyPiC to execute the Trigger1 pipeline for each position.
|
|
|
Segmentation of the DNA channel (red) returned 17 ROIs. <br/>Only for ROI 10 and 13 the intensity of the fluorescent protein (green) is within the specified range. | Outlines for the two cells picked are shown in green.<br/> The coordinates are passed to MyPiC to execute the Trigger1 pipeline for each position.
|
|
|
**JOB2: Output generated for every processed image**| **JOB2: Output generated when objects of interest are found**
|
|
|
<img src = './images/example_output3.png' width = "400px" > | <img src = './images/example_output4.png' width = "400px" >
|
|
|
Segmenation of the DNA channel (red) returned 2 ROIs. <br/> For ROI 1 and 2 the intensity of the fluorescent protein (green) is within the specified range. | Cell closest to center of image is picked (green outline). <br/>The red outline shows a cell that has not been picked because too far from the center of the image. <br/> Coordinates for the two FCS points are passed to MyPiC.
|
|
|
Segmenation of the DNA channel (red) returned 2 ROIs. <br/> For ROI 1 and 2 the intensity of the fluorescent protein (green) is within the specified range. | The cell closest to the center of the image is picked (green outline). <br/>The red outline shows a cell that has not been picked because it is too far away from the center of the image. <br/> Coordinates for the two FCS points are passed to MyPiC.
|
|
|
|