Record high quality in vivo z stacks and assemble them using image registration after acquisition
You have a time series of functional data with data obtained from multiple planes. From this you want to produce a z-stack. Run:
OUT=zstack.timeseries2zplanes(filename,1);Where the second input argument is the channel to use for registration. If the dataset has more than one channel, the remaining channels are registered using coefficients calculated from the named channel. To save data there is currently no elegant writer function, just do:
zstack.io.writeSignedTiff(int16(OUT(1).mean_z),'zstack_red_chan.tiff')
zstack.io.writeSignedTiff(int16(OUT(2).mean_z),'zstack_green_chan.tiff')Note:
- The need to cast as int16. ScanImage writes as signed ints.
- In this case the first index is the red channel and the second is the green channel. This is rig-dependent and yours could be the other way around or you may even have more than two channels.
Use the tool zstack.record. Instructions: help zstack.record