Created
December 22, 2022 21:45
-
-
Save bogovicj/8153953a75dd8537b381d80b6862bda4 to your computer and use it in GitHub Desktop.
ImageJ2 script to compose displacement fields
This file contains hidden or 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 da | |
#@ Dataset db | |
dap = Views.moveAxis( da, 2, 0 ); | |
dbp = Views.moveAxis( da, 2, 0 ); | |
spacing = [1, 1, 1] as double[]; | |
dfA = new DisplacementFieldTransform( dap, spacing ); | |
dfB = new DisplacementFieldTransform( dbp, spacing ); | |
seq = new RealTransformSequence(); | |
seq.add( dfA ); | |
seq.add( dfB ); | |
sz = dap.dimensionsAsLongArray(); | |
itvl = new FinalInterval( sz[1..<sz.size()] as long[] ); | |
compRaw = DisplacementFieldTransform.createDisplacementField( seq, itvl, spacing ); | |
comp = Views.moveAxis( compRaw, 0, 2 ); | |
ImageJFunctions.show( comp ); | |
import net.imglib2.*; | |
import net.imglib2.view.*; | |
import net.imglib2.realtransform.*; | |
import net.imglib2.type.numeric.real.*; | |
import net.imglib2.img.display.imagej.ImageJFunctions; | |
import net.imglib2.util.*; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment