Author: Christopher Philip Mauer (cpmauer at northwestern.edu) History: 2003/05/23: First version
2003/07/25: Fixes a bug that caused the first slice
of the input stack to be copied to the last slice of the output stack.
2006/11/17: Macro bug fixes by Shannon Stewman (stew at uchicago.edu)
2009/08/05: Works with all image types; filters in place
Source: Kalman_Stack_Filter.java Installation: Drag and drop Kalman_Stack_Filter.class onto the "ImageJ" window (v1.43 or later). Description: This plugin implements a recursive prediction/correction algorithm which is based on the Kalman Filter (commonly used for robotic vision and navigation) to remove high gain noise from time lapse image streams. These filters remove camera/detector noise while recovering faint image detail.
Copyright (C) 2003 CHRISTOPHER PHILIP MAUER
Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software. Any for profit use of this software is expressly forbidden without first obtaining the explicit consent of the author.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, THE AUTHOR DOES NOT MAKE ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
The user can specify:Wrong guesses for the initial variance will not prevent noise estimation, but merely delay the fitting process. High filter gain renders the output less sensitive to momentary fluctuations.
- Initial noise variance estimate
- Filter gain
The filter performs the following steps:
- Initialization
- User input specifies the filter gain: G
- User input specifies the noise variance estimate: V
- Use the first image as the prediction seed: I-k = Ik
- Use the variance estimate as the error seed: E-k = V
- Correction
- Compute the Kamlan Gain: Kk = E-k/(E-k + V)
- Update the image prediction with the (Mk) measurement: Ik = G*I-k + (1.0-G)*Mk + Kk(Mk-I-k)
- Update the variance estimate: Ek=E-k(1-Kk)
- Prediction
- Predict the next image: I-k+1 = Ik
- Predict the variance: E-k+1 = Ek
- Update values
- E-k=E-k+1
- I-k=I-k+1
- Repeat 2,3,4
Another version of the filter ( Kalman_Filter.java) operates in constant memory space by loading each image and storing the data in memory only as long as it is needed for the computation. The runtime display consists of two data frames containing the raw and filtered image streams which are displayed movie-style, and a GUI interface with the ability to adjust the filter gain and processing/playback rates (on the fly), as well as stop the procedure and restart. Repeating the filter will apply the learned prediction and noise models to the initial data.
The user can specify:
- The naming convention for input file selection (series of single images, not stacks)
- The naming convention for file saving (basename to be padded with sequence numbers)
- The output directory (each filtered image is saved as a tif)
- Whether or not to save the data which is produced
- Initial noise variance estimate
- Filter gain
Movies show time lapse images of MIN6 insulinoma cells expressing a GFP-syncollin fusion protein that localizes to insulin granules (approx 300nm diameter). Images were obtained on a Zeiss LSM510 cofocal microscope using low laser power and high PMT gain. Left panel is the raw data; right panel shows the same data after application of the Kalman_Filter plugin (filter gain=0.80). Note the reduction of shot noise, enhanced detail of dim features, and slight motion artifacts produced by this high gain setting.
(images courtesy of the University of Chicago Digital Light Microscopy Facility)