46 #include <itkCommand.h>
51 #include <QMessageBox>
52 #include <QPushButton>
53 #include <QVBoxLayout>
55 #include <vtkPolyVertex.h>
56 #include <vtkUnstructuredGrid.h>
64 std::map<QAction *, mitk::SliceNavigationController *> actionToSliceDimension;
70 return actionToSliceDimension;
76 m_Interpolator(
mitk::SegmentationInterpolationController::
New()),
77 m_SurfaceInterpolator(
mitk::SurfaceInterpolationController::GetInstance()),
82 m_2DInterpolationEnabled(false),
83 m_3DInterpolationEnabled(false),
86 m_GroupBoxEnableExclusiveInterpolationMode =
new QGroupBox(
"Interpolation",
this);
88 QVBoxLayout *vboxLayout =
new QVBoxLayout(m_GroupBoxEnableExclusiveInterpolationMode);
93 m_CmbInterpolation =
new QComboBox(m_GroupBoxEnableExclusiveInterpolationMode);
94 m_CmbInterpolation->addItem(
"Disabled");
95 m_CmbInterpolation->addItem(
"2-Dimensional");
96 m_CmbInterpolation->addItem(
"3-Dimensional");
97 vboxLayout->addWidget(m_CmbInterpolation);
99 m_BtnApply2D =
new QPushButton(
"Confirm for single slice", m_GroupBoxEnableExclusiveInterpolationMode);
100 vboxLayout->addWidget(m_BtnApply2D);
102 m_BtnApplyForAllSlices2D =
new QPushButton(
"Confirm for all slices", m_GroupBoxEnableExclusiveInterpolationMode);
103 vboxLayout->addWidget(m_BtnApplyForAllSlices2D);
105 m_BtnApply3D =
new QPushButton(
"Confirm", m_GroupBoxEnableExclusiveInterpolationMode);
106 vboxLayout->addWidget(m_BtnApply3D);
108 m_BtnSuggestPlane =
new QPushButton(
"Suggest a plane", m_GroupBoxEnableExclusiveInterpolationMode);
109 vboxLayout->addWidget(m_BtnSuggestPlane);
111 m_BtnReinit3DInterpolation =
new QPushButton(
"Reinit Interpolation", m_GroupBoxEnableExclusiveInterpolationMode);
112 vboxLayout->addWidget(m_BtnReinit3DInterpolation);
114 m_ChkShowPositionNodes =
new QCheckBox(
"Show Position Nodes", m_GroupBoxEnableExclusiveInterpolationMode);
115 vboxLayout->addWidget(m_ChkShowPositionNodes);
117 this->HideAllInterpolationControls();
127 connect(m_ChkShowPositionNodes, SIGNAL(toggled(
bool)),
this, SLOT(
OnShowMarkers(
bool)));
130 QHBoxLayout *layout =
new QHBoxLayout(
this);
131 layout->addWidget(m_GroupBoxEnableExclusiveInterpolationMode);
132 this->setLayout(layout);
137 InterpolationInfoChangedObserverTag = m_Interpolator->AddObserver(itk::ModifiedEvent(), command);
142 SurfaceInterpolationInfoChangedObserverTag = m_SurfaceInterpolator->AddObserver(itk::ModifiedEvent(), command2);
165 m_InterpolatedSurfaceNode->SetVisibility(
false);
175 m_3DContourNode->SetVisibility(
177 m_3DContourNode->SetVisibility(
179 m_3DContourNode->SetVisibility(
181 m_3DContourNode->SetVisibility(
184 QWidget::setContentsMargins(0, 0, 0, 0);
185 if (QWidget::layout() != NULL)
187 QWidget::layout()->setContentsMargins(0, 0, 0, 0);
196 m_Timer =
new QTimer(
this);
202 if (m_DataStorage == storage)
207 if (m_DataStorage.IsNotNull())
209 m_DataStorage->RemoveNodeEvent.RemoveListener(
214 m_DataStorage = storage;
215 m_SurfaceInterpolator->SetDataStorage(storage);
217 if (m_DataStorage.IsNotNull())
219 m_DataStorage->RemoveNodeEvent.AddListener(
227 if (m_DataStorage.IsNotNull())
229 return m_DataStorage;
238 const QList<mitk::SliceNavigationController *> &controllers)
240 Q_ASSERT(!controllers.empty());
248 m_ToolManager = toolManager;
254 QWidget::setEnabled(node != NULL);
257 m_ToolManager->WorkingDataChanged +=
272 m_ControllerToDeleteObserverTag.insert(slicer, slicer->AddObserver(itk::DeleteEvent(), deleteCommand));
277 m_ControllerToTimeObserverTag.insert(
283 m_ControllerToSliceObserverTag.insert(
289 m_Initialized =
true;
294 if (m_ToolManager.IsNotNull())
296 m_ToolManager->WorkingDataChanged -=
304 slicer->RemoveObserver(m_ControllerToDeleteObserverTag.take(slicer));
305 slicer->RemoveObserver(m_ControllerToTimeObserverTag.take(slicer));
306 slicer->RemoveObserver(m_ControllerToSliceObserverTag.take(slicer));
311 m_ToolManager = NULL;
313 m_Initialized =
false;
326 if (m_DataStorage.IsNotNull())
328 m_DataStorage->RemoveNodeEvent.RemoveListener(
331 if (m_DataStorage->Exists(m_3DContourNode))
332 m_DataStorage->Remove(m_3DContourNode);
333 if (m_DataStorage->Exists(m_InterpolatedSurfaceNode))
334 m_DataStorage->Remove(m_InterpolatedSurfaceNode);
338 m_Interpolator->RemoveObserver(InterpolationInfoChangedObserverTag);
339 m_SurfaceInterpolator->RemoveObserver(SurfaceInterpolationInfoChangedObserverTag);
349 QWidget::setEnabled(enable);
354 if (m_2DInterpolationEnabled)
356 this->Show2DInterpolationControls(
true);
357 m_Interpolator->Activate2DInterpolation(
true);
359 else if (m_3DInterpolationEnabled)
361 this->Show3DInterpolationControls(
true);
368 this->HideAllInterpolationControls();
376 m_Interpolator->Activate2DInterpolation(status);
394 void QmitkSlicesInterpolator::HideAllInterpolationControls()
396 this->Show2DInterpolationControls(
false);
397 this->Show3DInterpolationControls(
false);
400 void QmitkSlicesInterpolator::Show2DInterpolationControls(
bool show)
402 m_BtnApply2D->setVisible(show);
403 m_BtnApplyForAllSlices2D->setVisible(show);
406 void QmitkSlicesInterpolator::Show3DInterpolationControls(
bool show)
408 m_BtnApply3D->setVisible(show);
409 m_BtnSuggestPlane->setVisible(show);
410 m_ChkShowPositionNodes->setVisible(show);
411 m_BtnReinit3DInterpolation->setVisible(show);
419 m_GroupBoxEnableExclusiveInterpolationMode->setTitle(
"Interpolation");
420 this->HideAllInterpolationControls();
424 m_Interpolator->Activate2DInterpolation(
false);
428 m_GroupBoxEnableExclusiveInterpolationMode->setTitle(
"Interpolation (Enabled)");
429 this->HideAllInterpolationControls();
430 this->Show2DInterpolationControls(
true);
433 m_Interpolator->Activate2DInterpolation(
true);
437 m_GroupBoxEnableExclusiveInterpolationMode->setTitle(
"Interpolation (Enabled)");
438 this->HideAllInterpolationControls();
439 this->Show3DInterpolationControls(
true);
442 m_Interpolator->Activate2DInterpolation(
false);
446 MITK_ERROR <<
"Unknown interpolation method!";
447 m_CmbInterpolation->setCurrentIndex(0);
457 for (mitk::DataStorage::SetOfObjects::ConstIterator it = allContourMarkers->Begin(); it != allContourMarkers->End();
466 if (m_ToolManager->GetWorkingData(0) != 0)
468 m_Segmentation =
dynamic_cast<mitk::Image *
>(m_ToolManager->GetWorkingData(0)->GetData());
469 m_BtnReinit3DInterpolation->setEnabled(
true);
475 m_FeedbackNode->SetData(NULL);
477 m_3DContourNode->SetData(NULL);
479 m_InterpolatedSurfaceNode->SetData(NULL);
480 m_BtnReinit3DInterpolation->setEnabled(
false);
486 if (m_2DInterpolationEnabled)
490 this->CheckSupportedImageDimension();
500 if (!dynamic_cast<const mitk::SliceNavigationController::GeometryTimeEvent *>(&e))
508 m_SurfaceInterpolator->SetCurrentTimeStep(slicer->
GetTime()->
GetPos());
510 if (m_LastSNC == slicer)
519 if (!dynamic_cast<const mitk::SliceNavigationController::GeometrySliceEvent *>(&e))
533 if (!m_2DInterpolationEnabled)
542 if (tsg && m_TimeStep.contains(slicer))
557 catch (std::bad_cast)
566 unsigned int timeStep,
577 int clickedSliceDimension(-1);
578 int clickedSliceIndex(-1);
584 m_Interpolator->Interpolate(clickedSliceDimension, clickedSliceIndex, plane, timeStep);
585 m_FeedbackNode->SetData(interpolation);
588 m_LastSliceIndex = clickedSliceIndex;
599 if (interpolatedSurface.IsNotNull() && workingNode &&
603 m_BtnApply3D->setEnabled(
true);
604 m_BtnSuggestPlane->setEnabled(
true);
605 m_InterpolatedSurfaceNode->SetData(interpolatedSurface);
606 m_3DContourNode->SetData(m_SurfaceInterpolator->GetContoursAsSurface());
610 if (!m_DataStorage->Exists(m_InterpolatedSurfaceNode))
612 m_DataStorage->Add(m_InterpolatedSurfaceNode);
614 if (!m_DataStorage->Exists(m_3DContourNode))
616 m_DataStorage->Add(m_3DContourNode, workingNode);
619 else if (interpolatedSurface.IsNull())
621 m_BtnApply3D->setEnabled(
false);
622 m_BtnSuggestPlane->setEnabled(
false);
624 if (m_DataStorage->Exists(m_InterpolatedSurfaceNode))
630 m_BtnReinit3DInterpolation->setEnabled(
true);
640 if (m_Segmentation && m_FeedbackNode->GetData())
648 reslice->SetInputSlice(slice->GetSliceData()->GetVtkImageAccessor(slice)->GetVtkImageData());
650 reslice->SetOverwriteMode(
true);
654 extractor->SetInput(m_Segmentation);
656 extractor->SetTimeStep(timestep);
658 extractor->SetVtkOutputRequest(
true);
661 extractor->Modified();
665 m_Segmentation->Modified();
668 m_FeedbackNode->SetData(NULL);
688 timeSelector->SetInput(m_Segmentation);
689 timeSelector->SetTimeNr(timeStep);
690 timeSelector->Update();
691 image3D = timeSelector->GetOutput();
695 diffImage->Initialize(image3D);
703 mitk::PixelType pixelType(mitk::MakeScalarPixelType<mitk::Tool::DefaultSegmentationDataType>());
706 if (m_Segmentation->
GetImageDescriptor()->GetChannelDescriptor().GetPixelType().GetComponentType() ==
707 itk::ImageIOBase::UCHAR)
709 pixelType = mitk::MakeScalarPixelType<unsigned char>();
714 (pixelType.
GetBpe() >> 3) * diffImage->GetDimension(0) * diffImage->GetDimension(1) *
715 diffImage->GetDimension(2));
721 int sliceDimension(-1);
725 unsigned int zslices = m_Segmentation->
GetDimension(sliceDimension);
729 unsigned int totalChangedSlices(0);
731 for (
unsigned int sliceIndex = 0; sliceIndex < zslices; ++sliceIndex)
736 origin[sliceDimension] = sliceIndex;
738 reslicePlane->SetOrigin(origin);
741 m_Interpolator->Interpolate(sliceDimension, sliceIndex, reslicePlane, timeStep);
743 if (interpolation.IsNotNull())
750 reslice->SetInputSlice(interpolation->GetSliceData()->GetVtkImageAccessor(interpolation)->GetVtkImageData());
751 reslice->SetOverwriteMode(
true);
755 diffslicewriter->SetInput(diffImage);
756 diffslicewriter->SetTimeStep(0);
757 diffslicewriter->SetWorldGeometry(reslicePlane);
758 diffslicewriter->SetVtkOutputRequest(
true);
759 diffslicewriter->SetResliceTransformByGeometry(diffImage->GetTimeGeometry()->GetGeometryForTimeStep(0));
761 diffslicewriter->Modified();
762 diffslicewriter->Update();
763 ++totalChangedSlices;
769 if (totalChangedSlices > 0)
780 std::stringstream comment;
781 comment <<
"Confirm all interpolations (" << totalChangedSlices <<
")";
793 m_FeedbackNode->SetData(NULL);
810 QMenu orientationPopup(
this);
811 std::map<QAction *, mitk::SliceNavigationController *>::const_iterator it;
813 orientationPopup.addAction(it->first);
817 orientationPopup.exec(QCursor::pos());
822 if (m_InterpolatedSurfaceNode.IsNotNull() && m_InterpolatedSurfaceNode->GetData())
824 mitk::DataNode *segmentationNode = m_ToolManager->GetWorkingData(0);
828 s2iFilter->MakeOutputBinaryOn();
830 s2iFilter->SetUShortBinaryPixelType(
true);
831 s2iFilter->SetInput(dynamic_cast<mitk::Surface *>(m_InterpolatedSurfaceNode->GetData()));
834 if (m_ToolManager->GetReferenceData(0) == NULL || m_ToolManager->GetWorkingData(0) == NULL)
838 s2iFilter->SetImage(dynamic_cast<mitk::Image *>(m_ToolManager->GetReferenceData(0)->GetData()));
845 const void *cPointer = readAccess.
GetData();
847 if (currSeg && cPointer)
849 currSeg->
SetVolume(cPointer, timestep, 0);
856 m_CmbInterpolation->setCurrentIndex(0);
861 segSurface->SetColor(rgb);
862 segSurface->SetData(m_InterpolatedSurfaceNode->GetData());
863 std::stringstream stream;
864 stream << segmentationNode->
GetName();
866 stream <<
"3D-interpolation";
867 segSurface->SetName(stream.str());
871 segSurface->SetVisibility(
false);
872 m_DataStorage->Add(segSurface, segmentationNode);
877 void ::QmitkSlicesInterpolator::OnSuggestPlaneClicked()
879 if (m_PlaneWatcher.isRunning())
880 m_PlaneWatcher.waitForFinished();
882 m_PlaneWatcher.setFuture(m_PlaneFuture);
885 void ::QmitkSlicesInterpolator::RunPlaneSuggestion()
892 m_EdgeDetector->SetSegmentationMask(m_Segmentation);
893 m_EdgeDetector->SetInput(dynamic_cast<mitk::Image *>(m_ToolManager->GetReferenceData(0)->GetData()));
894 m_EdgeDetector->Update();
897 uGrid->SetVtkUnstructuredGrid(m_EdgeDetector->GetOutput()->GetVtkUnstructuredGrid());
903 vtkSmartPointer<vtkPolyData> vtkpoly = surface->GetVtkPolyData();
904 vtkSmartPointer<vtkPoints> vtkpoints = vtkpoly->GetPoints();
909 verts->GetPointIds()->SetNumberOfIds(vtkpoints->GetNumberOfPoints());
910 for (
int i = 0; i < vtkpoints->GetNumberOfPoints(); i++)
912 verts->GetPointIds()->SetId(i, i);
916 vGrid->InsertNextCell(verts->GetCellType(), verts->GetPointIds());
917 vGrid->SetPoints(vtkpoints);
920 interpolationGrid->SetVtkUnstructuredGrid(vGrid);
922 m_PointScorer->SetInput(0, uGrid);
923 m_PointScorer->SetInput(1, interpolationGrid);
924 m_PointScorer->Update();
927 scoredGrid = m_PointScorer->GetOutput();
933 clusterFilter->SetInput(scoredGrid);
934 clusterFilter->SetMeshing(
false);
935 clusterFilter->SetMinPts(4);
936 clusterFilter->Seteps(spacing);
937 clusterFilter->Update();
945 std::vector<mitk::UnstructuredGrid::Pointer> grids = clusterFilter->GetAllClusters();
970 m_DataStorage->GetDerivations(m_ToolManager->GetWorkingData(0), pred);
971 if (contourNodes->Size() != 0)
973 m_3DContourNode = contourNodes->at(0);
977 QMessageBox errorInfo;
978 errorInfo.setWindowTitle(
"Reinitialize surface interpolation");
979 errorInfo.setIcon(QMessageBox::Information);
980 errorInfo.setText(
"No contours available for the selected segmentation!");
986 m_BtnReinit3DInterpolation->setEnabled(
false);
993 std::map<QAction *, mitk::SliceNavigationController *>::const_iterator iter =
ACTION_TO_SLICEDIMENSION.find(action);
1003 QMessageBox errorInfo;
1004 errorInfo.setWindowTitle(
"Interpolation Process");
1005 errorInfo.setIcon(QMessageBox::Critical);
1006 errorInfo.setText(
"An error occurred during interpolation. Possible cause: Not enough memory!");
1010 std::cerr <<
"Ill construction in " __FILE__
" l. " << __LINE__ << std::endl;
1016 m_2DInterpolationEnabled = on;
1020 if (m_DataStorage.IsNotNull())
1022 if (on && !m_DataStorage->Exists(m_FeedbackNode))
1024 m_DataStorage->Add(m_FeedbackNode);
1036 mitk::DataNode *referenceNode = m_ToolManager->GetReferenceData(0);
1037 QWidget::setEnabled(workingNode != NULL);
1039 m_BtnApply2D->setEnabled(on);
1040 m_FeedbackNode->SetVisibility(on);
1053 m_Interpolator->SetSegmentationVolume(segmentation);
1058 m_Interpolator->SetReferenceVolume(referenceImage);
1069 m_SurfaceInterpolator->Interpolate();
1074 m_Timer->start(500);
1087 float currentColor[3];
1088 m_InterpolatedSurfaceNode->GetColor(currentColor);
1098 m_InterpolatedSurfaceNode->Update();
1105 m_3DInterpolationEnabled = on;
1107 this->CheckSupportedImageDimension();
1110 if (m_DataStorage.IsNotNull() && m_ToolManager && m_3DInterpolationEnabled)
1116 bool isInterpolationResult(
false);
1117 workingNode->
GetBoolProperty(
"3DInterpolationResult", isInterpolationResult);
1122 m_DataStorage->GetDerivations(workingNode, pred);
1124 for (
unsigned int i = 0; i < interpolationResults->Size(); ++i)
1127 if (currNode.IsNotNull())
1128 m_DataStorage->Remove(currNode);
1133 !isInterpolationResult && m_3DInterpolationEnabled)
1135 int ret = QMessageBox::Yes;
1137 if (m_SurfaceInterpolator->EstimatePortionOfNeededMemory() > 0.5)
1140 msgBox.setText(
"Due to short handed system memory the 3D interpolation may be very slow!");
1141 msgBox.setInformativeText(
"Are you sure you want to activate the 3D interpolation?");
1142 msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
1143 ret = msgBox.exec();
1146 if (m_Watcher.isRunning())
1147 m_Watcher.waitForFinished();
1149 if (ret == QMessageBox::Yes)
1152 m_Watcher.setFuture(m_Future);
1156 m_CmbInterpolation->setCurrentIndex(0);
1159 else if (!m_3DInterpolationEnabled)
1162 m_BtnApply3D->setEnabled(m_3DInterpolationEnabled);
1163 m_BtnSuggestPlane->setEnabled(m_3DInterpolationEnabled);
1168 QWidget::setEnabled(
false);
1169 m_ChkShowPositionNodes->setEnabled(m_3DInterpolationEnabled);
1172 if (!m_3DInterpolationEnabled)
1175 m_BtnApply3D->setEnabled(m_3DInterpolationEnabled);
1176 m_BtnSuggestPlane->setEnabled(m_3DInterpolationEnabled);
1181 MITK_ERROR <<
"Error with 3D surface interpolation!";
1213 if (m_3DInterpolationEnabled)
1215 if (m_Watcher.isRunning())
1216 m_Watcher.waitForFinished();
1218 m_Watcher.setFuture(m_Future);
1227 if (m_DataStorage.IsNotNull() && m_ToolManager && m_LastSNC)
1233 bool isInterpolationResult(
false);
1234 workingNode->
GetBoolProperty(
"3DInterpolationResult", isInterpolationResult);
1236 if (!isInterpolationResult)
1238 QWidget::setEnabled(
true);
1241 unsigned int time_position = 0;
1242 if (m_LastSNC->
GetTime() != NULL)
1246 double minSpacing(100);
1247 double maxSpacing(0);
1248 for (
int i = 0; i < 3; i++)
1250 if (spacing[i] < minSpacing)
1252 minSpacing = spacing[i];
1254 if (spacing[i] > maxSpacing)
1256 maxSpacing = spacing[i];
1260 m_SurfaceInterpolator->SetMaxSpacing(maxSpacing);
1261 m_SurfaceInterpolator->SetMinSpacing(minSpacing);
1262 m_SurfaceInterpolator->SetDistanceImageVolume(50000);
1267 m_SurfaceInterpolator->SetCurrentInterpolationSession(segmentationImage);
1268 m_SurfaceInterpolator->SetCurrentTimeStep(time_position);
1273 if (m_3DInterpolationEnabled)
1275 if (m_Watcher.isRunning())
1276 m_Watcher.waitForFinished();
1278 m_Watcher.setFuture(m_Future);
1284 QWidget::setEnabled(
false);
1291 if (m_InterpolatedSurfaceNode.IsNotNull())
1292 m_InterpolatedSurfaceNode->SetVisibility(status);
1294 if (m_3DContourNode.IsNotNull())
1295 m_3DContourNode->SetVisibility(
1301 void QmitkSlicesInterpolator::CheckSupportedImageDimension()
1303 if (m_ToolManager->GetWorkingData(0))
1304 m_Segmentation = dynamic_cast<mitk::Image *>(m_ToolManager->GetWorkingData(0)->GetData());
1318 const itk::EventObject & )
1325 m_ControllerToTimeObserverTag.remove(slicer);
1326 m_ControllerToSliceObserverTag.remove(slicer);
1327 m_ControllerToDeleteObserverTag.remove(slicer);
1331 void QmitkSlicesInterpolator::WaitForFutures()
1333 if (m_Watcher.isRunning())
1335 m_Watcher.waitForFinished();
1338 if (m_PlaneWatcher.isRunning())
1340 m_PlaneWatcher.waitForFinished();
1344 void QmitkSlicesInterpolator::NodeRemoved(
const mitk::DataNode* node)
1346 if ((m_ToolManager && m_ToolManager->GetWorkingData(0) == node) ||
1347 node == m_3DContourNode ||
1348 node == m_FeedbackNode ||
1349 node == m_InterpolatedSurfaceNode)
void Progress(unsigned int steps=1)
Sets the current amount of progress to current progress + steps.
void ReinitializeInterpolation(mitk::Surface::Pointer contours)
Reinitializes the interpolation using the provided contour data.
void SetCurrentContourListID()
Operation, that holds information about some image difference.
Class for storing surfaces (vtkPolyData).
void OnAcceptAllPopupActivated(QAction *action)
virtual double GetDistanceImageSpacing()
void OnSurfaceInterpolationFinished()
Data management class that handles 'was created by' relations.
itk::SmartPointer< Self > Pointer
const std::map< QAction *, mitk::SliceNavigationController * > createActionToSliceDimension()
void OnInterpolationMethodChanged(int index)
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
static vtkRenderWindow * GetRenderWindowByName(const std::string &name)
BaseRenderer * GetRenderer() const
Gets the BaseRenderer associated with this SNC (if any). While the BaseRenderer is not directly used ...
const char * GetViewDirectionAsString() const
void OnAcceptAllInterpolationsClicked()
float SURFACE_COLOR_RGB[3]
static Pointer GetInstance()
void OnSliceChanged(itk::Object *sender, const itk::EventObject &)
bool GetName(std::string &nodeName, const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="name") const
Convenience access method for accessing the name of an object (instance of StringProperty with proper...
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
void OnInterpolationInfoChanged(const itk::EventObject &)
const void * GetData() const
Gives const access to the data.
DataCollection - Class to facilitate loading/accessing structured data.
const mitk::Vector3D GetSpacing() const
Get the spacing (size of a pixel).
virtual vtkImageData * GetVtkImageData(int t=0, int n=0)
Get a volume at a specific time t of channel n as a vtkImageData.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
void * GetData()
Gives full data access.
Constants for most interaction classes, due to the generic StateMachines.
void UpdateVisibleSuggestion()
void RunPlaneSuggestion()
void Initialize(mitk::ToolManager *toolManager, const QList< mitk::SliceNavigationController * > &controllers)
static ProgressBar * GetInstance()
static method to get the GUI dependent ProgressBar-instance so the methods for steps to do and progre...
void OnInterpolationActivated(bool)
void OnSuggestPlaneClicked()
Controls the selection of the slice the associated BaseRenderer will display.
virtual ~QmitkSlicesInterpolator()
itk::SmartPointer< const Self > ConstPointer
void SignalShowMarkerNodes(bool)
void OnAccept3DInterpolationClicked()
virtual bool SetVolume(const void *data, int t=0, int n=0)
Set data as volume at time t in channel n. It is in the responsibility of the caller to ensure that t...
void AcceptAllInterpolations(mitk::SliceNavigationController *slicer)
bool IsVisible(const mitk::BaseRenderer *renderer, const char *propertyKey="visible", bool defaultIsOn=true) const
Convenience access method for visibility properties (instances of BoolProperty). Return value is the ...
The LevelWindow class Class to store level/window values.
vcl_size_t GetBpe() const
Get the number of bits per element (of an element)
virtual void SendSlice()
Send the currently selected slice to the connected observers (renderers)
void SetUseDistances(bool)
If true, the three clusters with the biggest mean distances are used for plane proposal Required the ...
mitk::DataStorage * GetDataStorage()
virtual void setEnabled(bool)
static DiffImageApplier * GetInstanceForUndo()
void OnAcceptInterpolationClicked()
void ChangeSurfaceColor()
An object of this class represents an exception of MITK. Please don't instantiate exceptions manually...
void StartUpdateInterpolationTimer()
static RenderingManager * GetInstance()
void CreatePlaneInfo()
Creates the actual plane proposal.
Image class for storing images.
virtual mitk::PlaneGeometry * GetPlaneGeometry(int s) const
Returns the PlaneGeometry of the slice (s).
const mitk::PlaneGeometry * GetCurrentPlaneGeometry()
Returns the currently selected Plane in the current BaseGeometry (if existent).
bool TranslateAndInterpolateChangedSlice(const itk::EventObject &e, mitk::SliceNavigationController *slicer)
std::map< QAction *, mitk::SliceNavigationController * > ACTION_TO_SLICEDIMENSION
virtual unsigned int GetPos() const
void OnTimeChanged(itk::Object *sender, const itk::EventObject &)
int GetComponentType() const
Get the component type (the scalar (!) type). Each element may contain m_NumberOfComponents (more tha...
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
void On2DInterpolationEnabled(bool)
static Pointer New(const char *_arg)
void SetSliceNavigationController(itk::SmartPointer< mitk::SliceNavigationController > &snc)
Describes the geometry of a data object consisting of slices.
virtual void ExecuteOperation(Operation *operation) override
void OnInterpolationDisabled(bool)
static Pointer New(const char *_arg)
void RequestUpdate(vtkRenderWindow *renderWindow)
void SetDataStorage(mitk::DataStorage::Pointer storage)
void FinishInterpolation(mitk::SliceNavigationController *slicer=NULL)
void AddStepsToDo(unsigned int steps)
Adds steps to totalSteps.
The PlaneProposer creates a new plane based on an input point cloud.
void OnReinit3DInterpolation()
void IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
Convert (continuous or discrete) index coordinates of a vector vec_units to world coordinates (in mm)...
void OnSurfaceInterpolationInfoChanged(const itk::EventObject &)
void OnToolManagerReferenceDataModified()
static SurfaceInterpolationController * GetInstance()
void EnableInterpolation(bool)
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const =0
Returns the geometry which corresponds to the given time step.
virtual bool SetOperationEvent(UndoStackItem *stackItem)=0
static UndoModel * GetCurrentUndoModel()
gives access to the currently used UndoModel Introduced to access special functions of more specific ...
void On3DInterpolationActivated(bool)
void SetFactor(double factor)
void Enable3DInterpolation(bool)
void OnToolManagerWorkingDataModified()
SlicedGeometry3D * GetSlicedGeometry(unsigned int t=0) const
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it)...
mitk::Stepper * GetTime()
Get the Stepper through the time.
ImageWriteAccessor class to get locked write-access for a particular image part.
Describes a two-dimensional, rectangular plane.
static void IncCurrObjectEventId()
Increases the current ObjectEventId For example if a button click generates operations the ObjectEven...
void Run3DInterpolation()
void Show3DInterpolationResult(bool)
Set the visibility of the 3d interpolation.
unsigned int GetDimension() const
Get dimension of the image.
virtual void Remove(const mitk::DataNode *node)=0
Removes node from the DataStorage.
void StopUpdateInterpolationTimer()
ImageReadAccessor class to get locked read access for a particular image part.
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
ImageDescriptor::Pointer GetImageDescriptor() const
void Interpolate(mitk::PlaneGeometry *plane, unsigned int timeStep, mitk::SliceNavigationController *slicer)
QmitkSlicesInterpolator(QWidget *parent=0, const char *name=0)
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer=nullptr, const char *propertyKey="color") const
Convenience access method for color properties (instances of ColorProperty)
static void IncCurrGroupEventId()
Increases the current GroupEventId For example if a button click generates operations the GroupEventI...
void OnSliceNavigationControllerDeleted(const itk::Object *sender, const itk::EventObject &)
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Represents a pair of operations: undo and the according redo.
void SetUnstructuredGrids(std::vector< itk::SmartPointer< mitk::UnstructuredGrid >> &grids)
Class for nodes of the DataTree.
Class for defining the data type of pixels.
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const
Convert world coordinates (in mm) of a point to (continuous!) index coordinates.
void On3DInterpolationEnabled(bool)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.