Time Series
Time series is a fundamental part of how variables work in ImageTank.
At a high level the data lives in the variable objects. Every variable contains the data, or knows how to compute the data from other ImageTank objects, or from a a file on disk etc.
But a key aspect is that most objects can contain a collection of values. For example, when you have a folder or images you might want to run your analysis on the entire folder. Another example is when you are looking at video you want to look at all of the frames. If you are doing a simulation you might get a time series output.
ImageTank handles this by what is referred to as a time series. The name is a match for examples where you have a movie or time stamps, but really what it means that you associate a value/index for each entry.
- If you import a movie, the time value is the actual time elapsed from the first frame, so the time would typically be 0,1/30,2/30,…
- If you import a folder of tiff images, the default time step is 1, so the time sequence is 0,1,2,3,…
- You can use local variables to create a time series. The times have to be strictly increasing and non-negative.
The name “time series” is used in ImageTank to indicate that the variable has collection of values. In many examples a better name would be a “collection” or “set”. Those concepts don’t imply an order, but the time value could be viewed as a way to index the variables and iterate over them.
Time Series from Folder
One common example is a collection of image files in a folder.
Drag this folder into the variable list in ImageTank. ImageTank detects that there are tiff files in this folder and creates an Image variable that creates a time series from the images in the folder.
There are a number of settings here to use only sub-sets and the combine multiple files into a a single multi-channel image. If you click on the small memory chip icon to the right of the gear menu you add the cache information monitor. This gives you a sense of how ImageTank treats the time series. The files create a time series with 201 different time values. When you open the variable monitor you notice that one of the entries shows up as green. That is because even though you specified 201 time values, you only asked to see one of them, and that was the only time value that was read into memory.
Changing Time
ImageTank defines a ‘global’ time. You set that by using the slider below the variable. Note the ‘global’ gray entry in the Time field inside the variable monitor. When you change that the global time is used in every variable monitor that doesn’t overwrite the time value as well as every drawing figure. In the image we just imported the time step is 1, so the time values are 0,1,2,3,… When the time variable is between time values it uses the largest value that is less than or equal to the global time. That means that the value at time 134 is picked instead of 135.
If you look closely you see that there are now two green dots in the cache monitor.
Different variables can have different time steps and time values, and in fact the time step does not have to be uniform. Often the default time step is 1, so the time values are at 0,1,2,3,…. but the intial time value can be larger than 0. Negative time values are not allowed, and the slider always starts at 0.
Time Dependence
When a variable is used in a computation, the default behavior is that the result becomes time dependent as well. The output times are the union of all of the input times. For example, if the above image is used in a threshold the time values from the image variable carry over to the path. That way when you draw both objects they are automatically synchronized. The values are cached by time value, so if you go back to a previous time the cached value will be used if it is still in the cache.