❯ mirtk info 1_to_2.dof.gz
Multi-level FFD:
Global transformation:
tx = 0.0000 ty = 0.0000 tz = 0.0000
rx = 0.0000 ry = 0.0000 rz = 0.0000
sx = 100.0000 sy = 100.0000 sz = 100.0000
sxy = 0.0000 syz = 0.0000 sxz = 0.0000
Local transformation (passive):
3D B-spline FFD:
Number of DOFs: 2523
Number of CPs (active): 441
Number of CPs (passive): 400
Extrapolation mode: Const
Control point lattice:
Size: 29 x 29
Spacing: 10.00000 x 10.00000
Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000]
X-axis: [ -0.61921 , -0.66309 , -0.42057]
Y-axis: [ 0.44986 , 0.13942 , -0.88215]
Z-axis: [ -0.64358 , 0.73544 , -0.21197]
❯ mirtk info 2_to_3.dof.gz
Multi-level FFD:
Global transformation:
tx = 0.0000 ty = 0.0000 tz = 0.0000
rx = 0.0000 ry = 0.0000 rz = 0.0000
sx = 100.0000 sy = 100.0000 sz = 100.0000
sxy = 0.0000 syz = 0.0000 sxz = 0.0000
Local transformation (passive):
3D B-spline FFD:
Number of DOFs: 2523
Number of CPs (active): 441
Number of CPs (passive): 400
Extrapolation mode: Const
Control point lattice:
Size: 29 x 29
Spacing: 10.00000 x 10.00000
Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000]
X-axis: [ -0.61921 , -0.66309 , -0.42057]
Y-axis: [ 0.44986 , 0.13942 , -0.88215]
Z-axis: [ -0.64358 , 0.73544 , -0.21197]
❯ mirtk info 1_to_3.dof.gz
Fluid FFD:
Global transformation:
tx = 0.0000 ty = 0.0000 tz = 0.0000
rx = 0.0000 ry = 0.0000 rz = 0.0000
sx = 100.0000 sy = 100.0000 sz = 100.0000
sxy = 0.0000 syz = 0.0000 sxz = 0.0000
Local transformation (passive):
3D B-spline FFD:
Number of DOFs: 2523
Number of CPs (active): 441
Number of CPs (passive): 400
Extrapolation mode: Const
Control point lattice:
Size: 29 x 29
Spacing: 10.00000 x 10.00000
Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000]
X-axis: [ -0.61921 , -0.66309 , -0.42057]
Y-axis: [ 0.44986 , 0.13942 , -0.88215]
Z-axis: [ -0.64358 , 0.73544 , -0.21197]
Local transformation (passive):
3D B-spline FFD:
Number of DOFs: 2523
Number of CPs (active): 441
Number of CPs (passive): 400
Extrapolation mode: Const
Control point lattice:
Size: 29 x 29
Spacing: 10.00000 x 10.00000
Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000]
X-axis: [ -0.61921 , -0.66309 , -0.42057]
Y-axis: [ 0.44986 , 0.13942 , -0.88215]
Z-axis: [ -0.64358 , 0.73544 , -0.21197]
Affine post-transformation:
tx = 0.0000 ty = 0.0000 tz = 0.0000
rx = 0.0000 ry = 0.0000 rz = 0.0000
sx = 100.0000 sy = 100.0000 sz = 100.0000
sxy = 0.0000 syz = 0.0000 sxz = 0.0000
❯ mirtk info 1_to_3_appr.dof.gz
Fluid FFD:
Global transformation:
tx = 0.0000 ty = 0.0000 tz = 0.0000
rx = 0.0000 ry = -0.0000 rz = 0.0000
sx = 100.0000 sy = 100.0000 sz = 100.0000
sxy = 0.0000 syz = 0.0000 sxz = 0.0000
Local transformation (passive):
3D B-spline FFD:
Number of DOFs: 3
Number of CPs (active): 1
Number of CPs (passive): 0
Extrapolation mode: Const
Control point lattice:
Size: 1 x 1
Spacing: 0.00000 x 0.00000
Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000]
X-axis: [ -0.61921 , -0.66309 , -0.42057]
Y-axis: [ 0.44986 , 0.13942 , -0.88215]
Z-axis: [ -0.64358 , 0.73544 , -0.21197]
Affine post-transformation:
tx = 0.0000 ty = 0.0000 tz = 0.0000
rx = 0.0000 ry = -0.0000 rz = 0.0000
sx = 100.0000 sy = 100.0000 sz = 100.0000
sxy = 0.0000 syz = 0.0000 sxz = 0.0000
❯ mirtk info 1_to_3_single.dof.gz
Multi-level FFD:
Global transformation:
tx = 0.0000 ty = 0.0000 tz = 0.0000
rx = -0.0826 ry = -0.0266 rz = -0.0061
sx = 100.0275 sy = 99.9523 sz = 99.9112
sxy = -0.0525 syz = 0.0757 sxz = -0.0178
Local transformation (passive):
3D B-spline FFD:
Number of DOFs: 2523
Number of CPs (active): 841
Number of CPs (passive): 0
Extrapolation mode: Const
Control point lattice:
Size: 29 x 29
Spacing: 10.00000 x 10.00000
Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000]
X-axis: [ -0.61921 , -0.66309 , -0.42057]
Y-axis: [ 0.44986 , 0.13942 , -0.88215]
Z-axis: [ -0.64358 , 0.73544 , -0.21197]
When I try to compose two
doffiles with the-approximateoption, the result is not as expected. Attached are all the files from this short reproducible example.compose-dofs-reprex.zip
While the first two dof files have a "control point lattice" of 29x29 and the
1_to_3.dof.gzcontains both transformations, the1_to_3_appr.dof.gzhas just a single transformation with a lattice of 1x1. Also, applyingtransform-imageonim1.nii.gzwith the1_to_3.dof.gzhas the intended result while applying it with1_to_3_appr.dof.gzhas almost no effect.As I need a dof file with a single transformation inside, I use
This works as intended.
I think, this problem has previously been reported on Gitter by @karllandheer on Feb 19 2021 22:14
I'm using the latest version of
mirtk, compiled today (mirtk rev 973ce2f, built on Aug 5 2022)Outputs of `mirtk info`
❯ mirtk info 1_to_2.dof.gz Multi-level FFD: Global transformation: tx = 0.0000 ty = 0.0000 tz = 0.0000 rx = 0.0000 ry = 0.0000 rz = 0.0000 sx = 100.0000 sy = 100.0000 sz = 100.0000 sxy = 0.0000 syz = 0.0000 sxz = 0.0000 Local transformation (passive): 3D B-spline FFD: Number of DOFs: 2523 Number of CPs (active): 441 Number of CPs (passive): 400 Extrapolation mode: Const Control point lattice: Size: 29 x 29 Spacing: 10.00000 x 10.00000 Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000] X-axis: [ -0.61921 , -0.66309 , -0.42057] Y-axis: [ 0.44986 , 0.13942 , -0.88215] Z-axis: [ -0.64358 , 0.73544 , -0.21197] ❯ mirtk info 2_to_3.dof.gz Multi-level FFD: Global transformation: tx = 0.0000 ty = 0.0000 tz = 0.0000 rx = 0.0000 ry = 0.0000 rz = 0.0000 sx = 100.0000 sy = 100.0000 sz = 100.0000 sxy = 0.0000 syz = 0.0000 sxz = 0.0000 Local transformation (passive): 3D B-spline FFD: Number of DOFs: 2523 Number of CPs (active): 441 Number of CPs (passive): 400 Extrapolation mode: Const Control point lattice: Size: 29 x 29 Spacing: 10.00000 x 10.00000 Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000] X-axis: [ -0.61921 , -0.66309 , -0.42057] Y-axis: [ 0.44986 , 0.13942 , -0.88215] Z-axis: [ -0.64358 , 0.73544 , -0.21197] ❯ mirtk info 1_to_3.dof.gz Fluid FFD: Global transformation: tx = 0.0000 ty = 0.0000 tz = 0.0000 rx = 0.0000 ry = 0.0000 rz = 0.0000 sx = 100.0000 sy = 100.0000 sz = 100.0000 sxy = 0.0000 syz = 0.0000 sxz = 0.0000 Local transformation (passive): 3D B-spline FFD: Number of DOFs: 2523 Number of CPs (active): 441 Number of CPs (passive): 400 Extrapolation mode: Const Control point lattice: Size: 29 x 29 Spacing: 10.00000 x 10.00000 Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000] X-axis: [ -0.61921 , -0.66309 , -0.42057] Y-axis: [ 0.44986 , 0.13942 , -0.88215] Z-axis: [ -0.64358 , 0.73544 , -0.21197] Local transformation (passive): 3D B-spline FFD: Number of DOFs: 2523 Number of CPs (active): 441 Number of CPs (passive): 400 Extrapolation mode: Const Control point lattice: Size: 29 x 29 Spacing: 10.00000 x 10.00000 Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000] X-axis: [ -0.61921 , -0.66309 , -0.42057] Y-axis: [ 0.44986 , 0.13942 , -0.88215] Z-axis: [ -0.64358 , 0.73544 , -0.21197] Affine post-transformation: tx = 0.0000 ty = 0.0000 tz = 0.0000 rx = 0.0000 ry = 0.0000 rz = 0.0000 sx = 100.0000 sy = 100.0000 sz = 100.0000 sxy = 0.0000 syz = 0.0000 sxz = 0.0000 ❯ mirtk info 1_to_3_appr.dof.gz Fluid FFD: Global transformation: tx = 0.0000 ty = 0.0000 tz = 0.0000 rx = 0.0000 ry = -0.0000 rz = 0.0000 sx = 100.0000 sy = 100.0000 sz = 100.0000 sxy = 0.0000 syz = 0.0000 sxz = 0.0000 Local transformation (passive): 3D B-spline FFD: Number of DOFs: 3 Number of CPs (active): 1 Number of CPs (passive): 0 Extrapolation mode: Const Control point lattice: Size: 1 x 1 Spacing: 0.00000 x 0.00000 Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000] X-axis: [ -0.61921 , -0.66309 , -0.42057] Y-axis: [ 0.44986 , 0.13942 , -0.88215] Z-axis: [ -0.64358 , 0.73544 , -0.21197] Affine post-transformation: tx = 0.0000 ty = 0.0000 tz = 0.0000 rx = 0.0000 ry = -0.0000 rz = 0.0000 sx = 100.0000 sy = 100.0000 sz = 100.0000 sxy = 0.0000 syz = 0.0000 sxz = 0.0000 ❯ mirtk info 1_to_3_single.dof.gz Multi-level FFD: Global transformation: tx = 0.0000 ty = 0.0000 tz = 0.0000 rx = -0.0826 ry = -0.0266 rz = -0.0061 sx = 100.0275 sy = 99.9523 sz = 99.9112 sxy = -0.0525 syz = 0.0757 sxz = -0.0178 Local transformation (passive): 3D B-spline FFD: Number of DOFs: 2523 Number of CPs (active): 841 Number of CPs (passive): 0 Extrapolation mode: Const Control point lattice: Size: 29 x 29 Spacing: 10.00000 x 10.00000 Origin: [ -63.92842 , 33.27434 , -54.88671 , 0.00000] X-axis: [ -0.61921 , -0.66309 , -0.42057] Y-axis: [ 0.44986 , 0.13942 , -0.88215] Z-axis: [ -0.64358 , 0.73544 , -0.21197]