iRoCS Toolbox  1.1.0
RootSegmentationParametersDialog.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 #ifndef ROOTSEGMENTATIONPARAMETERSDIALOG_HH
24 #define ROOTSEGMENTATIONPARAMETERSDIALOG_HH
25 
26 #ifdef HAVE_CONFIG_H
27 #include <config.hh>
28 #endif
29 
30 #include <QtGui/QDialog>
31 
33 
34 class QGroupBox;
35 
41 class IntControlElement;
42 
44 
45 class RootSegmentationParametersDialog : public QDialog
46 {
47 
48  Q_OBJECT
49 
50 public:
51 
53  LabellingMainWidget* mainWidget,
54  QWidget* parent = NULL, Qt::WindowFlags f = NULL);
56 
57  ChannelSpecs* dataChannel() const;
58  std::string segmentationChannelName() const;
59  double processingElementSizeUm() const;
60 
61  std::string debugFileName() const;
62 
63  // Pre-processing
64  int normalizationType() const;
65  double gamma() const;
66  bool applyMedian() const;
67  int medianWidthPx() const;
68 
69  // Variance normalization
70  bool applyVarianceNormalization() const;
71  double varSigmaUm() const;
72  double epsilon() const;
73 
74  // Anisotropic diffusion
75  bool applyDiffusion() const;
76  double kappa() const;
77  double tau() const;
78  double zCompensationFactor() const;
79  int nDiffusionIterations() const;
80 
81  // Watershed
82  double hessianSigmaUm() const;
83  double edgeThreshold() const;
84  int boundaryThicknessPx() const;
85  double minimumCellVolumeUm3() const;
86 
87  std::string check();
88 
89 public slots:
90 
91  void setDataChannel(ChannelSpecs *channel);
92  void setDataChannel(int channelIndex);
93  void setSegmentationChannelName(std::string const &name);
94  void setProcessingElementSizeUm(double elementSizeUm);
95 
96  void setDebugFileName(std::string const &debugFile);
97 
98  // Preprocessing
99  void setNormalizationType(int normalizationType);
100  void setGamma(double gamma);
101  void setApplyMedian(bool applyMedian);
102  void setMedianWidthPx(int widthPx);
103 
104  // Variance normalization
106  void setVarSigmaUm(double sigmaUm);
107  void setEpsilon(double epsilon);
108 
109  // Anisotropic diffusion
110  void setApplyDiffusion(bool applyDiffusion);
111  void setKappa(double kappa);
112  void setTau(double tau);
113  void setZCompensationFactor(double zCompensation);
114  void setNDiffusionIterations(int nDiffusionIterations);
115 
116  // Watershed ---
117  void setHessianSigmaUm(double sigmaUm);
118  void setEdgeThreshold(double threshold);
119  void setBoundaryThicknessPx(int boundaryThicknessPx);
120  void setMinimumCellVolumeUm3(double volumeUm3);
121 
122  void checkAndAccept();
123 
124 private:
125 
126  LabellingMainWidget *p_mainWidget;
127 
128  ChannelSelectionControlElement *p_dataChannelSelector;
129  StringControlElement *p_segmentationChannelNameControl;
130  DoubleControlElement *p_processingElementSizeUmControl;
131 
132  FileNameSelectionControlElement *p_debugFileNameControl;
133 
134  StringSelectionControlElement *p_normalizationTypeControl;
135  DoubleControlElement *p_gammaControl;
136  IntControlElement *p_medianWidthPxControl;
137 
138  QGroupBox *p_varianceNormalizationGroup;
139  DoubleControlElement *p_varSigmaUmControl;
140  DoubleControlElement *p_epsilonControl;
141 
142  QGroupBox *p_diffusionGroup;
143  DoubleControlElement *p_kappaControl;
144  DoubleControlElement *p_tauControl;
145  DoubleControlElement *p_zCompensationFactorControl;
146  IntControlElement *p_nDiffusionIterationsControl;
147 
148  DoubleControlElement *p_hessianSigmaUmControl;
149  DoubleControlElement *p_edgeThresholdControl;
150  IntControlElement *p_boundaryThicknessPxControl;
151  DoubleControlElement *p_minimumCellVolumeUm3Control;
152 
153 };
154 
155 #endif
void setApplyDiffusion(bool applyDiffusion)
double processingElementSizeUm() const
void setNDiffusionIterations(int nDiffusionIterations)
void setVarSigmaUm(double sigmaUm)
ChannelSpecs * dataChannel() const
void setApplyMedian(bool applyMedian)
void setNormalizationType(int normalizationType)
void setApplyVarianceNormalization(bool varianceNormalization)
void setDebugFileName(std::string const &debugFile)
void setMinimumCellVolumeUm3(double volumeUm3)
void setMedianWidthPx(int widthPx)
RootSegmentationParametersDialog(LabellingMainWidget *mainWidget, QWidget *parent=NULL, Qt::WindowFlags f=NULL)
void setEpsilon(double epsilon)
void setProcessingElementSizeUm(double elementSizeUm)
void setZCompensationFactor(double zCompensation)
void setHessianSigmaUm(double sigmaUm)
void setDataChannel(ChannelSpecs *channel)
std::string debugFileName() const
void setEdgeThreshold(double threshold)
void varianceNormalization(blitz::Array< double, 3 > &data, blitz::TinyVector< double, 3 > const &elementSizeUm, double sigmaUm, double epsilon=1e-10, iRoCS::ProgressReporter *pr=NULL)
void setSegmentationChannelName(std::string const &name)
void setBoundaryThicknessPx(int boundaryThicknessPx)
std::string segmentationChannelName() const