interfaces.meshfix¶
MeshFix¶
Wraps the executable command meshfix
.
MeshFix v1.2-alpha - by Marco Attene, Mirko Windhoff, Axel Thielscher.
See also
- http://jmeshlib.sourceforge.net
- Sourceforge page
- http://simnibs.de/installation/meshfixandgetfem
- Ubuntu installation instructions
If MeshFix is used for research purposes, please cite the following paper: M. Attene - A lightweight approach to repairing digitized polygon meshes. The Visual Computer, 2010. (c) Springer.
Accepted input formats are OFF, PLY and STL. Other formats (like .msh for gmsh) are supported only partially.
Example¶
>>> import nipype.interfaces.meshfix as mf
>>> fix = mf.MeshFix()
>>> fix.inputs.in_file1 = 'lh-pial.stl'
>>> fix.inputs.in_file2 = 'rh-pial.stl'
>>> fix.run()
>>> fix.cmdline
'meshfix lh-pial.stl rh-pial.stl -o lh-pial_fixed.off'
Inputs:
[Mandatory]
in_file1: (an existing file name)
argument: ``%s``, position: 1
[Optional]
decouple_inin: (an integer (int or long))
Treat 1st file as inner, 2nd file as outer component.Resolve
overlaps by moving inners triangles inwards. Constrain the min
distance between the components > d.
argument: ``--decouple-inin %d``
laplacian_smoothing_steps: (an integer (int or long))
The number of laplacian smoothing steps to apply
argument: ``--smooth %d``
uniform_remeshing_steps: (an integer (int or long))
Number of steps for uniform remeshing of the whole mesh
argument: ``-u %d``
requires: uniform_remeshing_vertices
cut_inner: (an integer (int or long))
Remove triangles of 1st that are inside of the 2nd shell. Dilate 2nd
by N; Fill holes and keep only 1st afterwards.
argument: ``--cut-inner %d``
join_closest_components: (a boolean)
Join the closest pair of components.
argument: ``-jc``
mutually_exclusive: join_closest_components
save_as_freesurfer_mesh: (a boolean)
Result is saved in freesurfer mesh format
argument: ``--fsmesh``
mutually_exclusive: save_as_vrml, save_as_stl
set_intersections_to_one: (a boolean)
If the mesh contains intersections, return value = 1.If saved in
gmsh format, intersections will be highlighted.
argument: ``--intersect``
finetuning_substeps: (an integer (int or long))
Used to fine-tune the minimal distance between surfaces.A minimal
distance d is ensured, and reached in n substeps. When using the
surfaces for subsequent volume meshing by gmsh, this step prevent
too flat tetrahedra2)
argument: ``%d``, position: -1
requires: finetuning_distance
remove_handles: (a boolean)
Remove handles
argument: ``--remove-handles``
save_as_vrml: (a boolean)
Result is saved in VRML1.0 format (.wrl)
argument: ``--wrl``
mutually_exclusive: save_as_stl, save_as_freesurfer_mesh
join_overlapping_largest_components: (a boolean)
Join 2 biggest components if they overlap, remove the rest.
argument: ``-j``
mutually_exclusive: join_closest_components
decouple_outin: (an integer (int or long))
Treat 1st file as outer, 2nd file as inner component.Resolve
overlaps by moving outers triangles inwards. Constrain the min
distance between the components > d.
argument: ``--decouple-outin %d``
in_file2: (an existing file name)
argument: ``%s``, position: 2
epsilon_angle: (0.0 <= a floating point number <= 2.0)
Epsilon angle in degrees (must be between 0 and 2)
argument: ``-a %f``
finetuning_distance: (a float)
Used to fine-tune the minimal distance between surfaces.A minimal
distance d is ensured, and reached in n substeps. When using the
surfaces for subsequent volume meshing by gmsh, this step prevent
too flat tetrahedra2)
argument: ``%f``, position: -2
requires: finetuning_substeps
cut_outer: (an integer (int or long))
Remove triangles of 1st that are outside of the 2nd shell.
argument: ``--cut-outer %d``
decouple_outout: (an integer (int or long))
Treat 1st file as outer, 2nd file as inner component.Resolve
overlaps by moving outers triangles outwards. Constrain the min
distance between the components > d.
argument: ``--decouple-outout %d``
output_type: ('stl' or 'msh' or 'wrl' or 'vrml' or 'fs' or 'off',
nipype default value: off)
The output type to save the file as.
x_shift: (an integer (int or long))
Shifts the coordinates of the vertices when saving. Output must be
in FreeSurfer format
argument: ``--smooth %d``
number_of_biggest_shells: (an integer (int or long))
Only the N biggest shells are kept
argument: ``--shells %d``
finetuning_outwards: (a boolean)
Similar to finetuning_inwards, but ensures minimal distance in the
other direction
argument: ``--fineTuneOut ``, position: -3
mutually_exclusive: finetuning_inwards
requires: finetuning_distance, finetuning_substeps
save_as_stl: (a boolean)
Result is saved in stereolithographic format (.stl)
argument: ``--stl``
mutually_exclusive: save_as_vrml, save_as_freesurfer_mesh
quiet_mode: (a boolean)
Quiet mode, don't write much to stdout.
argument: ``-q``
args: (a unicode string)
Additional parameters to the command
argument: ``%s``
uniform_remeshing_vertices: (an integer (int or long))
Constrains the number of vertices.Must be used with
uniform_remeshing_steps
argument: ``--vertices %d``
requires: uniform_remeshing_steps
finetuning_inwards: (a boolean)
Used to fine-tune the minimal distance between surfaces.
argument: ``--fineTuneIn ``, position: -3
requires: finetuning_distance, finetuning_substeps
dont_clean: (a boolean)
Don't Clean
argument: ``--no-clean``
environ: (a dictionary with keys which are a bytes or None or a value
of class 'str' and with values which are a bytes or None or a
value of class 'str', nipype default value: {})
Environment variables
dilation: (an integer (int or long))
Dilate the surface by d. d < 0 means shrinking.
argument: ``--dilate %d``
out_filename: (a file name)
The output filename for the fixed mesh file
argument: ``-o %s``
Outputs:
mesh_file: (an existing file name)
The output mesh file