14 #ifndef CELL_ATLAS_HPP
15 #define CELL_ATLAS_HPP
24 #include "ui_CellAtlasGUI.h"
33 std::map<int, Point3d>& bMap, std::map<int, Point3d>& diffbMap, std::map<int, Point3d>& refbMap);
42 setName(
"Mesh/Cell Atlas 3D/Root/A Analyze Cells 3D");
43 setDesc(
"Analyze the 3D properties of the cells according to the Bezier-coordinate system. \n"
44 "This process is needed for most of the other processes as it provides the raw data. \n"
46 "- Bezier line through the root body \n"
47 "- A selected first cell for defining the orientation \n"
48 "Mode: Specifies which coordiante system will be used: \n"
49 "Root : Bezier Line \n"
50 "Layer: Bezier Grid \n"
51 "Cartesian: Cartesian XYZ");
52 setIcon(QIcon(
":/images/CellGraph3D.png"));
54 addParm(
"Volume Threshold",
"",
"0");
55 addParm(
"Mode",
"",
"Root", QStringList() <<
"Root" <<
"Layer" <<
"Cartesian");
60 const Stack *s1 = stack(0);
61 const Stack *s2 = stack(1);
64 return run(s1, s2, m1, m2, parm(
"Volume Threshold").toDouble(), parm(
"Mode"),
false );
67 bool run(
const Stack *s1,
const Stack *s2,
Mesh *m1,
Mesh *m2,
double minVolume, QString mode,
bool openmpMode);
80 setName(
"Mesh/Cell Atlas 3D/Root/Tools/Select Bad Cells");
81 setDesc(
"Select cells that were labelled as bad by the Analyze Cells 3D process. \n"
83 "- Cells that have a small volume (threshold in Analyze Cells 3D) \n"
84 "- Cells that have an invalid centroid and/or cell size");
85 setIcon(QIcon(
":/images/CellAtlas.png"));
108 setName(
"Mesh/Cell Atlas 3D/Tools/Find Cells");
110 setIcon(QIcon(
":/images/CellAtlas.png"));
112 addParm(
"Volume Lower",
"",
"0");
113 addParm(
"Any Size Lower",
"",
"0");
114 addParm(
"Volume Cell Wall Ratio Lower",
"",
"0");
115 addParm(
"Outside Cell Wall Percent Higher",
"",
"100");
116 addParm(
"Connector",
"",
"AND", QStringList() <<
"AND" <<
"OR");
122 return run(m1, parm(
"Volume Lower").toDouble(), parm(
"Any Size Lower").toDouble(), parm(
"Volume Cell Wall Ratio Lower").toDouble(), parm(
"Outside Cell Wall Percent Higher").toDouble(), parm(
"Connector"));
125 bool run(
Mesh *m1,
double vol,
double sizes,
double volratio,
double outsideArea, QString logicalCon);
135 setName(
"Mesh/Cell Atlas 3D/Root/Tools/Save Cell Data");
136 setDesc(
"Save current data to csv-files");
137 setIcon(QIcon(
":/images/CellAtlasSave.png"));
139 addParm(
"Filename",
"",
"");
140 addParm(
"Filetype",
"",
"Root", QStringList() <<
"Root" <<
"Meristem");
141 addParm(
"Extended File",
"",
"No",booleanChoice());
144 bool initialize(QWidget* parent);
147 return run(parm(
"Filename"), parm(
"Filetype"),
stringToBool(parm(
"Extended File")));
149 bool run(QString filename, QString type,
bool extended);
159 setName(
"Mesh/Export/Save Cell Neighborhood 3D");
160 setDesc(
"Save a file with all cell walls, their adjacent cell labels and cell wall sizes.");
161 setIcon(QIcon(
":/images/CellAtlasSave.png"));
163 addParm(
"Filename",
"Filename",
"");
164 addParm(
"Parents",
"Parents",
"No",booleanChoice());
167 bool initialize(QWidget* parent);
171 Mesh* m = currentMesh();
173 double vertexTolerance = 0.001;
178 return run(m, parm(
"Filename"), info1,
stringToBool(parm(
"Parents")));
191 setName(
"Mesh/Export/Save Cell Neighborhood 2D");
192 setDesc(
"Save a file with all cell walls, their adjacent cell labels and cell wall sizes.");
193 setIcon(QIcon(
":/images/CellAtlasSave.png"));
195 addParm(
"Filename",
"Filename",
"");
196 addParm(
"Parents",
"Parents",
"No",booleanChoice());
197 addParm(
"Save",
"Save",
"Active Mesh",QStringList() <<
"Active Mesh" <<
"Other Mesh" <<
"Change Map");
201 bool initialize(QWidget* parent);
205 Mesh* m = currentMesh();
207 Mesh* m2 = otherMesh();
209 return run(m, m2, parm(
"Filename"),
stringToBool(parm(
"Parents")));
212 bool run(
Mesh* m,
Mesh* m2, QString filename,
bool parents);
221 setName(
"Mesh/Cell Atlas 3D/Root/Tools/Heatmap Cell Data");
222 setDesc(
"Display Cell Data \n"
223 "Displays cell properties as a heatmap. \n"
224 "Requires analyzed or loaded data in the memory.");
225 setIcon(QIcon(
":/images/CellAtlas.png"));
227 addParm(
"Data",
"",
"Longitudinal (Arclengths)", QStringList() <<
"Longitudinal (Arclengths)" <<
"Longitudinal (Absolute)" <<
"Circumferential Angle" <<
"Radial" <<
"Radial (Absolute)" <<
"Longitudinal Cell Length" <<
"Circumferential Cell Length" <<
"Radial Cell Length" <<
"Nr of Neighbors" <<
"Volume" <<
"Cell Wall Area" <<
"Outside Wall Area" <<
"Outside Wall Area percent" <<
"Associated Cortical Cell" <<
"Long Min" <<
"Long Max");
228 addParm(
"Stack",
"",
"1");
236 if(parm(
"Data").toInt() == 2)
239 return run(m1, parm(
"Data"));
242 bool run(
Mesh* m1, QString choice);
251 setName(
"Mesh/Cell Atlas 3D/Root/Tools/Load Cell Data");
252 setDesc(
"Load Cell Data \n"
253 "Loads data from an analyzed root from csv files");
254 setIcon(QIcon(
":/images/CellAtlasLoad.png"));
256 addParm(
"Filename",
"",
"");
257 addParm(
"File Type",
"",
"All", QStringList() <<
"All" <<
"Data" <<
"Config" <<
"Neighborhood");
260 bool initialize(QWidget *parent);
263 return run(parm(
"Filename"), parm(
"File Type"));
266 bool run(QString filename, QString type);
275 setName(
"Mesh/Cell Atlas 3D/Root/E Topological Check");
276 setDesc(
"Topological Check \n"
278 "Selects potentially mislabelled cells \n"
280 "This process checks the neighborhood relation of the parent labels of the cells. \n"
281 "Every parent label cell layer only allows connections to two other parent labels (the layer above and below). \n"
283 "Exceptions are the columella parent label (=10) and the airbubble parent label which can be specified as a parameter. \n"
284 "Those two cell types are ignored in the neighborhood graph. \n"
286 "Further exceptions are the rootcap and the vasculature tissue. \n"
287 "hose two cell types allow connections only to one further cell type and also have to be specified as parameters. \n"
289 "he process works either on the whole root or on a selection. \n"
290 "Potentially mislabelled cells will be selected according to the Error Count parameter");
291 setIcon(QIcon(
":/images/SubdivideTriAdapt.png"));
293 addParm(
"Work on Selection",
"",
"No",booleanChoice());
294 addParm(
"Threshold Volume",
"",
"10");
295 addParm(
"Threshold Wall Area",
"",
"1");
296 addParm(
"Root Cap Label",
"",
"7");
297 addParm(
"Air Bubble Label",
"",
"6");
298 addParm(
"Vasculature Label",
"",
"5");
299 addParm(
"Error Limit",
"",
"2");
303 return run(parm(
"Work on Selection"), parm(
"Threshold Volume").toDouble(), parm(
"Threshold Wall Area").toDouble(), parm(
"Root Cap Label").toInt(), parm(
"Air Bubble Label").toInt(), parm(
"Vasculature Label").toInt(), parm(
"Error Limit").toInt());
305 bool run(QString selection,
double threshVol,
double threshWallArea,
int rootCapLabel,
int airBubbleLabel,
int vascLabel,
int errors);
317 Ui_CellAtlasDialog
ui;
321 setName(
"Mesh/Cell Atlas 3D/Root/B Assign Cell Types");
322 setDesc(
"Assign Cell Types \n"
324 "View the cell property heat map and assign parent labels to the different cell types. \n"
326 "Requires a selected first cell and a last root cap cell (if required). Also requires root cell data in the memory (either loaded or from the plugin Analyze Cells 3D \n"
329 "- Mouseclick: creates a new cluster if no existing one is nearby \n"
330 "- Drag and Drop on cluster: moves the cluster \n"
331 "- Double Click on cluster: deletes the cluster");
332 setIcon(QIcon(
":/images/Cluster.png"));
334 addParm(
"Has multiple segments",
"",
"Yes",booleanChoice());
339 bool initialize(QWidget *parent);
342 return run(parm(
"Has multiple segments"));
344 bool run(QString rootCap);
349 void setDeletePosition(
const QPoint& p);
350 void setPosition(
const QPoint& p);
351 void setReleasePosition(
const QPoint& p);
352 void setAutoCluster();
353 void changeHeatmapX(QString stringX);
354 void changeHeatmapY(QString
string);
355 void setClusterLabel(QString label);
356 void setMousePosition(
const QPoint& p);
357 void changeSigma(
double sigma);
358 void changeRootPart();
359 void setPreCluster();
373 setName(
"Mesh/Cell Atlas 3D/Tools/Collapse Bezier Points");
374 setDesc(
"Collapse the 2D Bezier gridpoints into a line (needed for Analyze Cells 3D)");
384 setName(
"Mesh/Cell Atlas 3D/Root/C Assign Columella");
385 setDesc(
"Assign Columella \n"
387 "Assign the Columella Cells according to the given labels");
388 setIcon(QIcon(
":/images/CellAtlasCol.png"));
390 addParm(
"Root Cap Label",
"Root Cap Label",
"7");
391 addParm(
"Columella Label",
"Columella Label",
"10");
392 addParm(
"Ratio Threshold",
"Ratio Threshold",
"0.4");
393 addParm(
"Radial Threshold",
"Radial Threshold",
"0.48");
397 return run(parm(
"Root Cap Label").toInt(), parm(
"Columella Label").toInt(), parm(
"Ratio Threshold").toDouble(), parm(
"Radial Threshold").toDouble());
400 bool run(
int labelRootCap,
int labelCol,
double rat_val,
double sca_val);
409 setName(
"Mesh/Cell Atlas 3D/Root/D Assign Cortical Cells");
410 setDesc(
"Assign Cortical Cells \n"
412 "Assign the associated cortical cells to all cells \n"
414 "Requires Analyze Cells 3D, loading files is not enough!");
415 setIcon(QIcon(
":/images/CellAtlasCort.png"));
417 addParm(
"Cortical Cell Label",
"",
"2");
421 return run(parm(
"Cortical Cell Label").toInt());
424 bool run(
int labelCort);
433 setName(
"Mesh/Cell Atlas 3D/Root/Statistics/Reporter abundance analysis 3D");
434 setDesc(
"3D reporter abundance analysis \n"
436 "Data Analysis tool. \n"
438 "Requires all input data in one folder. Note that input files come in pairs: \n"
439 "One file for the cell data and another for the reporter data. Files have to named in the following way for the plugin to find the file pairs: \n"
440 "cell data: filename.csv \n"
441 "reporter data: filename''reporter file string''.csv, where ''reporter file string'' can be specified. \n"
442 "Output files will be saved in the input folder");
443 setIcon(QIcon(
":/images/CellAtlasCort.png"));
445 addParm(
"Input folder",
"",
"");
446 addParm(
"Reporter file string",
"",
"_reporter");
447 addParm(
"Merge With File",
"",
"Yes",booleanChoice());
448 addParm(
"Output File",
"",
"");
449 addParm(
"Sliding Avg",
"",
"No",booleanChoice());
450 addParm(
"Sliding Avg Window",
"",
"3");
451 addParm(
"Upper Filter Type",
"",
"No Filter", QStringList() <<
"No Filter" <<
"Percentage" <<
"Value");
452 addParm(
"Upper Filter Limit",
"",
"100");
453 addParm(
"Lower Filter Type",
"",
"No Filter", QStringList() <<
"No Filter" <<
"Percentage" <<
"Value");
454 addParm(
"Lower Filter Limit",
"",
"0");
457 bool initialize(QWidget* parent);
460 return run(parm(
"Input folder"), parm(
"Reporter file string"), parm(
"Merge With File"), parm(
"Output File"), parm(
"Sliding Avg"), parm(
"Sliding Avg Window").toDouble(),
stringToBool(parm(
"Upper Filter Type")));
463 bool run(QString folderControl, QString folderTreatment, QString folderOutput, QString outputFileType, QString avg,
double window,
bool perCell);
472 setName(
"Mesh/Cell Atlas 3D/Root/Statistics/Reporter abundance analysis 3D");
473 setDesc(
"3D reporter abundance analysis \n"
475 "Data Analysis tool. \n"
477 "Requires all input data in one folder. Note that input files come in pairs: \n"
478 "One file for the cell data and another for the reporter data. Files have to named in the following way for the plugin to find the file pairs: \n"
479 "cell data: filename.csv \n"
480 "reporter data: filename''reporter file string''.csv, where ''reporter file string'' can be specified. \n"
481 "Output files will be saved in the input folder");
482 setIcon(QIcon(
":/images/CellAtlas.png"));
484 addParm(
"Input folder",
"",
"");
485 addParm(
"Reporter file string",
"",
"_reporter");
486 addParm(
"Merge With File",
"",
"Yes",booleanChoice());
487 addParm(
"Output File",
"",
"");
488 addParm(
"Sliding Avg",
"",
"No",booleanChoice());
489 addParm(
"Sliding Avg Window",
"",
"3");
490 addParm(
"Upper Filter Type",
"",
"No Filter", QStringList() <<
"No Filter" <<
"Percentage" <<
"Value");
491 addParm(
"Upper Filter Limit",
"",
"100");
492 addParm(
"Lower Filter Type",
"",
"No Filter", QStringList() <<
"No Filter" <<
"Percentage" <<
"Value");
493 addParm(
"Lower Filter Limit",
"",
"0");
496 bool initialize(QWidget* parent);
500 return run(m1, parm(
"Input folder"), parm(
"Reporter file string"), parm(
"Merge With File"), parm(
"Output File"), parm(
"Sliding Avg"), parm(
"Sliding Avg Window").toDouble(), parm(
"Upper Filter Type"), parm(
"Upper Filter Limit").toDouble(), parm(
"Lower Filter Type"), parm(
"Lower Filter Limit").toDouble());
503 bool run(
Mesh *m1, QString folderInput, QString gusFileExt, QString mergeWithFile, QString fileToMerge, QString avg,
double window, QString upperFilter,
double upperFilterValue, QString lowerFilter,
double lowerFilterValue);
512 setName(
"Mesh/Cell Atlas 3D/Root/F Examine Vasculature");
513 setDesc(
"Examine all cells that are selected as wrong (use Topological check) and marked as vasculature \n"
514 "in order to split them into air bubble and endoderm \n"
516 "Requires selected cells from Topological Check in order to work. Hereby note the Topological Check parameters: \n"
517 "If a cell/air bubble is not selected it can't be fixed with this plugin! (It might be necessary to lower the thresholds there) \n"
519 "The matlab function didn't work very well (creating the function with Gaussians, looking for min to find a separation point \n"
520 "between air bubbles and endoderm), so another function was implemented which bases the separation point on the cell lengths \n"
521 "of correct endoderm cells (the Average Separation parameter 1 choses this, 0 will use the matlab function)");
522 setIcon(QIcon(
":/images/CellAtlasVasc.png"));
524 addParm(
"Vasculature Label",
"The parent label of the vasculature",
"5");
525 addParm(
"Air Bubble Label",
"The parent label of air bubbles",
"6");
526 addParm(
"Endo Label",
"The parent label of the endoderm",
"4");
527 addParm(
"Average Separation",
"Average Separation",
"1");
528 addParm(
"Sigma",
"Sigma",
"4.5");
533 return run(m1, parm(
"Vasculature Label").toInt(), parm(
"Air Bubble Label").toInt(), parm(
"Endo Label").toInt(), parm(
"Average Separation").toInt(), parm(
"Sigma").toDouble());
536 bool run(
Mesh *m1,
int labelVasc,
int labelAirBubble,
int labelEndo,
int methodAvg,
double sigma);
545 setName(
"Mesh/Cell Atlas 3D/Tools/Display Shortest Path");
546 setDesc(
"Calculates the shortest path between two selected cells.");
547 setIcon(QIcon(
":/images/CellAtlas.png"));
549 addParm(
"Min Wall Area",
"",
"0.001");
550 addParm(
"Distance Measure",
"",
"Euclidian", QStringList() <<
"Euclidian" <<
"Cells");
553 Mesh *m1 = currentMesh();
554 return run(m1, parm(
"Min Wall Area").toDouble(), parm(
"Distance Measure"));
557 bool run(
Mesh *m1,
double wallThreshold, QString weight);
566 setName(
"Mesh/Cell Atlas 3D/Tools/Write Growth Map Data File");
567 setDesc(
"Write Growth Map Data File");
568 setIcon(QIcon(
":/images/CellAtlas.png"));
570 addParm(
"Filename",
"Filename",
"");
576 bool initialize(QWidget* parent);
580 Mesh *m = currentMesh();
581 return run(m, parm(
"Filename"));
584 bool run(
Mesh* m, QString filename);
593 setName(
"Stack/Segmentation/Compare Labelled Stacks");
594 setDesc(
"Find the cell centers of Stack 1 and the label at their position in Stack 2");
595 setIcon(QIcon(
":/images/CellAtlas.png"));
597 addParm(
"Filename",
"Filename",
"");
598 addParm(
"Overwrite Labels Stack 2",
"Overwrite Labels Stack 2",
"No",booleanChoice());
602 bool initialize(QWidget* parent);
606 Stack* s1 = stack(0);
607 Stack* s2 = stack(1);
608 return run(s1, s2, parm(
"Filename"),
stringToBool(parm(
"Overwrite Labels Stack 2")));
611 bool run(
Stack* s1,
Stack* s2, QString filename,
bool overwrite);
621 setName(
"Mesh/Heat Map/Analysis/Cell Analysis 3D");
622 setDesc(
"Calculates basic geometric properties of 3D cells. Visualize them using the Measure processes.");
623 setIcon(QIcon(
":/images/MakeHeatMap.png"));
625 addParm(
"Use Surface Mesh",
"Use Surface Mesh",
"No", booleanChoice());
630 Mesh* m = currentMesh();
631 Mesh* m2 = otherMesh();
632 return run(m, m2,
stringToBool(parm(
"Use Surface Mesh")));
635 bool run(
Mesh* m,
Mesh* m2,
bool useSurface);
649 setName(
"Mesh/Heat Map/Analysis/Growth Analysis 3D");
651 setIcon(QIcon(
":/images/MakeHeatMap.png"));
653 addParm(
"Name Prefix (optional)",
"Name Prefix (optional)",
"");
654 addParm(
"Name Time Point 1",
"Name Time Point 1",
"T1");
655 addParm(
"Name Time Point 2",
"Name Time Point 2",
"T2");
660 Mesh* m = currentMesh();
661 Mesh* m2 = otherMesh();
662 return run(m, m2, parm(
"Name Prefix (optional)"), parm(
"Name Time Point 1"), parm(
"Name Time Point 2"));
665 bool run(
Mesh* m,
Mesh* m2, QString name, QString t1, QString t2);
705 setName(
"Misc/Bezier/Bezier From Cell File");
706 setDesc(
"Create a Bezier line from a cell file of selected 3D cells (cells are not allowed to have more than 2 neighbors)");
707 setIcon(QIcon(
":/images/open.png"));
709 addParm(
"Max Points",
"Max Points",
"20");
714 Mesh* m = currentMesh();
715 return run(m, parm(
"Max Points").toInt());
718 bool run(
Mesh* m,
int maxP);
731 setName(
"Mesh/Cell Atlas 3D/Surface/Analyze Cells Bezier Line");
732 setDesc(
"Analyze a surface mesh with a Bezier line coordinate system");
733 setIcon(QIcon(
":/images/open.png"));
735 addParm(
"Flip Bezier",
"Flip Bezier",
"No",booleanChoice());
740 const Stack *s1 = currentStack();
741 Mesh* m1 = currentMesh();
745 bool run(
const Stack* s1,
Mesh* m1,
bool flipBezier);