And the java source code: cvMatch_Template.java and Align slices.java
You will also need OpenCV shared library( 32-bit windows, 64-bit windows or 64-bit Mac ) , javacv and JNA library.
Please see Installation for more details.
Sample images are here
Description
|
template | best match |
multi-match |
The second function Align_slices in stack utilized the previous matching function to do slice registration(alignment) based on a selected landmark. This function will try to find the landmark or the most similar image pattern in every slice and translate each slice so that the landmark pattern will be the same position through out the whole stack. It could be used to fix the drift of a time-lapse image stacks, as shown in the following example:
#New feature: subpixel registration, updated 2011/5/13. Please see here for details.
before alignment |
after alignment |
alignment with subpixel registration |
(Physics of the Cytoskeleton and Morphogenesis, iRTSV/CEA, France)
System Requirement
I have only tested on the following systems.
- 64-bit ImageJ on Mac OS 10.5 and 10.6
- 32-bit ImageJ on windows XP
Installation
This plugin requires the OpenCV, javacv, and JNA (java native access) library. Javacv and JNA are provided as jar archives. We just need to put them along with the Template_Matching.jar into ImageJ plugins folder. For the OpenCV, you have two choices. Either you do a full installation of opencv on your machine (please see instructions here), or you can just download the pre-compiled library files.0. Close ImageJ
2. Download the opencv library files according to your system. Library for 32-bit ImageJ on windows / Library for 64-bit windows / Library for 64-bit ImageJ on Mac
3. Extract the library files.
(Note: Putting them in ImageJ\plugins and use "set path" doesn't work . Modified 2011/2/18)
5. Restart ImageJ.
After installing the Template Matching plugin, you can find "cvMatch_Template..." and "Align slices in stack" functions appeared in the Template Matching subfolder within the ImageJ plugin folder.
Tutorials
Tutorial for Align slices in stack
Updates
# 2012/2/29: Added the pre-compiled opencv library file for the 64-bit window system. (Thanks Yevhen Katrukha for providing the library files)
# 2011/5/30: Fixed the memory leak issue caused by the OpenCV interface.
# 2011/5/13: Boundary area for searching landmark.
# 2011/5/13: Subpixel registration.
Troubleshooting
#Q: I got a error message right after launching the plugin saying "java.lang.UnsupportedClassVersionError: Bad version number in .class file.............". A: It occurs when the Java version used for ImageJ (Java 1.5.xxx for ImageJ-32bit in MacOS X, Java 1.6.xxx for ImageJ-64bit in MacOS X and all the window-versions) is not compatible with the Java version used for compiling this plugin (Java 1.6.xxxx). To avoid this use the 64-bit ImageJ in Mac.
#Q: The plugin launched correctly, but after entering the parameters in the dialog window or after selecting the ROI, I got a error message saying
"Plugin or class not found:"Align_slices"
(java.lang.NoClassDefFoundError: name/audet/samuel/javacv/jna/cxcore$".
A: It happens because ImageJ failed to find the javacv and jna interface. You probably forgot to put the javacv.jar and jna.jar along with the Template_Matching.jar into ImageJ's plugins folder. Please follow the steps written in the Installation part.
#Q: The plugin launched correctly, but after entering
the parameters in the dialog window or after selecting the ROI, I got a
error message saying
"java.lang.UnsatisfiedLinkError: Unable to load library 'cxcore': ..................."
A: It happens because the system failed to load the opencv library. You probably forgot to download and put the library files (32-bit on windows or 64-bit on Mac) into correct place (ex: C:\Program Files\ImageJ or /usr/lib). Please follow the steps written in the Installation part.
Publications
1. Tseng, Q. et al. A new micropatterning method of soft substrates reveals that different tumorigenic signals can promote or reduce cell contraction levels. Lab on a Chip 11, 2231 (2011).2. Tseng, Q. et al. Spatial Organization of the Extracellular Matrix Regulates Cell–cell Junction Positioning. PNAS (2012).doi:10.1073/pnas.1106377109
3. Tseng, Qingzong. 2011. “Study of multicellular architecture with controlled microenvironment”. Ph.D. dissertation, Université de Grenoble. http://tel.archives-ouvertes.fr/tel-00622264.