I’m writing code that accepts a time series of 3D images and want to process it on-line; i.e. as they come in. I’m not seeing this topic discussed so maybe it’s too esoteric or maybe I haven’t found the right keywords.
The basic example is that I want to do things like keep statistics on the last N time points like a moving average and variability measure - say to identify noisy regions. I am about to roll my own using RingBuffer and some N-ary filters. Basically I’m wondering if there is something already out there that I’ve missed. Any advice on pitfalls or best practices would also be appreciated.
Edited because I mis-read your question. In truth, I only need the statistics for the last N (N around 8-10). But I do want statistics at each pixel.
I guess you’re hinting at algorithms to do on-line stats that are updateable? I’m aware of Wedford’s algorithm for mean and variance. But I don’t know how one might update to remove the oldest data as the window slides without storing the oldest image.
What I imagined: compute statistics for image i, put the statistics into the ring buffer (stat[i]), then compute current statistics by using a for loop over stat array and combining stat[0]…stat[i] or stat[i-N]…stat[i]. At i+1, you will combine stat[i+1-N]…stat[i+1] into current statistics.
The slides do describe some of the issues I am facing, and propose a class itk::ImageSet (ImageSequence, ImageBag) that sounds like it could be useful to me. Since I cannot find any such classes in ITK, I’m presuming the proposal did not move forward. I’d be curious to know whether the use cases in the slides were met by other means.
Thanks! I had found the ring buffer, but not the rest of the video group, The VideoStream seems really interesting.
My use case is a stream of images from the scanner with no pre-determined number of frames – we receive images until the operator ends the scan. The VideoStream, in contrast appears to require a pre-determined number of frames – in order to set up the TemporalRegion. At least that is my current understanding based on prototyping a few things using the ImageToVideoFilter and reading the code for the VideoFileReader. If the above is incorrect, please let me know!