Difference between revisions of "Team:HZAU-China/Software"

m
m
Line 202: Line 202:
 
           <h2>Software</h2>
 
           <h2>Software</h2>
 
           <div class"introduce">
 
           <div class"introduce">
<p>This year, we write a series of software for our project including colony radius calculation software, mathematical model software, device demo software and the core BioPaFiAR software (driver for the BioPaFiAR hardware device). Now we will introduce them one by one.</p>
+
<p>This year, we wrote a series of software for our project including colony radius calculation software, mathematical modelling software, device demo software and the core BioPaFiAR software (driver for the BioPaFiAR hardware device). Now we will introduce them one by one.</p>
 
<div>
 
<div>
 
<div class="calculate">
 
<div class="calculate">
Line 249: Line 249:
 
</div>
 
</div>
 
<div class="motion"><h4>3. Colony motion simulation software</h4>
 
<div class="motion"><h4>3. Colony motion simulation software</h4>
<p>We used cellular automaton model to simulate the bacteria colony pattern formation to guide experiment design in our project.The software for cellular automaton modelling was developed on the platform of Matlab 2014a. The GUI of this software is shown in Figure 3 and its usage is as the following steps.</p>
+
<p>We used cellular automaton model to simulate the bacteria colony pattern formation to guide experiment design in our project. The software for cellular automaton modelling was developed based on the platform of Matlab 2014a. The GUI of this software is shown in Figure 3 and its usage is as the following steps.</p>
 
<img src="https://static.igem.org/mediawiki/2016/c/cf/T--HZAU-China--colonymotionsimulation.jpg" width="700px">
 
<img src="https://static.igem.org/mediawiki/2016/c/cf/T--HZAU-China--colonymotionsimulation.jpg" width="700px">
<p style="text-align:center">Figure 3. The GUI of the colony motion simulation software.</p>
+
<p style="text-align:center">Figure 3. The GUI for the colony motion simulation software.</p>
<p>The steps for using this program:</p>
+
<p>The steps for using this software:</p>
 
<p>1. Open the program.</p>
 
<p>1. Open the program.</p>
 
<p>2. Click the "load" button in the interface and import your target image.</p>
 
<p>2. Click the "load" button in the interface and import your target image.</p>
Line 262: Line 262:
 
</div>
 
</div>
 
<h4>4. Device demo software</h4>
 
<h4>4. Device demo software</h4>
<p>Putting the bacteria in our AR environment, a system is needed to ensure the light signal from computer is accessible to our cell. So we have designed a device to lead the formation of colony pattern. You can see our hardware part to see more detail. In order to demonstrate our device more conveniently, we build a device demo software to show our device. </p>
+
<p>Putting the bacteria in our AR environment, a system is needed to ensure the light signals from a computer is accessible to our cells. So we have designed a device to guide the formation of bacteria colony pattern. You can see our hardware part for more details. For people to better understand our device, we build a device demo software. </p>
<p>This soft was made in blender which is is a professional free and open-source 3D computer graphics software product used for creating animated films, visual effects, art, 3D printed models, interactive 3D applications and video games. And it was output by blender add-on “Save As Game Engine Runtime” as an executable file. This software is only applicable to the windows system. You can click <a href="https://static.igem.org/mediawiki/2016/a/ae/T--HZAU-China--hardware_source.zip">here</a> to download this soft or click <a href="https://static.igem.org/mediawiki/2016/8/8c/T--HZAU-China--hardware_ninary.zip">here</a> to download source files.</p>
+
<p>This software was developed in Blender which is is a professional free and open-source 3D computer graphics software used for creating animated films, visual effects, art design, 3D printing models, interactive 3D applications and video games. The device demo software was output by a Blender add-on “Save As Game Engine Runtime” as an executable file. This software can only be run in the Microsoft Windows system. You can click <a href="https://static.igem.org/mediawiki/2016/a/ae/T--HZAU-China--hardware_source.zip">here</a> to download this software or click <a href="https://static.igem.org/mediawiki/2016/8/8c/T--HZAU-China--hardware_ninary.zip">here</a> to download the source files.</p>
 
<video src="https://static.igem.org/mediawiki/2016/d/dd/T--HZAU-China--hardware_soft_demo.mp4" controls="controls" width="700px"></video>
 
