1:orphan:
2
3.. Auto-generated by help-rst from "mirtk deform-mesh -h" output
4
5deform-mesh
6===========
7
8.. program:: deform-mesh
9
10
11Synopsis
12--------
13
14::
15
16    deform-mesh <input> <output> [options]
17
18
19Description
20-----------
21
22.. include:: _descriptions/deform-mesh.rst
23
24
25
26Input options
27-------------
28
29.. option:: -initial <file>
30
31   Point set used to initialize the deformed output mesh. Usually the output of a
32   previous optimization with possibly saved node status (see :option:`-save-status`).
33   (default: input)
34
35.. option:: -dof <type> [<dx> [<dy> <dz>]]
36
37   Optimize spatial transformation of named <type> to deform the mesh points.
38   The optional <dx>, <dy>, and <dz> arguments specify the control point spacing
39   of free-form deformation (FFD) transformations. Common transformation types are:
40
41   - ``FFD``:   Cubic B-spline FFD.
42   - ``SVFFD``: Stationary velocity (SV) cubic B-spline FFD.
43
44.. option:: -image <file>
45
46   Intensity image on which external forces are based. (default: none)
47
48.. option:: -distance-image, -dmap <file>
49
50   Euclidean distance image on which implicit surface forces are based. (default: none)
51
52.. option:: -distance-offset, -dmap-offset <value>
53
54   Implicit surface isovalue of :option:`-distance-image`. (default: 0)
55
56.. option:: -mask <file>
57
58   Mask defining region in which external forces are non-zero. (default: none)
59
60.. option:: -padding <value>
61
62   Padding/Background value of input :option:`-image`. (default: none)
63
64.. option:: -inflate-brain
65
66   Set default parameters of cortical surface inflation process equivalent
67   to FreeSurfer's mris_inflate command.
68
69
70Optimization options
71--------------------
72
73.. option:: -optimizer <name>
74
75   Optimization method used to minimize the energy of the deformable surface model:
76
77   - ``EulerMethod``:              Forward Euler integration (default)
78   - ``EulerMethodWithDamping``:   Forward Euler integration with momentum.
79   - ``EulerMethodWithMomentum``:  Forward Euler integration with momentum.
80   - ``GradientDescent``:          Gradient descent optimizer.
81   - ``ConjugateGradientDescent``: Conjugate gradient descent.
82
83.. option:: -line-search, -linesearch <name>
84
85   Line search method used by gradient descent optimizers:
86
87   - ``Adaptive``: Line search with adaptive step length. (default)
88   - ``Brent``: Brent's line search method.
89
90.. option:: -damping <value>
91
92   Damping ratio used by Euler method with momentum modelling the effect
93   of dissipation of kinetic energy.
94
95.. option:: -momentum <value>
96
97   Momentum of Euler method with momentum, i.e., :math:`1 - damping` (see :option:`-damping`)
98
99.. option:: -mass <value>
100
101   Node mass used by Euler methods with momentum. (default: 1)
102
103.. option:: -levels <max> | <min> <max>
104
105   Perform optimization on starting at level <max> until level <min> (> 0).
106   When only the <max> level argument is given, the <min> level is set to 1.
107   On each level, the node forces are averaged :math:`2^{level-1}` times which
108   is similar to computing the forces on a coarser mesh. See :option:`-force-averaging`. (default: 0 0)
109
110.. option:: -force-averaging <n>...
111
112   Number of force averaging steps. (default: 0)
113   Cannot be combined with :option:`-magnitude-averaging`.
114
115.. option:: -magnitude-averaging <n>...
116
117   Number of force magnitude averaging steps. (default: 0)
118   Cannot be combined with :option:`-force-averaging`.
119
120.. option:: -distance-averaging <n>...
121
122   Number of :option:`-distance` force averaging steps. (default: 0)
123
124.. option:: -steps, -max-steps, -iterations, -max-iterations <n>...
125
126   Maximum number of iterations. (default: 100)
127
128.. option:: -step, -dt <value>...
129
130   Length of integration/gradient steps. (default: 1)
131
132.. option:: -max-dx, -maxdx, -dx <value>...
133
134   Maximum displacement of a node at each iteration. By default, the node displacements
135   are normalized by the maximum node displacement. When this option is used, the node
136   displacements are clamped to the specified maximum length instead. (default: :option:`-step`)
137
138.. option:: -max-displacement <value>
139
140   Maximum distance from input surface. (default: +inf)
141
142.. option:: -remesh <n>
143
144   Remesh surface mesh every n-th iteration. (default: 0)
145
146.. option:: -remesh-adaptively
147
148   Remesh surface mesh using an adaptive edge length interval based on local curvature
149   of the deformed surface mesh or input implicit surface (:option:`-distance-image`).
150
151.. option:: -triangle-inversion, -notriangle-inversion
152
153   Whether to allow inversion of pair of triangles during surface remeshing. (default: on)
154
155.. option:: -min-edgelength <value>...
156
157   Minimum edge length used for local adaptive remeshing. (default: -1)
158
159.. option:: -max-edgelength <value>...
160
161   Maximum edge length used for local adaptive remeshing. (default: -1)
162
163.. option:: -min-angle <degrees>...
164
165   Minimum angle between edge node normals for an edge be excluded from collapsing during
166   iterative :option:`-remesh` operations. (default: 180)
167
168.. option:: -max-angle <degrees>...
169
170   Maximum angle between edge node normals for an edge be excluded from splitting during
171   iterative :option:`-remesh` operations. (default: 180)
172
173.. option:: -lowpass <n>
174
175   Low-pass filter surface mesh every n-th iteration. (default: 0)
176
177.. option:: -lowpass-iterations <n>
178
179   Number of :option:`-lowpass` filter iterations. (default: 100)
180
181.. option:: -lowpass-band <band>
182
183   Low-pass filtering band argument, usually in the range [0, 2]. (default: 0.75)
184
185.. option:: -nointersection
186
187   Hard non-self-intersection constraint for surface meshes. (default: off)
188
189.. option:: -mind, -min-distance <value>
190
191   Minimum distance to other triangles in front of a given triangle.
192
193.. option:: -minw, -min-width <value>
194
195   Minimum distance to other triangles in the back of a given triangle.
196
197.. option:: -max-collision-angle <degrees>
198
199   Maximum angle between vector connecting centers of nearby triangles and the face normal
200   of the reference triangle for a collision to be detected. When the triangles are within
201   the same flat neighborhood of the surface mesh, this angle will be close to 90 degrees.
202   This parameter reduces false collision detection between neighboring triangles. (default: 45)
203
204.. option:: -fast-collision-test
205
206   Use fast approximate triangle-triangle collision test based on distance of their centers only. (default: off)
207
208.. option:: -reset-status
209
210   Set status of all mesh nodes to active again after each level (see :option:`-levels`). (default: off)
211
212
213Deformable model options
214------------------------
215
216.. option:: -neighborhood <n>
217
218   Size of node neighborhoods used by internal force terms that consider more
219   than only the adjacent nodes, but also up to n-connected nodes. (default: 2)
220
221.. option:: -distance <w>
222
223   Weight of implicit surface distance. (default: 0)
224
225.. option:: -distance-measure <name>
226
227   Implicit surface distance measure used by :option:`-distance`:
228
229   - ``minimum``: Minimum surface distance (see :option:`-distance-image`, default)
230   - ``normal``:  Estimate distance by casting rays along normal direction.
231
232.. option:: -balloon-inflation, -balloon <w>
233
234   Weight of inflation force based on local intensity statistics. (default: 0)
235
236.. option:: -balloon-deflation <w>
237
238   Weight of deflation force based on local intensity statistics. (default: 0)
239
240.. option:: -balloon-min <intensity>
241
242   Global lower intensity threshold for :option:`-balloon-inflation` or :option:`-balloon-deflation`. (default: -inf)
243
244.. option:: -balloon-max <intensity>
245
246   Global upper intensity threshold for :option:`-balloon-inflation` or :option:`-balloon-deflation`. (default: +inf)
247
248.. option:: -balloon-range <min> <max>
249
250   Global intensity thresholds for :option:`-balloon-inflation` or :option:`-balloon-deflation`. (default: [-inf +inf])
251
252.. option:: -balloon-radius <r>
253
254   Radius for local intensity statistics of :option:`-balloon-inflation` or :option:`-balloon-deflation`. (default: 7 times voxel size)
255
256.. option:: -balloon-sigma <sigma>
257
258   Local intensity standard deviation scaling factor of :option:`-balloon-inflation` or :option:`-balloon-deflation`. (default: 5)
259
260.. option:: -balloon-mask <file>
261
262   Image mask used for local intensity statistics for :option:`-balloon-inflation` or :option:`-balloon-deflation`.
263   (default: interior of deformed surface)
264
265.. option:: -edges <w>
266
267   Weight of image edge force. (default: 0)
268
269.. option:: -edge-distance <w>
270
271   Weight of closest image edge distance force. (default: 0)
272
273.. option:: -inflation <w>
274
275   Weight of surface inflation force used for cortical surface inflation. (default: 0)
276
277.. option:: -bending-energy <w>
278
279   Weight of bending energy of :option:`-dof` transformation. (default: 0)
280
281.. option:: -spring <w>
282
283   Weight of internal spring force. (default: 0)
284
285.. option:: -normal-spring, -nspring <w>
286
287   Weight of internal spring force in normal direction. (default: 0)
288
289.. option:: -tangential-spring, -tspring <w>
290
291   Weight of internal spring force in tangent plane. (default: 0)
292
293.. option:: -normalized-spring <w>
294
295   Weight of internal spring force normalized w.r.t. force in normal direction. (default: 0)
296
297.. option:: -curvature <w>
298
299   Weight of surface curvature. (default: 0)
300
301.. option:: -quadratic-curvature, -qcurvature <w>
302
303   Weight of surface curvature estimated by quadratic fit of node neighbor to tangent plane distance. (default: 0)
304
305.. option:: -distant-quadratic-curvature, -distant-qcurvature <w>
306
307   Weight of :option:`-quadratic-curvature` proportional to the :option:`-distance` magnitude. (default: 0)
308
309.. option:: -mean-curvature, -mcurvature <w>
310
311   Weight of mean curvature constraint. (default: 0)
312
313.. option:: -distant-mean-curvature, -distant-mcurvature <w>
314
315   Weight of :option:`-mean-curvature` proportional to the :option:`-distance` magnitude. (default: 0)
316
317.. option:: -gauss-curvature, -gcurvature <w>
318
319   Weight of Gauss curvature constraint. (default: 0)
320
321.. option:: -distant-gauss-curvature, -distant-gcurvature <w>
322
323   Weight of :option:`-gauss-curvature` proportional to the :option:`-distance` magnitude. (default: 0)
324
325.. option:: -distortion <w>
326
327   Weight of metric distortion.
328
329.. option:: -stretching <w>
330
331   Weight of spring force based on difference of neighbor distance compared to
332   initial distance. (default: 0)
333
334.. option:: -repulsion <w>
335
336   Weight of node repulsion force. (default: 0)
337
338.. option:: -repulsion-radius <r>
339
340   Radius of node repulsion force. (default: average edge length)
341
342.. option:: -repulsion-distance <r>
343
344   Frontface radius of node repulsion force. (default: average edge length)
345
346.. option:: -repulsion-width <r>
347
348   Backface radius of node repulsion force. (default: average edge length)
349
350.. option:: -collision <w>
351
352   Weight of triangle repulsion force.
353
354.. option:: -normal <w>
355
356   Constant force along outwards normal direction (positive weight)
357   or inwards normal direction (negative weight).
358
359
360Stopping criterion options
361--------------------------
362
363.. option:: -extrinsic-energy
364
365   Consider only sum of external energy terms as total energy value of deformable model functional.
366   Internal forces still contribute to the gradient of the functional, but are excluded from the
367   energy function value (see :option:`-epsilon` and :option:`-min-energy`). (default: off)
368
369.. option:: -epsilon <value>
370
371   Minimum change of deformable surface energy convergence criterion.
372
373.. option:: -delta <value>...
374
375   Minimum maximum node displacement or :option:`-dof` parameter value. (default: 1e-6)
376
377.. option:: -min-energy <value>
378
379   Target deformable surface energy value. (default: 0)
380
381.. option:: -min-active <ratio>...
382
383   Minimum ratio of active nodes in [0, 1]. (default: 0)
384
385.. option:: -inflation-error <threshold>
386
387   Threshold of surface inflation RMS measure. (default: off)
388
389
390Output options
391--------------
392
393.. option:: -track [<name>]
394
395   Record sum of node displacements along normal direction. The integrated
396   displacements are stored in the point data array named "NormalDisplacement"
397   by default or with the specified <name>. (default: off)
398
399.. option:: -track-zero-mean [<name>]
400
401   Same as :option:`-track`, but subtract mean from tracked values.
402   This option is implicit when :option:`-inflate-brain` is given to inflate a cortical
403   brain surface. The default output array name is "SulcalDepth". Otherwise, the default
404   point data array name is "NormalDisplacementZeroMean". (default: off)
405
406.. option:: -track-zero-median [<name>]
407
408   Same as :option:`-track`, but subtract median from tracked values.
409   The default point data array name is "NormalDisplacementZeroMedian". (default: off)
410
411.. option:: -track-unit-variance [<name>]
412
413   Same as :option:`-track`, but divide tracked values by their standard deviation.
414   The default point data array name is "NormalDisplacementUnitVariance". (default: off)
415
416.. option:: -track-zvalues [<name>]
417
418   Same as :option:`-track`, but subtract mean from tracked values and divide by standard deviation.
419   The resulting values are the Z-score normalized standard scores of the tracked displacements.
420   The default point data array name is "NormalDisplacementZValues". (default: off)
421
422.. option:: -track-zero-median-zvalues [<name>]
423
424   Same as :option:`-track`, but subtract median from tracked values and divide by standard deviation.
425   It can be used with :option:`-inflate-brain` to obtain a normalized curvature measure.
426   The default point data array name is "NormalDisplacementZeroMedianZValues". (default: off)
427
428.. option:: -track-without-momentum
429
430   When tracking the total displacement of a node in normal direction using the EulerMethodWithMomentum
431   :option:`-optimizer` as used in particular by :option:`-inflate-brain`, exclude the momentum from the.
432   tracked displacement. This is idential to FreeSurfer's mrisTrackTotalDisplacement used for the curvature
433   output of mris_inflate. The correct curvature value is, however, obtained by including the momentum
434   component as it integrates the actual amount by which each node is displaced during the Euler steps.
435   Not using this option corresponds to the mrisTrackTotalDisplacementNew function. (default: off)
436
437.. option:: -notrack
438
439   Do not track node displacements along normal direction.
440
441.. option:: -center-output
442
443   Center output mesh such that center is at origin. (default: off)
444
445.. option:: -match-area
446
447   Scale output mesh by ratio of input and output surface area. (default: off)
448
449.. option:: -match-sampling
450
451   Resample output mesh at corresponding positions of input mesh.
452   This option is only useful in conjunction with :option:`-remesh`. (default: off)
453
454.. option:: -save-status
455
456   Save node status (active/passive) to output file. (default: off)
457
458.. option:: -ascii | -nobinary
459
460   Write legacy VTK in ASCII format. (default: off)
461
462.. option:: -binary | -noascii
463
464   Write legacy VTK in binary format. (default: on)
465
466.. option:: -compress, -nocompress
467
468   Write XML VTK file with or without compression. (default: on)
469
470.. option:: -debug-prefix <prefix>
471
472   File name prefix for :option:`-debug` output. (default: deform_mesh\_)
473
474.. option:: -debug-interval <n>
475
476   Write :option:`-debug` output every n-th iteration. (default: 10)
477
478.. option:: -level-prefix, -nolevel-prefix
479
480   Write :option:`-debug` output without level prefix in file names. (default: on)
481
482
483Advanced options
484----------------
485
486.. option:: -par <name> <value>
487
488   Advanced option to set surface model or optimizer parameter.
489
490
491Standard options
492----------------
493
494.. option:: -v, -verbose [n]
495
496   Increase/Set verbosity of output messages. (default: 1)
497
498.. option:: -debug [level]
499
500   Increase/Set debug level for output of intermediate results. (default: 0)
501
502.. option:: -version [major.minor]
503
504   Print version and exit or set version to emulate.
505
506.. option:: -revision
507
508   Print revision (or version) number only and exit.
509
510.. option:: -h, -help
511
512   Print help and exit.
513
514
515Terminal options
516----------------
517
518.. option:: -color, -nocolor
519
520   Enable/disable colored output. (default: off)
521
522
523Parallelization options
524-----------------------
525
526.. option:: -threads <n>
527
528   Use maximal <n> threads for parallel execution. (default: automatic)
529