Created
April 22, 2022 15:03
-
-
Save imagejan/5b34af505de190d957c385587bd47a1f to your computer and use it in GitHub Desktop.
[Fiji/ImgLib2] Create a partial projection of a stack, with a sliding interval of defined size.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@ Dataset input | |
#@ OpService ops | |
#@ Integer (label="Width of sliding window (frames)") window | |
#@output projected | |
// Add a new dimension of window size | |
added = ops.transform().addDimensionView(input, 0, window-1) | |
extended = ops.transform().extendBorderView(added) | |
// Shear along time dimension, | |
// with sliding window dimension as reference | |
tilted = ops.transform().shearView(extended, added, 2, 3) | |
// Project along sliding window dimension | |
projected = ops.create().img(input) | |
op = ops.op("stats.mean", input) | |
ops.transform().project(projected, tilted, op, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment