| publisher = American Chemical Society
| doi = 10.1021/acs.chemrev.5b00398
[[Image:photobend_demo.gif|thumb|right|Animation of the photobend time lapse (~1500x playback speed)]]
There are two plugins in the collection providing two methods of crystal bending measurement: Bending_Crystal_Track and Laser_Spot_Track4. Both use the template matching technique based on OpenCV library to track the movement of specific targets in the series of time lapse images organized in the virtual stack. Direct usage of movies opened as image stacks is not supported currently (movies can be transformed in the image sequences with tools like ffmpeg). Timeline of the registered process is based on exif timestamps in the images or on the constant time step if the metadata are not available.
There is an ability to monitor a folder for additional images appearing in the time lapse series thus allowing live process registration. The plugins work with 8/16/32-bit greyscale or 24-bit RGB images. The matching mode can be chosen from the intensity-based or color-based for the RGB format (the later is useful for images having weak intensity contrast but possessing sufficient color gradients). Subpixel registration is available using local quadratic approximation of the matching measure.
== Laser_Spot_Track4 ==
[[Image:LaserSpotMove.gif|thumb|right|Animation of the laser spot movement obtained while registering the photobending with the laser beam deflection technique (~70x playback speed)]]
The plugin was developed to analyze weak photobending of thick crystals. To utilize the technique tiny mirror is attached to the free crystal's end. The bending then causes tilt of the mirror and corresponding deflection of the laser beam.
photobend_processing.jpg|frame|400pix|left| Crystal shape tracking in process]]
The movement of the laser spot is registered with a camera to give the series of the time-lapse photographs (or a movie which should be transformed to the series for the analysis). The laser spot should be registered on the screen with the template attached which contains 4 marks placed in corners of a square. The usage of the template provides automatic image stabilization and perspective correction (note that only linear perspective is corrected; no spherical distortion can be corrected by the plugin, so usage of wide-angle lenses is not recommeded). The template should be made prior to the registering by any appropriate technique. For example by printing a prepared image (e.g. this one [[MeasurementTemplate]]). Depending on the printer model the scale of the image may be distorted differently in vertical or horizontal direction, so you should check it and correct the scale if necessary (for example, by editing one of the vector file suggested).To analyze the laser spot movement with the plugin the image sequence should be open as the virtual stack. After confirming setting of few necessary parameters (including algorithm settings and size of rectangles enclosing the laser spot part or template's corner marks) the plugin interface asks to specify position of centers of the spot and of four corner marks of the measurement template. It is important to specify the corner marks in the clockwise order! The resulting axes of the coordinate system in which the spot movement is analyzed are as following: X axis is along direction from centers of mark #1 to #4, Y axis is along #1 - #2 line. The coordinates origin is in the mark #1 center.The output of the plugin is placed in the result table containing every image filename, time, coordinates of the laser spot center and shift of the spot relative to initial position. Coordinates are given in two forms: row coordinates of the spot center in the image coordinates (in pixels) and corrected/stabilized coordinates in the absolute coordinate system of the 4 marks (in millimeters).
== Installation in Fiji ==
* Click ''Manage update sites''
* Add and check new update site ''PhotoBend''
* Click ''Close''
* Click ''Apply changes''
* Restart ImageJ
The dependencies are:
* javacv. Version 1.
3.2 (opencv-version.jar file is copied into plugins folder to prevent automatic overwriting by Fiji updater)* joda-time. Version 2. 9. 4* metadata-extractor. Version 2. 9 . 1
== References ==