11 #ifndef MESH_PROCESS_LINEAGE_HPP
12 #define MESH_PROCESS_LINEAGE_HPP
16 #include <QFileDialog>
18 #include <ui_ParentAttrDlg.h>
34 setName(
"Mesh/Deformation/Restore Correct Parents");
35 setDesc(
"Restores the correct parent labelling of the other mesh from the attribute map");
36 setIcon(QIcon(
":/images/ParentsCheck.png"));
41 if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
44 if(currentMesh() == mesh(0)) {
47 }
else if(currentMesh() == mesh(1)) {
53 bool res = run(mesh1, mesh2);
71 setName(
"Mesh/Lineage Tracking/Heat Map Proliferation");
72 setDesc(
"Compute a heat map that shows the cell proliferation rate, (how may daughter cells a parent cell has).");
73 setIcon(QIcon(
":/images/HeatMapProliferation.png"));
75 addParm(
"Use Parents On Other Mesh",
"Use Parents On Other Mesh",
"No", booleanChoice());
80 Mesh* m = currentMesh();
82 throw QString(
"%1:run No current mesh").arg(name());
83 Mesh* m2 = otherMesh();
85 throw QString(
"%1:run No other mesh").arg(name());
87 bool res = run(m,m2,
stringToBool(parm(
"Use Parents On Other Mesh")));
93 bool run(
Mesh* m,
Mesh* m2,
bool onOtherMesh);
104 setName(
"Mesh/Lineage Tracking/Select New Walls");
105 setDesc(
"Select Newly Divided Walls");
106 setIcon(QIcon(
":/images/NewWalls.png"));
111 Mesh* m = currentMesh();
113 throw QString(
"%1:run No current mesh").arg(name());
127 setName(
"Mesh/Lineage Tracking/Daughter Area asymmetry");
128 setDesc(
"Measures the asymmetry in cell-area in daughter cells. Uses standard-deviation of daughter area over mean daughter area (division by mean provides scale invariance)");
129 setIcon(QIcon(
":/images/HeatMapProliferation.png"));
134 if(!checkState().mesh(MESH_USE_PARENTS)) {
135 setErrorMessage(
"The current mesh must have show parents selected.");
138 Mesh* m = currentMesh();
160 setName(
"Mesh/Lineage Tracking/Copy Parents to Labels");
161 setDesc(
"Copy parents to labels, and clear parent table.");
162 setIcon(QIcon(
":/images/ParentsCopyToLabel.png"));
167 return run(currentMesh());
184 setName(
"Mesh/Lineage Tracking/Copy Labels to Parents");
185 setDesc(
"Copy labels to parents.");
186 setIcon(QIcon(
":/images/ParentsCopyToLabel.png"));
191 Mesh* m = currentMesh();
210 setName(
"Mesh/Lineage Tracking/Correct Labeling Colors");
211 setDesc(
"Relabels cells to avoid neighboring cells with the same color.");
212 setIcon(QIcon(
":/images/ParentsCopyToLabel.png"));
214 addParm(
"Number of colors",
"Number of colors used to color",
"7");
215 addParm(
"Colormap size",
"Size of the labels colormap",
"16");
216 addParm(
"Balance color distribution",
"Try to balance the number cells of each color",
"No",booleanChoice());
217 addParm(
"3D Mesh",
"Set to Yes if the mesh has volumetric cells",
"No",booleanChoice());
222 Mesh* m = currentMesh();
223 return run(m,parm(
"Number of colors"),parm(
"Colormap size"),parm(
"Balance color distribution"),
stringToBool(parm(
"3D Mesh")));
226 bool run(
Mesh* mesh, QString numColorString, QString colormapSizeString, QString balanceDistributionString,
bool mesh3D);
242 setName(
"Stack/Segmentation/Correct Labeling Colors");
243 setDesc(
"Relabels cells to avoid neighboring cells with the same color.");
244 setIcon(QIcon(
":/images/ParentsCopyToLabel.png"));
246 addParm(
"Number of colors",
"Number of colors used to color",
"7");
247 addParm(
"Colormap size",
"Size of the labels colormap",
"16");
248 addParm(
"Balance color distribution",
"Try to balance the number cells of each color",
"No",booleanChoice());
253 Stack* stack = currentStack();
255 return run(store,parm(
"Number of colors"),parm(
"Colormap size"),parm(
"Balance color distribution"));
258 bool run(
Store* store, QString numColorString, QString colormapSizeString, QString balanceDistributionString);
272 setName(
"Mesh/Lineage Tracking/Set Parent");
273 setDesc(
"Set the parent for selected cells");
274 setIcon(QIcon(
":/images/Parents.png"));
276 addParm(
"Label",
"Parent Number label",
"0");
281 if(!checkState().mesh(MESH_ANY))
283 Mesh *m = currentMesh();
284 return run(m, parm(
"Label").toInt());
287 bool run(
Mesh *mesh,
int parent);
301 setName(
"Mesh/Lineage Tracking/Merge Parent Files");
302 setDesc(
"Set the parent for selected cells");
303 setIcon(QIcon(
":/images/Parents.png"));
305 addParm(
"File Open T1T0",
"File Open T1T0",
"");
306 addParm(
"File Open T2T1",
"File Open T2T1",
"");
307 addParm(
"File Save T2T0",
"File Save T2T0",
"");
310 bool initialize(QWidget* parent);
314 return run(parm(
"File Open T1T0"), parm(
"File Open T2T1"), parm(
"File Save T2T0"));
317 bool run(QString file1, QString file2, QString fileNameSave);
326 setName(
"Mesh/Lineage Tracking/Parent Export to Attr Map");
327 setDesc(
"Creates an Attribute map of the chosen name (preceding Measure Label Int) using the current parent labels.");
328 setIcon(QIcon(
":/images/MakeHeatMap.png"));
330 addParm(
"Prefix",
"Prefix",
"Measure Label Int");
331 addParm(
"Attr Name",
"Attr Name",
"Parents");
337 if(!checkState().mesh(MESH_ANY))
339 Mesh *m = currentMesh();
340 return run(m, parm(
"Prefix"), parm(
"Attr Name"));
343 bool run(
Mesh* m, QString prefix, QString name);
352 setName(
"Mesh/Lineage Tracking/Unique Parents from Attrs");
353 setDesc(
"Unique Parents from Attrs");
354 setIcon(QIcon(
":/images/MakeHeatMap.png"));
356 addParm(
"Prefix",
"Prefix",
"Measure Label Int");
357 addParm(
"Parent Attr 1",
"Parent Attr 1",
"P1");
358 addParm(
"Parent Attr 2",
"Parent Attr 2",
"P2");
359 addParm(
"Multiplier 10",
"Multiplier 10",
"No", booleanChoice());
364 if(!checkState().mesh(MESH_ANY))
366 Mesh *m = currentMesh();
367 return run(m, parm(
"Prefix"), parm(
"Parent Attr 1"), parm(
"Parent Attr 2"),
stringToBool(parm(
"Multiplier 10")));
370 bool run(
Mesh* m, QString prefix, QString name1, QString name2,
bool mult10);
380 setName(
"Mesh/Lineage Tracking/Parent Import from Attr Map");
381 setDesc(
"Imports parent labels from an Attribute map of the chosen name (preceding Measure Label Int). Overwrites the current parents!");
382 setIcon(QIcon(
":/images/MakeHeatMap.png"));
384 addParm(
"Prefix",
"Prefix",
"Measure Label Int");
385 addParm(
"Attr Name",
"Attr Name",
"Parents");
386 addParm(
"Import To Mesh",
"Import To Mesh",
"Active Mesh", QStringList() <<
"Active Mesh" <<
"Other Mesh (T1)"<<
"Other Mesh (T2)");
392 if(!checkState().mesh(MESH_ANY))
394 Mesh *m = currentMesh();
395 Mesh *m2 = otherMesh();
396 return run(m, m2, parm(
"Prefix"), parm(
"Attr Name"), parm(
"Import To Mesh"));
399 bool run(
Mesh* m,
Mesh* m2, QString prefix, QString name, QString importMesh);
410 setName(
"Mesh/Lineage Tracking/Parent Import from Attr Map GUI");
411 setDesc(
"Imports parent labels from an Attribute map of the chosen name (preceding Measure Label Int). Overwrites the current parents!");
412 setIcon(QIcon(
":/images/MakeHeatMap.png"));
414 addParm(
"Prefix",
"Prefix",
"Measure Label Int");
415 addParm(
"Attr Name",
"Attr Name",
"Parents");
416 addParm(
"Import To Mesh",
"Import To Mesh",
"Active Mesh", QStringList() <<
"Active Mesh" <<
"Other Mesh (T1)"<<
"Other Mesh (T2)");
418 bool initialize(QWidget *parent);
423 if(!checkState().mesh(MESH_ANY))
427 return run(m, m2, parm(
"Prefix"), parm(
"Attr Name"), parm(
"Import To Mesh"));
430 bool run(
Mesh* m,
Mesh* m2, QString prefix, QString name, QString importMesh);
434 void on_attrTree_clicked(QTreeWidgetItem *,
int);
435 void on_attrTree2_clicked(QTreeWidgetItem *,
int);
436 void on_deleteButton_clicked();
437 void on_deleteButton2_clicked();
438 void on_copy12_clicked();
439 void on_saveParentIDs_clicked();
452 setName(
"Mesh/Lineage Tracking/Select Parents");
453 setDesc(
"Select Parents with a given label");
454 setIcon(QIcon(
":/images/CellAtlas.png"));
456 addParm(
"Label",
"Label",
"0");
457 addParm(
"Keep Selection",
"Keep Selection",
"No",booleanChoice());
461 Mesh *m = currentMesh();
462 return run(m, parm(
"Label").toInt(),
stringToBool(parm(
"Keep Selection")));
464 bool run(
Mesh *m,
int labelToSelect,
bool keepSelection);
473 setName(
"Mesh/Lineage Tracking/Select Parents in Parent Mesh");
474 setDesc(
"Select cells in the earlier mesh that have a parents label in the later mesh.");
475 setIcon(QIcon(
":/images/CellAtlas.png"));
480 Mesh *m = currentMesh();
481 Mesh *m2 = otherMesh();
498 setName(
"Mesh/Cell Types/Set Cell Type");
499 setDesc(
"Set the cell type for selected cells. Overwrite the parent label with the cell type number.");
500 setIcon(QIcon(
":/images/Parents.png"));
517 setName(
"Mesh/Cell Types/Reset Cell Types");
518 setDesc(
"Clear mapping from parents to labels");
519 setIcon(QIcon(
":/images/ParentsClear.png"));
535 setName(
"Mesh/Cell Types/Load Cell Types");
536 setDesc(
"Clear mapping from parents to labels");
552 setName(
"Mesh/Cell Types/Save Cell Types");
553 setDesc(
"Clear mapping from parents to labels");
564 setName(
"Mesh/Cell Types/Select Cell Type");
565 setDesc(
"Select Cell Types with a given label");
574 bool run(
const QStringList& parms)
576 if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
579 if(currentMesh() == mesh(0)) {
583 else if(currentMesh() == mesh(1)) {
590 if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
594 return run(mesh1, mesh2);
599 QString
name()
const {
return "Mesh/Lineage Tracking/New Walls"; }
600 QString
description()
const {
return "Select vertices belonging to new walls on second time point.\n"
601 "First time point should be the active stack, parents should be loaded in second time point."; }
605 QIcon
icon()
const {
return QIcon(
":/images/NewWalls.png"); }