detrendr expects the time dimension to be the fourth dimension of the image (
time). Some people’s data is linescan, meaning there is only one spatial dimension (
x) and time is placed along the
y axis of the image. We have an example in this package. It’s 1,000 time points of a line of 64 pixels; it has 2 channels.
As you can see, the image has 1,000 rows and 64 columns in its two channels, so time is indeed along the
y axis. This won’t work with detrendr, so before detrending it, we need to put time on the fourth dimension. Fortunately,
ijtiff provides a function for this.
Now as you can see, time is on the fourth dimension, so we can proceed as normal.
This image is still in stack format. You could now convert it back to linescan format if you like.
You can then do as you please with these results, such as save them with