| 141 | } |
| 142 | |
| 143 | QmitkSlicesInterpolator::QmitkSlicesInterpolator(QWidget *parent, const char * /*name*/) |
| 144 | : QWidget(parent), |
| 145 | m_Interpolator(mitk::SegmentationInterpolationController::New()), |
| 146 | m_SurfaceInterpolator(mitk::SurfaceInterpolationController::GetInstance()), |
| 147 | m_ToolManager(nullptr), |
| 148 | m_Initialized(false), |
| 149 | m_LastSNC(nullptr), |
| 150 | m_LastSliceIndex(0), |
| 151 | m_2DInterpolationEnabled(false), |
| 152 | m_3DInterpolationEnabled(false), |
| 153 | m_CurrentActiveLabelValue(0), |
| 154 | m_FirstRun(true) |
| 155 | { |
| 156 | m_GroupBoxEnableExclusiveInterpolationMode = new QGroupBox("Interpolation", this); |
| 157 | |
| 158 | QVBoxLayout *vboxLayout = new QVBoxLayout(m_GroupBoxEnableExclusiveInterpolationMode); |
| 159 | |
| 160 | m_CmbInterpolation = new QComboBox(m_GroupBoxEnableExclusiveInterpolationMode); |
| 161 | m_CmbInterpolation->addItem("Disabled"); |
| 162 | m_CmbInterpolation->addItem("2-Dimensional"); |
| 163 | m_CmbInterpolation->addItem("3-Dimensional"); |
| 164 | vboxLayout->addWidget(m_CmbInterpolation); |
| 165 | |
| 166 | m_BtnApply2D = new QPushButton("Confirm for single slice", m_GroupBoxEnableExclusiveInterpolationMode); |
| 167 | vboxLayout->addWidget(m_BtnApply2D); |
| 168 | |
| 169 | m_BtnApplyForAllSlices2D = new QPushButton("Confirm for all slices", m_GroupBoxEnableExclusiveInterpolationMode); |
| 170 | vboxLayout->addWidget(m_BtnApplyForAllSlices2D); |
| 171 | |
| 172 | m_BtnApply3D = new QPushButton("Confirm", m_GroupBoxEnableExclusiveInterpolationMode); |
| 173 | vboxLayout->addWidget(m_BtnApply3D); |
| 174 | |
| 175 | m_BtnReinit3DInterpolation = new QPushButton("Reinit Interpolation", m_GroupBoxEnableExclusiveInterpolationMode); |
| 176 | vboxLayout->addWidget(m_BtnReinit3DInterpolation); |
| 177 | |
| 178 | m_ChkShowPositionNodes = new QCheckBox("Show Position Nodes", m_GroupBoxEnableExclusiveInterpolationMode); |
| 179 | vboxLayout->addWidget(m_ChkShowPositionNodes); |
| 180 | |
| 181 | this->HideAllInterpolationControls(); |
| 182 | |
| 183 | connect(m_CmbInterpolation, SIGNAL(currentIndexChanged(int)), this, SLOT(OnInterpolationMethodChanged(int))); |
| 184 | connect(m_BtnApply2D, SIGNAL(clicked()), this, SLOT(OnAcceptInterpolationClicked())); |
| 185 | connect(m_BtnApplyForAllSlices2D, SIGNAL(clicked()), this, SLOT(OnAcceptAllInterpolationsClicked())); |
| 186 | connect(m_BtnApply3D, SIGNAL(clicked()), this, SLOT(OnAccept3DInterpolationClicked())); |
| 187 | |
| 188 | |
| 189 | connect(m_BtnReinit3DInterpolation, SIGNAL(clicked()), this, SLOT(OnReinit3DInterpolation())); |
| 190 | connect(m_ChkShowPositionNodes, SIGNAL(toggled(bool)), this, SLOT(OnShowMarkers(bool))); |
| 191 | connect(m_ChkShowPositionNodes, SIGNAL(toggled(bool)), this, SIGNAL(SignalShowMarkerNodes(bool))); |
| 192 | |
| 193 | QHBoxLayout *layout = new QHBoxLayout(this); |
| 194 | layout->addWidget(m_GroupBoxEnableExclusiveInterpolationMode); |
| 195 | this->setLayout(layout); |
| 196 | |
| 197 | itk::ReceptorMemberCommand<QmitkSlicesInterpolator>::Pointer command = |
| 198 | itk::ReceptorMemberCommand<QmitkSlicesInterpolator>::New(); |
| 199 | command->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnInterpolationInfoChanged); |
| 200 | InterpolationInfoChangedObserverTag = m_Interpolator->AddObserver(itk::ModifiedEvent(), command); |
nothing calls this directly
no test coverage detected