@@ -0,0 +1,1041 @@
+# @ImageJ ij%0A# @Dataset data%0A%0Afrom net.imglib2.util import Intervals%0Afrom net.imagej.axis import Axes%0Afrom net.imagej.ops import Ops%0Afrom net.imglib2.type.numeric.integer import UnsignedShortType%0Afrom net.imglib2.type.numeric.integer import UnsignedByteType%0A%0A# Get the first frame%0At_dim = data.dimensionIndex(Axes.TIME)%0Ainterval_start = %5B%5D%0Ainterval_end = %5B%5D%0Afor d in range(0, data.numDimensions()):%0A%09if d != t_dim:%0A%09%09interval_start.append(0)%0A%09%09interval_end.append(data.dimension(d) - 1)%0A%09else:%0A%09%09interval_start.append(0)%0A%09%09interval_end.append(0)%0A%09%09%0Aintervals = interval_start + interval_end%0Aintervals = Intervals.createMinMax(*intervals)%0A%0Afirst_frame = ij.op().transform().crop(data.getImgPlus(), intervals)%0Aij.ui().show(%22first_frame%22, first_frame)%0A%0A# Subtract the first frame to the stack%0Asubtracted = ij.op().create().img(data.getImgPlus())%0Asub_op =  ij.op().op(%22math.subtract%22, first_frame, first_frame)%0A%0Aij.op().slice(subtracted, data.getImgPlus(), sub_op, %5Bt_dim%5D)%0Aij.ui().show(%22subtracted%22, subtracted)%0A%0Aprint(data.getImgPlus().class)%0A

Add test plugin