11 #ifndef MESH_PROCESS_CREATION_HPP
12 #define MESH_PROCESS_CREATION_HPP
34 setName(
"Mesh/Creation/Marching Cubes Surface");
35 setDesc(
"Extract surface mesh with marching cubes. A threshold to 0 will interpret the image as binary.");
36 setIcon(QIcon(
":/images/MarchCubes.png"));
37 addParm(
"Cube size (µm)",
"Size for the marching cubes.",
"5.0");
38 addParm(
"Threshold",
"Minimal signal used for surface extraction.",
"5000");
44 if(!checkState().store(STORE_NON_EMPTY).mesh())
47 _stack = currentStack();
48 _store = _stack->currentStore();
49 Mesh* mesh = currentMesh();
51 bool result = run(mesh, _store, parm(
"Cube size (µm)").toFloat(), parm(
"Threshold").toInt());
59 bool run(
Mesh* mesh,
const Store* store,
float cubeSize,
int threshold);
80 setName(
"Mesh/Creation/Marching Cubes 3D");
81 setDesc(
"Extract 3D meshes with marching cubes");
82 setIcon(QIcon(
":/images/MarchCubes3D.png"));
84 addParm(
"Cube size (µm)",
"Size for the marching cubes.",
"5.0");
85 addParm(
"Min Voxels",
"Minimal number of voxels for extracting surface.",
"0");
86 addParm(
"Smooth Passes",
"Smooth Passes.",
"3");
87 addParm(
"Label",
"Extract surface only for this label.",
"0");
92 if(!checkState().store(STORE_LABEL).mesh())
95 _stack = currentStack();
96 _store = _stack->currentStore();
97 Mesh* mesh = currentMesh();
99 bool result = run(mesh, _store, parm(
"Cube size (µm)").toFloat(), parm(
"Min Voxels").toInt(),
100 parm(
"Smooth Passes").toInt(), parm(
"Label").toInt());
103 if(result and not mesh->
showSurface() and not currentMesh()->showMesh())
104 currentMesh()->setShowSurface(
true);
108 bool run(
Mesh* mesh,
const Store* store,
float cubeSize,
int minVoxels,
109 int smooth,
int singleLabel);
130 setName(
"Mesh/Creation/Mesh Cutting Surface");
131 setDesc(
"Make mesh from cutting surface");
136 if(!checkState().mesh())
138 return run(currentMesh());
141 bool run(
Mesh* mesh);
154 setName(
"Mesh/Creation/Voxel Face Mesh");
155 setDesc(
"Extract a mesh from the faces of the voxels.");
160 if(!checkState().mesh().store(STORE_LABEL))
162 return run(currentStack(), currentStack()->currentStore(), currentMesh());
173 setName(
"Mesh/Creation/Mesh From Local Maxima");
174 setDesc(
"Create a Mesh from Local Maxima");
176 addParm(
"Radius (µm)",
"Radius (µm)",
"3.0");
182 if(!checkState().store(STORE_NON_EMPTY))
184 return run(currentMesh(), currentStack()->currentStore(), parm(
"Radius (µm)").toFloat());
187 bool run(
Mesh* mesh,
const Store* store,
float radius);