<video src="https://static.igem.org/mediawiki/2016/d/dd/T--HZAU-China--hardware_soft_demo.mp4" controls="controls" width="700px"></video>
<p style="text-align:center;">Movie 1. Device demo</p>
+
<p style="text-align:center;">Movie 1. Hardware device demo.</p>
<p>If you want to use it, the operation is as follows:</p>
+
<p>If you want to use it, the operation steps are as follows:</p>
<p>Double-clicking “hardware.exe” to run this software. Press “A” to rotate the scene to left and press “D” to rotate to right. Clicking mouse left button to open the door and clicking again to close it.  Rolling up the mouse wheel to close to the scene or rolling down to away from the scene. Press “Esc” to quit the program.</p>
+
<p>Double-click “hardware.exe” to run this software. Press “A” to rotate the scene to the left and press “D” to rotate it to the right. Click mouse left button to open the door and click again to close it.  Roll up the mouse wheel to get closer to the scene or roll down to get away from the scene. Press “Esc” to quit the program.</p>
 
</div>
 
</div>
 
<div class="BioPaFiAR">
 
<div class="BioPaFiAR">
Line 274: Line 274:
 
</div>
 
</div>
 
<h4>5. The core BioPaFiAR software (Driver for the BioPaFiAR hardware device)</h4>
 
<h4>5. The core BioPaFiAR software (Driver for the BioPaFiAR hardware device)</h4>
<p>In this project, a light matrix projected from projector will be used to change the motion state of bacteria. And the light matrix is generated by computer which will collect colony image by camera. So we need a program to coordinate the work between the projector and camera.
+
<p>In this project, light signals from the projector will be used to change the motion state of bacteria. And the light signals are generated by a computer which also collects the bacteria colony image by a camera. So, we need a program to coordinate the work between projector and camera.
At first, the program can read image from camera. So we use opencv-python to control camera and process image. After read image from camera, we need separate colony from background. Because a huge reflection existing in dish’s wall will interfere the separation process, so we need to find a new way to separate it.</p>
+
At first, the program can read the image from the camera. We use OpenCV-python to control camera and process the image. After reading image from the camera, we need to separate the colony from background. Because the huge amount of reflected light from the dish wall will interfere the separation process, we need to find a new way to do it.</p>
<p>Guiding bacteria to form a specific pattern need to culture bacteria continually. In the meantime, in addition to the colony area, the illumination condition of the rest area is invariable. So we can get colony area by using the picture later to subtract the previous. Based on this thought, we will save a picture into memory before the colony appeared. After the colony appeared, we can read image from camera. Converting them to gray mode and thresholding them separately. Subtracting the former from the latter. Then we can get the colony. But in many times, the lack of resolution of camera may cause the beat noise. So we can use open operation to remove the noise.</p>
+
<p>Guiding bacteria to form a specific pattern needs to culture bacteria continually. Meanwhile, besides the colony area, the illumination condition of the rest area is invariable. So, we can get the image of colony area by subtracting the previous picture from the subsequent picture. Based on this idea, we save a picture into computer memory before the colony appears; when the colony appears, we can get a image from the camera; convert them to gray mode and separate them by proper threshold; subtract the former from the latter; then we can get the colony. Usually, we need to remove some noises induced by the camera during insufficient lighting.</p>
<p>After the above treatment, we can get a black and white image. We can use canny algorithm to detect edge and use dilation operator to extent edge. But how to combine with target image? Bitwise and operation can be used in dilated image and target image. then converting 255 values to green color and 0 values to red color and save it as an BGR image. Displaying the image in full screen, and projector will copy and project it onto colony.</p>
+
<p>After the above treatment, we can get a black and white image. We can use canny algorithm to detect edge and use dilation operator to expand edge. But how to combine with the target image? Bitwise "and" operation can be used in the dilated image and the target image. Then, we convert the 255 values (white part in the image) to green color and 0 values (black part in the image) to red color, and save it as an RGB image. The resultant image is displayed in the full screen mode, and the projector will copy and shed it onto the bacteria colony in he culture medium.</p>
 
<img src="https://static.igem.org/mediawiki/2016/7/78/T--HZAU-China--hardware-figure2.jpg" />
 
<img src="https://static.igem.org/mediawiki/2016/7/78/T--HZAU-China--hardware-figure2.jpg" />
<p style="text-align:center">Figure 4. BioPaFiAR software</p>
+
<p style="text-align:center">Figure 4. Illustration for the working process of the BioPaFiAR software.</p>
  
 
</div>
 
</div>

Revision as of 21:38, 19 October 2016

body

Software

This year, we wrote a series of software for our project including colony radius calculation software, mathematical modelling software, device demo software and the core BioPaFiAR software (driver for the BioPaFiAR hardware device). Now we will introduce them one by one.

1. Colony radius calculation software

In this project, the specific pattern of bacteria is formed by controlling the motility of bacteria. So the first step of this project is validating the difference of motility. In experiment, the motility can be represented by the size of bacteria colony. So we write a sequential photography program, and it can be used to take a photo every 15 minutes combined with Raspberry Pi computer. After getting these pictures, we need to measure the diameter of colony. If measured manually, it will be a huge amount of workload. So we write a Python program to help us.

