MorphoGraphX
MeshProcessLineage.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_LINEAGE_HPP
12 #define MESH_PROCESS_LINEAGE_HPP
13 
14 #include <Process.hpp>
15 
16 namespace mgx { namespace process {
17 
20 
25  class mgxBase_EXPORT CorrectParents : public MeshProcess {
26  public:
27  CorrectParents(const MeshProcess& process) : Process(process), MeshProcess(process) {}
28 
29  bool operator()(const QStringList& )
30  {
31  if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
32  return false;
33  Mesh* mesh1, *mesh2;
34  if(currentMesh() == mesh(0)) {
35  mesh2 = mesh(0);
36  mesh1 = mesh(1);
37  } else if(currentMesh() == mesh(1)) {
38  mesh2 = mesh(1);
39  mesh1 = mesh(0);
40  } else
41  return false;
42 
43  bool res = (*this)(mesh1, mesh2);
44  return res;
45  }
46 
47  bool operator()(Mesh* mesh1, Mesh* mesh2);
48 
49  QString folder() const { return "Lineage Tracking"; }
50  QString name() const { return "Correct Parents"; }
51  QString description() const { return "Take out non-existing labels from parent map."; }
52  QStringList parmNames() const { return QStringList(); }
53  QStringList parmDescs() const { return QStringList(); }
54  QIcon icon() const { return QIcon(":/images/ParentsCheck.png"); }
55  };
56 
63  public:
64  HeatMapDaughterCells(const MeshProcess& process) : Process(process), MeshProcess(process) {}
65 
66  bool operator()(const QStringList& )
67  {
68  if(!checkState().mesh(MESH_NON_EMPTY | MESH_PARENT)) {
69  setErrorMessage("The current mesh must have show parents selected.");
70  return false;
71  }
72  Mesh* m = currentMesh();
73 
74  bool res = (*this)(m);
75  if(res)
76  m->showHeat();
77  return res;
78  }
79 
80  bool operator()(Mesh* m);
81 
82  QString folder() const { return "Lineage Tracking"; }
83  QString name() const { return "Heat Map Daughter Cells"; }
84  QString description() const { return
85  "Compute the heat map that shows how may daughter cells a parent cell has."; }
86  QStringList parmNames() const { return QStringList(); }
87  QStringList parmDescs() const { return QStringList(); }
88  QStringList parmDefaults() const { return QStringList(); }
89  QIcon icon() const { return QIcon(":/images/HeatMapDaughterCells.png"); }
90  };
91 
98  public:
99  CopyParentsToLabels(const MeshProcess& process) : Process(process), MeshProcess(process) {}
100 
101  bool operator()(const QStringList& )
102  {
103  if(!checkState().mesh(MESH_NON_EMPTY | MESH_PARENT)) {
104  setErrorMessage("The current mesh must have show parents selected.");
105  return false;
106  }
107  Mesh* m = currentMesh();
108 
109  bool res = (*this)(m);
110  if(res)
111  m->showLabel();
112  return res;
113  }
114 
115  bool operator()(Mesh* m);
116 
117  QString folder() const { return "Lineage Tracking"; }
118  QString name() const { return "Copy Parents to Labels"; }
119  QString description() const { return "Copy parents to labels, and clear parent table."; }
120  QStringList parmNames() const { return QStringList(); }
121  QStringList parmDescs() const { return QStringList(); }
122  QStringList parmDefaults() const { return QStringList(); }
123  QIcon icon() const { return QIcon(":/images/ParentsCopyToLabel.png"); }
124  };
126 
127 }}
128 
129 #endif
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessLineage.hpp:87
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessLineage.hpp:121
QString name() const
Returns the name of the process.
Definition: MeshProcessLineage.hpp:118
Take out non-existing labels from parent map.
Definition: MeshProcessLineage.hpp:25
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessLineage.hpp:88
QString name() const
Returns the name of the process.
Definition: MeshProcessLineage.hpp:50
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessLineage.hpp:52
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessLineage.hpp:119
QString name() const
Returns the name of the process.
Definition: MeshProcessLineage.hpp:83
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:177
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessLineage.hpp:84
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessLineage.hpp:66
Compute the heap map that shows how many daughter cells a parent cell has.
Definition: MeshProcessLineage.hpp:62
Copy parents to labels, and clear parent table.
Definition: MeshProcessLineage.hpp:97
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessLineage.hpp:53
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessLineage.hpp:29
void showLabel()
Show the labels of the surface triangles.
Definition: Mesh.hpp:820
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessLineage.hpp:51
QString folder() const
Folder in which to place the process.
Definition: MeshProcessLineage.hpp:117
File containing the definition of a Process.
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessLineage.hpp:101
This is the main process class, the one all process inherit from.
Definition: Process.hpp:258
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessLineage.hpp:123
void showHeat()
Show the color of the surface.
Definition: Mesh.hpp:826
This namespace contains all the classes needed to define processes.
QString folder() const
Folder in which to place the process.
Definition: MeshProcessLineage.hpp:82
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessLineage.hpp:120
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessLineage.hpp:89
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessLineage.hpp:86
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessLineage.hpp:54
QString folder() const
Folder in which to place the process.
Definition: MeshProcessLineage.hpp:49
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessLineage.hpp:122
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:865