MorphoGraphX
MeshProcessSignal.hpp
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef MESH_PROCESS_SIGNAL_HPP
12 #define MESH_PROCESS_SIGNAL_HPP
13 
14 #include <Process.hpp>
15 
16 #include <Curvature.hpp>
17 
18 class Ui_LoadHeatMap;
19 
20 namespace mgx { namespace process {
21 
22  typedef std::map<int, HVec3U> IntHVec3UMap;
23 
26 
32  class mgxBase_EXPORT ViewMeshProcess : public MeshProcess {
33  public:
34  ViewMeshProcess(const MeshProcess& process) : Process(process), MeshProcess(process) {}
35 
36  bool operator()(const QStringList& parms);
37 
38  QString folder() const { return "System"; }
39  QString name() const { return "View"; }
40  QString description() const { return
41  "Modify how the current mesh is viewed. Useful for scripts."; }
42  QStringList parmNames() const { return QStringList()
43  << "Show Surface" << "Surface Type" << "Signal Type" << "Blend" << "Cull"
44  << "Show Mesh" << "Mesh View" << "Show Lines" << "Show Points" << "Show Map"
45  << "Scale" << "Transform" << "BBox" << "Brightness" << "Opacity";
46  }
47  QStringList parmDescs() const { return QStringList()
48  << "Draw mesh as a continuous surface."
49  << "Nrml: show projected signal, Labels: color triangles according to assigned "
50  "labels, Parents: color triangles with parent labels, Heat: color triangles "
51  "with computed heat map (e.g. growth)"
52  << "Signal: show projected signal, Tex: Use 3D stack as texture, Img: Use 2D "
53  "texture (height map)."
54  << "Semi-transparent mesh, for example to superimpose to meshes or view the "
55  "stack through the mesh."
56  << "Color the triangles (with signal or labels) only on the top of the mesh."
57  << "Draw triangle edges and nodes"
58  << "All: draw all triangles. Border: draw outside edge of the mesh only. "
59  "Cells: draw cell outlines only. Selected: draw selected nodes only. "
60  << "Show connecting lines between nodes in the mesh."
61  << "Show mesh nodes."
62  << "Mapping of text on the labels (e.g. label number)"
63  << "Change scaling of mesh/stacks, independently in 3 directions (x,y,z). NB: "
64  << "a stack saved with 'Scale' turned on will have a modified voxel size, "
65  "while saved meshes are unaffected. "
66  << "Apply rotation and translation to the mesh/stack."
67  << "Display the bounding box (i.e. total size) of a stack."
68  << "Brightness of signal, labels or heat"
69  << "Opacity of signal, labels or heat";
70  }
71 
72  QStringList parmDefaults() const { return QStringList()
73  << "" << "" << "" << "" << "" << "" << "" << "" << "" << ""
74  << "" << "" << "" << "-1" << "-1"; }
75 
77  {
78  QStringList bools = QStringList() << "" << booleanChoice();
79  ParmChoiceMap map;
80  map[0] = bools;
81  map[1] = QStringList() << "" << "Normal" << "Heat" << "Label";
82  map[2] = QStringList() << "" << "Signal" << "Texture" << "Image";
83  map[3] = map[4] = map[5] = bools;
84  map[6] = QStringList() << "" << "All" << "Border" << "Cells" << "Selected";
85  map[7] = map[8] = map[9] = map[10] = map[11] = map[12] = bools;
86  return map;
87  }
88  QIcon icon() const { return QIcon(":/images/Palette.png"); }
89  };
90 
96  class mgxBase_EXPORT ProjectSignal : public MeshProcess {
97  public:
98  ProjectSignal(const MeshProcess& process) : Process(process), MeshProcess(process) {}
99 
100  bool operator()(const QStringList& parms)
101  {
102  if(!checkState().store(STORE_NON_LABEL).mesh(MESH_NON_EMPTY))
103  return false;
104  return (*this)(currentStack()->currentStore(), currentMesh(), stringToBool(parms[0]),
105  parms[1].toFloat(), parms[2].toFloat(), parms[3].toFloat(), parms[4].toFloat());
106  }
107 
108  bool operator()(const Store* store, Mesh* mesh, bool useAbsSignal, float minDist,
109  float maxDist, float absSignalMin, float absSignalMax);
110  void projSignal(const Stack* stack, const HVecUS& data, vertex v, float mindist, float maxdist);
111  QString folder() const { return "Signal"; }
112  QString name() const { return "Project Signal"; }
113  QString description() const { return "Project signal onto mesh, perpendicular to its curved surface."; }
114  QStringList parmNames() const { return QStringList()
115  << "Use absolute" << QString("Min Dist (%1)").arg(UM) << QString("Max Dist (%1)").arg(UM)
116  << "Min Signal" << "Max Signal";
117  }
118  QStringList parmDescs() const { return QStringList()
119  << "Use absolute values of signal, instead of normalizing it, useful for signal quantification."
120  << "Distance (triangle-voxel) above which the signal is projected."
121  << "Maximal distance (triangle-voxel) used for signal projection."
122  << "Lower bound of signal value if 'Use absolute' is chosen"
123  << "Upper bound of projected signal value.";
124  }
125  QStringList parmDefaults() const { return QStringList() << "No" << "2.0" << "6.0" << "0.0" << "60000.0"; }
127  {
128  ParmChoiceMap map;
129  map[0] = booleanChoice();
130  return map;
131  }
132  QIcon icon() const { return QIcon(":/images/ProjectColor.png"); }
133  };
134 
140  class mgxBase_EXPORT SmoothMeshSignal : public MeshProcess {
141  public:
142  SmoothMeshSignal(const MeshProcess& process) : Process(process), MeshProcess(process) {}
143 
144  bool operator()(const QStringList& parms)
145  {
146  if(!checkState().mesh(MESH_NON_EMPTY))
147  return false;
148  return (*this)(currentMesh(), parms[0].toUInt());
149  }
150 
151  bool operator()(Mesh* mesh, uint passes);
152 
153  QString folder() const { return "Signal"; }
154  QString name() const { return "Smooth Mesh Signal"; }
155  QString description() const { return "Averages the signal of each node, based on its immediate neighbors."; }
156  QStringList parmNames() const { return QStringList() << "Passes"; }
157  QStringList parmDescs() const { return QStringList() << "Number of smoothing iterations."; }
158  QStringList parmDefaults() const { return QStringList() << "3"; }
159  QIcon icon() const { return QIcon(":/images/SmoothColor.png"); }
160  };
161 
167  class mgxBase_EXPORT MeshBrightness : public MeshProcess {
168  public:
169  MeshBrightness(const MeshProcess& process) : Process(process), MeshProcess(process) {}
170 
171  bool operator()(const QStringList& parms)
172  {
173  if(!checkState().mesh(MESH_NON_EMPTY))
174  return false;
175  return (*this)(currentMesh(), parms[0].toFloat());
176  }
177 
178  bool operator()(Mesh* mesh, float amount);
179 
180  QString folder() const { return "Signal"; }
181  QString name() const { return "Mesh Brighness"; }
182  QString description() const { return "Changes the brightness of the signal on a mesh."; }
183  QStringList parmNames() const { return QStringList() << "Amount"; }
184  QStringList parmDescs() const { return QStringList() << "Amount to multiply the signal, >1 is brighter"; }
185  QStringList parmDefaults() const { return QStringList() << "2.0"; }
186  QIcon icon() const { return QIcon(":/images/Brightness.png"); }
187  };
188 
194  class mgxBase_EXPORT ClearMeshSignal : public MeshProcess {
195  public:
196  ClearMeshSignal(const MeshProcess& process) : Process(process), MeshProcess(process) {}
197 
198  bool operator()(const QStringList& parms)
199  {
200  if(!checkState().mesh(MESH_NON_EMPTY))
201  return false;
202  return (*this)(currentMesh(), parms[0].toUInt());
203  }
204 
205  bool operator()(Mesh* mesh, uint value);
206 
207  QString folder() const { return "Signal"; }
208  QString name() const { return "Clear Mesh Signal"; }
209  QString description() const { return "Erase the signal on the mesh"; }
210  QStringList parmNames() const { return QStringList() << "Value"; }
211  QStringList parmDescs() const { return QStringList() << "Assign this signal value to the mesh."; }
212  QStringList parmDefaults() const { return QStringList() << "50000"; }
213  QIcon icon() const { return QIcon(":/images/ClearSignal.png"); }
214  };
215 
222  class mgxBase_EXPORT ProjectCurvature : public MeshProcess {
223  public:
224  ProjectCurvature(const MeshProcess& process) : Process(process), MeshProcess(process) {}
225 
226  bool operator()(const QStringList& parms)
227  {
228  if(!checkState().mesh(MESH_NON_EMPTY))
229  return false;
230  bool ok;
231  float neighborhood = parms[2].toFloat(&ok);
232  if(not ok)
233  return setErrorMessage("Error, parameter 'Neighborhood' must be a number");
234  float mincurv = parms[4].toFloat(&ok);
235  if(not ok)
236  return setErrorMessage("Error, parameter 'Min Curv' must be a number");
237  float maxcurv = parms[5].toFloat(&ok);
238  if(not ok)
239  return setErrorMessage("Error, parameter 'Max Curv' must be a number");
240  float percentile = parms[6].toFloat(&ok);
241  if(not ok)
242  return setErrorMessage("Error, parameter 'Percentile' must be a number");
243  return (*this)(currentMesh(), parms[0], parms[1], neighborhood, stringToBool(parms[3]), mincurv, maxcurv,
244  percentile);
245  }
246 
247  bool operator()(Mesh* mesh, QString output, QString type, float neighborhood, bool auto_scale, float mincurv,
248  float maxcurv, int percentile);
249 
250  QString folder() const { return "Signal"; }
251  QString name() const { return "Project Mesh Curvature"; }
252  QString description() const { return
253  "Compute curvature at each node of the mesh, for a given neighborhood size. "
254  "Curvature values are stored as signal.";
255  }
256  QStringList parmNames() const { return QStringList()
257  << "Output" << "Type" << QString("Neighborhood (%1)").arg(UM) << "AutoScale"
258  << "Min Curv" << "Max Curv" << "Autoscale percentile";
259  }
260  QStringList parmDescs() const { return QStringList()
261  << "Name of output file, if desired."
262  << "Minimal = minCurv, Maximal = maxCurv, Gaussian = maxCurv * minCurv, "
263  "SumSquare = maxCurv^2 + minCurv^2, Average = (maxCurv + minCurv)/2, "
264  "SignedAverageAbs = sign(max or min) x (abs(maxCurv) + abs(minCurv))/2"
265  << QString("Neighborhood (%1)").arg(UM)
266  << "Clip max and min signal range according to curvature distribution"
267  << "Minimal curvature value displayed"
268  << "Maximal curvature value displayed"
269  << "Auto-scale signal range based on curvature percentile";
270  }
272  << "" << "Gaussian" << "3.0" << "Yes" << "-50.0" << "50.0" << "85"; }
274  {
275  ParmChoiceMap map;
276  map[1] = QStringList() << "Minimal" << "Maximal" << "Gaussian" << "SumSquare" << "Average" << "SignedAverageAbs";
277  map[3] = booleanChoice();
278  return map;
279  }
280  QIcon icon() const { return QIcon(":/images/Curvature.png"); }
281  };
282 
288  class mgxBase_EXPORT MeshGaussianBlur : public MeshProcess {
289  public:
290  MeshGaussianBlur(const MeshProcess& process) : Process(process), MeshProcess(process) {}
291 
292  bool operator()(const QStringList& parms)
293  {
294  if(!checkState().mesh(MESH_NON_EMPTY))
295  return false;
296  return (*this)(currentMesh(), parms[0].toFloat());
297  }
298 
299  bool operator()(Mesh* mesh, float radius);
300 
301  QString folder() const { return "Signal"; }
302  QString name() const { return "Gaussian Blur"; }
303  QString description() const { return "Apply Gaussian Blur to mesh signal"; }
304  QStringList parmNames() const { return QStringList() << QString("Radius (%1)").arg(UM); }
305  QStringList parmDescs() const { return QStringList()
306  << "Size of neighborhood used for Gaussian blur. The blur function standard "
307  "deviation is given by sigma = radius/2. ";
308  }
309  QStringList parmDefaults() const { return QStringList() << "2.0"; }
310  QIcon icon() const { return QIcon(":/images/Blur.png"); }
311  };
312 
318  class mgxBase_EXPORT MeshDiffGaussians : public MeshProcess {
319  public:
320  MeshDiffGaussians(const MeshProcess& process) : Process(process), MeshProcess(process) {}
321 
322  bool operator()(const QStringList& parms)
323  {
324  if(!checkState().mesh(MESH_NON_EMPTY))
325  return false;
326  return (*this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat());
327  }
328 
329  bool operator()(Mesh* mesh, float radius1, float radius2);
330 
331  QString folder() const { return "Signal"; }
332  QString name() const { return "Difference of Gaussians"; }
333  QString description() const { return "Calculate a difference of Gaussians for the mesh signal"; }
334  QStringList parmNames() const { return QStringList() << QString("Radius1 (%1)").arg(UM) << QString("Radius2 (%1)").arg(UM); }
335  QStringList parmDescs() const { return QStringList() << "Size of first neighborhood" << "Size of second neighborhood"; }
336  QStringList parmDefaults() const { return QStringList() << "1.0" << "5.0"; }
337  QIcon icon() const { return QIcon(":/images/Blur.png"); }
338  };
339 
345  class mgxBase_EXPORT MeshLocalMinima : public MeshProcess {
346  public:
347  MeshLocalMinima(const MeshProcess& process) : Process(process), MeshProcess(process) {}
348 
349  bool operator()(const QStringList& parms)
350  {
351  if(!checkState().mesh(MESH_NON_EMPTY))
352  return false;
353  return (*this)(currentMesh(), parms[0].toFloat());
354  }
355 
356  bool operator()(Mesh* mesh, float radius);
357 
358  QString folder() const { return "Segmentation"; }
359  QString name() const { return "Auto-Seeding"; }
360  QString description() const { return "Put a seed at local minima of mesh signal."; }
361  QStringList parmNames() const { return QStringList() << QString("Radius (%1)").arg(UM); }
362  QStringList parmDescs() const { return QStringList()
363  << "Size of neighborhood used for search of local minima. Typically, "
364  "the radius of smallest cells in the sample.";
365  }
366  QStringList parmDefaults() const { return QStringList() << "3.0"; }
367  QIcon icon() const { return QIcon(":/images/LocalMinima.png"); }
368  };
369 
375  class mgxBase_EXPORT MeshNormalize : public MeshProcess {
376  public:
377  MeshNormalize(const MeshProcess& process) : Process(process), MeshProcess(process) {}
378 
379  bool operator()(const QStringList& parms)
380  {
381  if(!checkState().mesh(MESH_NON_EMPTY))
382  return false;
383  return (*this)(currentMesh(), parms[0].toFloat());
384  }
385 
386  bool operator()(Mesh* mesh, float radius);
387 
388  QString folder() const { return "Signal"; }
389  QString name() const { return "Normalize Signal"; }
390  QString description() const { return "Normalize mesh signal locally."; }
391  QStringList parmNames() const { return QStringList() << QString("Radius (%1)").arg(UM); }
392  QStringList parmDescs() const { return QStringList() << "Size of neighborhood used for normalization."; }
393  QStringList parmDefaults() const { return QStringList() << "5.0"; }
394  QIcon icon() const { return QIcon(":/images/Normalize.png"); }
395  };
396 
404  class MeshDilation : public MeshProcess {
405  public:
406  MeshDilation(const MeshProcess& process) : Process(process), MeshProcess(process) {}
407 
408  bool operator()(const QStringList& parms)
409  {
410  if(!checkState().mesh(MESH_NON_EMPTY))
411  return false;
412  return (*this)(currentMesh(), parms[0].toFloat());
413  }
414 
415  bool operator()(Mesh* mesh, float radius);
416 
417  QString folder() const { return "Signal"; }
418  QString name() const { return "Dilate Signal"; }
419  QString description() const { return "Morphological dilation of signal on mesh."; }
420  QStringList parmNames() const { return QStringList() << QString("Radius (%1)").arg(UM); }
421  QStringList parmDescs() const { return QStringList() << "Size of neighborhood used for dilation."; }
422  QStringList parmDefaults() const { return QStringList() << "1.0"; }
423  QIcon icon() const { return QIcon(":/images/Dilate.png"); }
424  };
425 
433  class MeshErosion : public MeshProcess {
434  public:
435  MeshErosion(const MeshProcess& process) : Process(process), MeshProcess(process) {}
436 
437  bool operator()(const QStringList& parms)
438  {
439  if(!checkState().mesh(MESH_NON_EMPTY))
440  return false;
441  return (*this)(currentMesh(), parms[0].toFloat());
442  }
443 
444  bool operator()(Mesh* mesh, float radius);
445 
446  QString folder() const { return "Signal"; }
447  QString name() const { return "Erode Signal"; }
448  QString description() const { return "Apply morphological erosion to mesh signal (opposite to Dilate Signal)."; }
449  QStringList parmNames() const { return QStringList() << QString("Radius (%1)").arg(UM); }
450  QStringList parmDescs() const { return QStringList() << "Size of neighborhood used for erosion."; }
451  QStringList parmDefaults() const { return QStringList() << "1.0"; }
452  QIcon icon() const { return QIcon(":/images/Erode.png"); }
453  };
454 
461  class MeshClosing : public MeshProcess {
462  public:
463  MeshClosing(const MeshProcess& process) : Process(process), MeshProcess(process) {}
464 
465  bool operator()(const QStringList& parms)
466  {
467  if(!checkState().mesh(MESH_NON_EMPTY))
468  return false;
469  return (*this)(currentMesh(), parms[0].toFloat());
470  }
471 
472  bool operator()(Mesh* mesh, float radius);
473 
474  QString folder() const { return "Signal"; }
475  QString name() const { return "Close Signal"; }
476  QString description() const { return "Apply morphological dilation followed by erosion to mesh signal."; }
477  QStringList parmNames() const { return QStringList() << QString::fromWCharArray(L"Radius (\xb5m)"); }
478  QStringList parmDescs() const { return QStringList() << "Size of neighborhood used for dilation/erosion."; }
479  QStringList parmDefaults() const { return QStringList() << "1.0"; }
480  QIcon icon() const { return QIcon(":/images/Closing.png"); }
481  };
482 
489  class MeshOpening : public MeshProcess {
490  public:
491  MeshOpening(const MeshProcess& process) : Process(process), MeshProcess(process) {}
492 
493  bool operator()(const QStringList& parms)
494  {
495  if(!checkState().mesh(MESH_NON_EMPTY))
496  return false;
497  return (*this)(currentMesh(), parms[0].toFloat());
498  }
499 
500  bool operator()(Mesh* mesh, float radius);
501 
502  QString folder() const { return "Signal"; }
503  QString name() const { return "Open Signal"; }
504  QString description() const { return "Apply morphological erosion followed by dilation to mesh signal."; }
505  QStringList parmNames() const { return QStringList() << QString::fromWCharArray(L"Radius (\xb5m)"); }
506  QStringList parmDescs() const { return QStringList() << "Size of neighborhood used for erosion/dilation."; }
507  QStringList parmDefaults() const { return QStringList() << "1.0"; }
508  QIcon icon() const { return QIcon(":/images/Opening.png"); }
509  };
510 
511  class mgxBase_EXPORT RescaleSignal : public MeshProcess {
512  public:
513  RescaleSignal(const MeshProcess& process) : Process(process) , MeshProcess(process) {}
514 
515  bool operator()(const QStringList& parms)
516  {
517  if(!checkState().mesh(MESH_NON_EMPTY))
518  return false;
519  bool ok;
520  float percentile = parms[1].toFloat(&ok);
521  if(!ok)
522  return setErrorMessage("Error, argument 'Percentile' must be a number");
523  float minimum = parms[2].toFloat(&ok);
524  if(!ok)
525  return setErrorMessage("Error, argument 'Minimum' must be a number");
526  float maximum = parms[3].toFloat(&ok);
527  if(!ok)
528  return setErrorMessage("Error, argument 'Maximum' must be a number");
529  return (*this)(currentMesh(), stringToBool(parms[0]), percentile, minimum, maximum);
530  }
531 
532  bool operator()(Mesh* mesh, bool use_zero, float percentile, float minimum, float maximum);
533 
534  QString folder() const { return "Signal"; }
535  QString name() const { return "Rescale Signal"; }
536  QString description() const { return
537  "Change the colorbar of the signal.\n"
538  "If percentile is set to 0, it uses the minimum and maximum arguments.\n"
539  "Only the visualization is affected, the signal projection remains unchanged";
540  }
541  QStringList parmNames() const { return QStringList()
542  << "Zero as reference" << "Percentile" << "Minimum" << "Maximum";
543  }
544  QStringList parmDescs() const { return QStringList()
545  << "If true, 0 will be used as a reference.\n"
546  "If the signal is all positive (resp. negative), 0 will be added as a minimum (resp. maximum).\n"
547  "If the signal is both positive and negative, 0 will be place at the center of the range"
548  << "Keep only this percentage of the signal to compute the range."
549  << "If the percentile specified is 0, uses this as the minimum value for the range"
550  << "If the percentile specified is 0, uses this as the maximum value for the range";
551  }
552  QStringList parmDefaults() const { return QStringList() << "No" << "99" << "0" << "1"; }
553 
555  {
556  ParmChoiceMap map;
557  map[0] = booleanChoice();
558  return map;
559  }
560 
561  QIcon icon() const { return QIcon(":/images/Normalize.png"); }
562  };
563 
569  class mgxBase_EXPORT SetSignalProcess : public MeshProcess {
570  public:
571  SetSignalProcess(const MeshProcess& process) : Process(process), MeshProcess(process) {}
572 
573  bool operator()(const QStringList& parms)
574  {
575  if(not checkState().mesh(MESH_VISIBLE))
576  return false;
577  bool ok;
578  float value = parms[0].toFloat(&ok);
579  if(not ok)
580  return setErrorMessage("Parameter 'Value' must be a number");
581  float percentile = parms[2].toFloat(&ok);
582  if(not ok)
583  return setErrorMessage("Parameter 'Percentile' must be a number");
584  return (*this)(currentMesh(), value, stringToBool(parms[1]), percentile, stringToBool(parms[3]));
585  }
586 
587  bool operator()(Mesh* m, float value, bool rescale, float percentile, bool use_zero);
588 
589  QString folder() const { return "Signal"; }
590  QString name() const { return "Set Signal"; }
591  QString description() const { return "Set the signal for the whole mesh, or for the currently selected part of it."; }
592 
593  QStringList parmNames() const { return QStringList() << "Value" << "Rescale" << "Percentile" << "Use zero"; }
594  QStringList parmDescs() const { return QStringList()
595  << "New value for the signal"
596  << "If true, the signal bounds will be rescaled"
597  << "If rescaling, which percentile to use?"
598  << "If rescaling, should we use zero as reference?";
599  }
600  QStringList parmDefaults() const { return QStringList() << "1" << "Yes" << "100" << "No"; }
602  {
603  ParmChoiceMap map;
604  map[1] = booleanChoice();
605  map[3] = booleanChoice();
606  return map;
607  }
608  QIcon icon() const { return QIcon(":/images/Sharpen.png"); }
609  };
610 
612 
613  class mgxBase_EXPORT ProjectCurvatureOp {
614  public:
615  ProjectCurvatureOp(const vvgraph& S, const VtxVec& vs, std::string type, float radius, FloatVec& values,
616  std::vector<util::Curvature>& curvs);
617  void operator()(int i);
618 
619  private:
620  const vvgraph& S;
621  const VtxVec& vs;
622  std::string type;
623  float radius;
624  FloatVec& values;
625  std::vector<util::Curvature>& curvs;
626  };
627 
628  class mgxBase_EXPORT MeshGaussianBlurOp {
629  public:
630  MeshGaussianBlurOp(const vvgraph& S, const VtxVec& vs, float radius);
631  void operator()(int i);
632 
633  private:
634  const vvgraph& S;
635  const VtxVec& vs;
636  float radius;
637  };
638 
639  class mgxBase_EXPORT MeshLocalMinimaOp {
640  public:
641  MeshLocalMinimaOp(const vvgraph& S, const VtxVec& vs, float radius, int startLabel);
642  void operator()(int i);
643 
644  private:
645  const vvgraph& S;
646  const VtxVec& vs;
647  float radius;
648  int label;
649  };
650 
651  class mgxBase_EXPORT MeshNormalizeOp {
652  public:
653  MeshNormalizeOp(const vvgraph& S, const VtxVec& vs, float radius);
654 
655  void operator()(int i);
656 
657  private:
658  const vvgraph& S;
659  const VtxVec& vs;
660  float radius;
661  };
662 
664  public:
665  MeshDilationOp(const vvgraph& S, const VtxVec& vs, float radius);
666  void operator()(int vi);
667 
668  private:
669  const vvgraph& S;
670  const VtxVec& vs;
671  float radius;
672  };
673 
675  public:
676  MeshErosionOp(const vvgraph& S, const VtxVec& vs, float radius);
677  void operator()(int vi);
678 
679  private:
680  const vvgraph& S;
681  const VtxVec& vs;
682  float radius;
683  };
684 
685 }}
686 
687 #endif
fromWCharArray(const wchar_t *string, int size=-1)
Calculate a difference of Gaussians on mesh.
Definition: MeshProcessSignal.hpp:318
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:155
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:335
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:422
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessSignal.hpp:554
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:541
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:419
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:292
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:100
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:535
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessSignal.hpp:126
Set the mesh signal to be the curvature of the mesh.
Definition: MeshProcessSignal.hpp:222
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:111
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:88
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:207
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:389
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:358
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:437
Definition: MeshProcessSignal.hpp:639
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:573
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:186
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:447
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessSignal.hpp:601
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:515
MeshNormalize MeshProcessSignal.hpp <MeshProcessSignal.hpp>
Definition: MeshProcessSignal.hpp:375
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:250
arg(const QString &a, int fieldWidth=0, const QChar &fillChar=QLatin1Char( ' ')
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:561
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:418
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:451
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:600
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:180
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:309
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:591
Smooth the mesh signal using local averaging.
Definition: MeshProcessSignal.hpp:140
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:114
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:144
Definition: MeshProcessSignal.hpp:651
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:448
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:420
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:72
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:544
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:476
Definition: MeshProcessSignal.hpp:613
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:157
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:113
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:252
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:608
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:156
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:226
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:125
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:534
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:154
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:209
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessSignal.hpp:273
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:423
Morphological erosion on the mesh, using a spherical kernel.
Definition: MeshProcessSignal.hpp:433
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:40
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:508
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:260
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:336
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:449
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:112
This process is used to change how the mesh is seen.
Definition: MeshProcessSignal.hpp:32
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:153
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:388
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:394
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:507
The Store class holds the actual 3D data and properties specific to it.
Definition: Store.hpp:35
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:475
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:42
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:211
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:177
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:362
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:349
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:379
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:331
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:182
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:474
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessSignal.hpp:76
Definition: MeshProcessSignal.hpp:663
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:213
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:361
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:359
Morphological dilation on the mesh, using a spherical kernel.
Definition: MeshProcessSignal.hpp:404
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:132
Definition: MeshProcessSignal.hpp:628
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:208
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:334
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:503
Set the signal to a given value for all currently active vertices.
Definition: MeshProcessSignal.hpp:569
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:212
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:332
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:421
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:477
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:198
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:408
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:181
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:118
File containing the definition of a Process.
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:183
Definition: MeshProcessSignal.hpp:674
The Stack class represent the dimensions of the 3D data, and the frames transformations.
Definition: Stack.hpp:35
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:480
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:392
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:38
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:493
This is the main process class, the one all process inherit from.
Definition: Process.hpp:258
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:552
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:304
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:337
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:39
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:210
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:504
Morphological opening on the mesh.
Definition: MeshProcessSignal.hpp:489
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
This namespace contains all the classes needed to define processes.
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:593
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:366
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:594
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:367
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:184
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:256
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:390
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:333
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:159
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:478
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:465
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:536
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:310
std::vector< float > FloatVec
Vector of floats.
Definition: Mesh.hpp:108
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:452
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:251
Morphological closing on the mesh.
Definition: MeshProcessSignal.hpp:461
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:185
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:303
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:393
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:391
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:590
Project stack signal onto the current mesh.
Definition: MeshProcessSignal.hpp:96
Definition: MeshProcessSignal.hpp:167
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:322
Clear the mesh signal to a defined value.
Definition: MeshProcessSignal.hpp:194
std::vector< vertex > VtxVec
Vector of vertices.
Definition: Mesh.hpp:89
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:417
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:301
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:479
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSignal.hpp:171
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:305
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:158
Smooth the mesh signal using a gaussian kernel.
Definition: MeshProcessSignal.hpp:288
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:589
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:502
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSignal.hpp:271
Definition: MeshProcessSignal.hpp:511
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:450
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSignal.hpp:505
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:506
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSignal.hpp:446
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSignal.hpp:280
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSignal.hpp:360
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:865
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSignal.hpp:47
Find the local minima in the current mesh.
Definition: MeshProcessSignal.hpp:345
QString name() const
Returns the name of the process.
Definition: MeshProcessSignal.hpp:302