It is semi-automatic software and can be used in sequential photography. When this program is running, you can see the GUI like Figure 1A; the Python shell window is also useful for you to see the measure result (Figure 1B). You need two pictures as the input to this program. The first picture is the starting point in the picture sequences and the second picture is one you want to measure.

Warning: camera and the target object cannot be moved after shooting begins and the ambient light must be Invariant.

Figure 1. Colony radius calculation software.

Procedures:

1. After running this program, click the min track bar and move the mouse. You can see that the following window will change. The white parts are colonies. Move the track bar until the colony you want to measure looks the best (clearest).

2. After the adjustment, click the left mouse button and move mouse to choose the colony you want. The selection box is a green box.

3. After choosing a colony, the area will be shown in the litter window. If there is no other colony in the window, you can press “Enter” to calculate the diameter of the colony. The result will be shown in the Python shell window. See Figure 1B.

4. Press “Esc” to quit this program.

You can click here to download this software.

2. Motility dynamic model software

Based on the dynamic model, we package the modeling program into a software with a GUI. The program is coded using Python 2.7 and the GUI is created using traits/traitsUI. The image processing is performed using OpenCV-python interface and the result is displayed by Mayavi. Figure 2 shows the GUI of this software.

Figure 2. Motility dynamic model software.

Procedures:

1. Run this software.

2. Click the yellow folder shape icon in the back of “Choose File” to select a target image.

3. Adjust the parameter values including k, r, ps and time.

4. Choose a display mode (2D or 3D).

5. Click “ok” button to solve PDE. The result will be shown in the bottom window. If you are interested in this program, you can download it by clicking here.

3. Colony motion simulation software

We used cellular automaton model to simulate the bacteria colony pattern formation to guide experiment design in our project. The software for cellular automaton modelling was developed based on the platform of Matlab 2014a. The GUI of this software is shown in Figure 3 and its usage is as the following steps.

Figure 3. The GUI for the colony motion simulation software.

The steps for using this software:

1. Open the program.

2. Click the "load" button in the interface and import your target image.

3. Select a point in the area of the target image as the initial location of the bacteria.

4. Click the "run" button to start the program.

5. Click the "stop" button to suspend the program and view the current running status.

6. You can also select another position to inoculate during running, so that the shape of the colony can grow into the target image faster.

7. Click the "quit" button to exit the program.

4. Device demo software

Putting the bacteria in our AR environment, a system is needed to ensure the light signals from a computer is accessible to our cells. So we have designed a device to guide the formation of bacteria colony pattern. You can see our hardware part for more details. For people to better understand our device, we build a device demo software.

This software was developed in Blender which is is a professional free and open-source 3D computer graphics software used for creating animated films, visual effects, art design, 3D printing models, interactive 3D applications and video games. The device demo software was output by a Blender add-on “Save As Game Engine Runtime” as an executable file. This software can only be run in the Microsoft Windows system. You can click here to download this software or click here to download the source files.

Movie 1. Hardware device demo.

If you want to use it, the operation steps are as follows:

Double-click “hardware.exe” to run this software. Press “A” to rotate the scene to the left and press “D” to rotate it to the right. Click mouse left button to open the door and click again to close it. Roll up the mouse wheel to get closer to the scene or roll down to get away from the scene. Press “Esc” to quit the program.

5. The core BioPaFiAR software (Driver for the BioPaFiAR hardware device)

In this project, light signals from the projector will be used to change the motion state of bacteria. And the light signals are generated by a computer which also collects the bacteria colony image by a camera. So, we need a program to coordinate the work between projector and camera. At first, the program can read the image from the camera. We use OpenCV-python to control camera and process the image. After reading image from the camera, we need to separate the colony from background. Because the huge amount of reflected light from the dish wall will interfere the separation process, we need to find a new way to do it.

Guiding bacteria to form a specific pattern needs to culture bacteria continually. Meanwhile, besides the colony area, the illumination condition of the rest area is invariable. So, we can get the image of colony area by subtracting the previous picture from the subsequent picture. Based on this idea, we save a picture into computer memory before the colony appears; when the colony appears, we can get a image from the camera; convert them to gray mode and separate them by proper threshold; subtract the former from the latter; then we can get the colony. Usually, we need to remove some noises induced by the camera during insufficient lighting.

After the above treatment, we can get a black and white image. We can use canny algorithm to detect edge and use dilation operator to expand edge. But how to combine with the target image? Bitwise "and" operation can be used in the dilated image and the target image. Then, we convert the 255 values (white part in the image) to green color and 0 values (black part in the image) to red color, and save it as an RGB image. The resultant image is displayed in the full screen mode, and the projector will copy and shed it onto the bacteria colony in he culture medium.

Figure 4. Illustration for the working process of the BioPaFiAR software.