Page MenuHomePhabricator

patch-datatree.patch

Authored By
maleike
Feb 10 2010, 11:39 AM
Size
51 KB
Referenced Files
None
Subscribers
None

patch-datatree.patch

Index: CoreUI/Qmitk/QmitkMaterialEditor.ui
===================================================================
--- CoreUI/Qmitk/QmitkMaterialEditor.ui (revision 21264)
+++ CoreUI/Qmitk/QmitkMaterialEditor.ui (working copy)
@@ -279,7 +279,6 @@
</customwidgets>
<includes>
<include location="local" >mitkCommon.h</include>
- <include location="local" >mitkDataTree.h</include>
<include location="local" >mitkMaterialProperty.h</include>
<include location="global" >vector</include>
<include location="local" >QmitkMaterialShowcase.h</include>
Index: CoreUI/Qmitk/QmitkStdMultiWidget.h
===================================================================
--- CoreUI/Qmitk/QmitkStdMultiWidget.h (revision 21264)
+++ CoreUI/Qmitk/QmitkStdMultiWidget.h (working copy)
@@ -261,7 +261,6 @@
mitk::SlicesRotator::Pointer m_SlicesRotator;
mitk::SlicesSwiveller::Pointer m_SlicesSwiveller;
- mitk::DataTreeIteratorClone planesIterator;
mitk::DataTreeNode::Pointer m_PositionTrackerNode;
mitk::DataStorage::Pointer m_DataStorage;
Index: CoreUI/Qmitk/QmitkMaterialShowcase.h
===================================================================
--- CoreUI/Qmitk/QmitkMaterialShowcase.h (revision 21264)
+++ CoreUI/Qmitk/QmitkMaterialShowcase.h (working copy)
@@ -10,7 +10,7 @@
#include <QtGui/QWidget>
#include "QmitkRenderWindow.h"
#include "mitkCommon.h"
-#include "mitkDataTree.h"
+
#include "mitkDataTreeNode.h"
#include "mitkMaterialProperty.h"
#include "mitkSurface.h"
Index: CoreUI/Qmitk/QmitkRenderingManager.cpp
===================================================================
--- CoreUI/Qmitk/QmitkRenderingManager.cpp (revision 21264)
+++ CoreUI/Qmitk/QmitkRenderingManager.cpp (working copy)
@@ -18,7 +18,7 @@
#include "QmitkAbortEventFilter.h"
#include "QmitkRenderingManager.h"
-#include "mitkDataTree.h"
+
#include "mitkGeometry3D.h"
#include "mitkBaseRenderer.h"
#include "mitkSliceNavigationController.h"
Index: CoreUI/Qmitk/QmitkStdMultiWidget.cpp
===================================================================
--- CoreUI/Qmitk/QmitkStdMultiWidget.cpp (revision 21264)
+++ CoreUI/Qmitk/QmitkStdMultiWidget.cpp (working copy)
@@ -184,7 +184,6 @@
void QmitkStdMultiWidget::InitializeWidget()
{
- planesIterator = NULL;
m_PositionTracker = NULL;
// transfer colors in WorldGeometry-Nodes of the associated Renderer
Index: CoreUI/Qmitk/QmitkMaterialShowcase.ui
===================================================================
--- CoreUI/Qmitk/QmitkMaterialShowcase.ui (revision 21264)
+++ CoreUI/Qmitk/QmitkMaterialShowcase.ui (working copy)
@@ -56,7 +56,6 @@
<include location="local" >mitkCommon.h</include>
<include location="local" >mitkMaterialProperty.h</include>
<include location="local" >mitkDataTreeNode.h</include>
- <include location="local" >mitkDataTree.h</include>
<include location="local" >mitkSurface.h</include>
<include location="local" >vtkTextActor.h</include>
<include location="local" >vtkRenderer.h</include>
Index: Core/Code/files.cmake
===================================================================
--- Core/Code/files.cmake (revision 21264)
+++ Core/Code/files.cmake (working copy)
@@ -57,9 +57,9 @@
DataManagement/mitkClippingProperty.cpp
DataManagement/mitkColorProperty.cpp
DataManagement/mitkDataStorage.cpp
- DataManagement/mitkDataTree.cpp
+ #DataManagement/mitkDataTree.cpp
DataManagement/mitkDataTreeNode.cpp
- DataManagement/mitkDataTreeStorage.cpp
+ #DataManagement/mitkDataTreeStorage.cpp
DataManagement/mitkDisplayGeometry.cpp
DataManagement/mitkEnumerationProperty.cpp
DataManagement/mitkGeometry2D.cpp
Index: Core/Code/Controllers/mitkSlicesSwiveller.cpp
===================================================================
--- Core/Code/Controllers/mitkSlicesSwiveller.cpp (revision 21264)
+++ Core/Code/Controllers/mitkSlicesSwiveller.cpp (working copy)
@@ -273,6 +273,8 @@
RenderingManager::GetInstance()->RequestUpdateAll();
+ this->InvokeEvent( SliceRotationEvent() ); // notify listeners
+
ok = true;
break;
}
@@ -385,10 +387,12 @@
}
case AcROTATESTART:
{
+ this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
case AcROTATEEND:
{
+ this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
default:
Index: Core/Code/Controllers/mitkSlicesRotator.cpp
===================================================================
--- Core/Code/Controllers/mitkSlicesRotator.cpp (revision 21264)
+++ Core/Code/Controllers/mitkSlicesRotator.cpp (working copy)
@@ -425,6 +425,8 @@
RenderingManager::GetInstance()->RequestUpdateAll();
+ this->InvokeEvent( SliceRotationEvent() ); // notify listeners
+
ok = true;
break;
}
@@ -558,11 +560,13 @@
case AcROTATESTART:
{
this->SetMouseCursor( rotate_cursor_xpm, 0, 0 );
+ this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
case AcROTATEEND:
{
this->ResetMouseCursor();
+ this->InvokeEvent( SliceRotationEvent() ); // notify listeners
break;
}
default:
Index: Core/Code/Controllers/mitkSlicesCoordinator.h
===================================================================
--- Core/Code/Controllers/mitkSlicesCoordinator.h (revision 21264)
+++ Core/Code/Controllers/mitkSlicesCoordinator.h (working copy)
@@ -27,6 +27,8 @@
class SliceNavigationController;
class Action;
class StateEvent;
+
+itkEventMacro( SliceRotationEvent, itk::AnyEvent);
/**
* \brief Coordinates a list of SliceNavigationControllers.
Index: Core/Code/DataManagement/mitkDataTree.cpp
===================================================================
--- Core/Code/DataManagement/mitkDataTree.cpp (revision 21264)
+++ Core/Code/DataManagement/mitkDataTree.cpp (working copy)
@@ -16,7 +16,7 @@
=========================================================================*/
-#include "mitkDataTree.h"
+
#include <mitkSmartPointerProperty.h>
#include <mitkProperties.h>
Index: Core/Code/DataManagement/mitkDataTreeStorage.h
===================================================================
--- Core/Code/DataManagement/mitkDataTreeStorage.h (revision 21264)
+++ Core/Code/DataManagement/mitkDataTreeStorage.h (working copy)
@@ -21,8 +21,8 @@
#include "mitkDataStorage.h"
//#include "mitkCommon.h"
-#include "mitkDataTree.h"
+
namespace mitk {
class NodePredicateBase;
Index: Core/Code/Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp
===================================================================
--- Core/Code/Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp (revision 21264)
+++ Core/Code/Algorithms/mitkGeometry2DDataToSurfaceFilter.cpp (working copy)
@@ -22,7 +22,6 @@
#include "mitkGeometry2DData.h"
#include "mitkPlaneGeometry.h"
#include "mitkAbstractTransformGeometry.h"
-#include "mitkDataTree.h"
#include <vtkPolyData.h>
#include <vtkPlaneSource.h>
Index: Core/Code/Rendering/vtkMitkRenderProp.h
===================================================================
--- Core/Code/Rendering/vtkMitkRenderProp.h (revision 21264)
+++ Core/Code/Rendering/vtkMitkRenderProp.h (working copy)
@@ -23,9 +23,9 @@
#include "vtkProp.h"
#include "mitkVtkPropRenderer.h"
-#include "mitkDataTree.h"
+
/*!
\brief vtkMitkRenderProp
Index: Core/Code/Testing/mitkVtkPropRendererTest.cpp
===================================================================
--- Core/Code/Testing/mitkVtkPropRendererTest.cpp (revision 21264)
+++ Core/Code/Testing/mitkVtkPropRendererTest.cpp (working copy)
@@ -26,7 +26,7 @@
#include <mitkPicFileReader.h>
#include <mitkImage.h>
-#include <mitkDataTree.h>
+
#include <mitkDataStorage.h>
#include <mitkLevelWindow.h>
#include <mitkLevelWindowProperty.h>
Index: Core/Code/Testing/mitkImageMapper2DTest.cpp
===================================================================
--- Core/Code/Testing/mitkImageMapper2DTest.cpp (revision 21264)
+++ Core/Code/Testing/mitkImageMapper2DTest.cpp (working copy)
@@ -17,7 +17,7 @@
#include <mitkImage.h>
-#include <mitkDataTree.h>
+
//#include <mitkRenderWindow.h>
#include <mitkImageMapper2D.h>
#include <mitkLevelWindow.h>
Index: Modules/MitkExt/DataManagement/mitkDataTreeHelper.h
===================================================================
--- Modules/MitkExt/DataManagement/mitkDataTreeHelper.h (revision 21264)
+++ Modules/MitkExt/DataManagement/mitkDataTreeHelper.h (working copy)
@@ -1,107 +0,0 @@
-/*=========================================================================
-
-Program: Medical Imaging & Interaction Toolkit
-Language: C++
-Date: $Date$
-Version: $Revision$
-
-Copyright (c) German Cancer Research Center, Division of Medical and
-Biological Informatics. All rights reserved.
-See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
-
-This software is distributed WITHOUT ANY WARRANTY; without even
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. See the above copyright notices for more information.
-
-=========================================================================*/
-
-
-#ifndef DATATREEHELPER_H_HEADER_INCLUDED_C1C7797C
-#define DATATREEHELPER_H_HEADER_INCLUDED_C1C7797C
-
-#include "mitkCommon.h"
-#include "MitkExtExports.h"
-#include "mitkDataTree.h"
-
-#include "mitkImageCast.h"
-#include "mitkStringProperty.h"
-#include "mitkLevelWindowProperty.h"
-#include "mitkDataTreeNodeFactory.h"
-
-namespace mitk
-{
-
- //##Documentation
- //## @brief Convenience methods for common tasks concerning the data tree
- //## @ingroup DataManagement
- namespace DataTreeHelper
- {
- //##Documentation
- //## @brief Search a data tree for (the first) iterator to a given node
- MitkExt_EXPORT DataTreeIteratorClone FindIteratorToNode(mitk::DataTreeBase* tree, const DataTreeNode* node);
-
- //##Documentation
- //## @brief Search a data tree for (the first) iterator to a given node
- MitkExt_EXPORT DataTreeIteratorClone FindIteratorToNode(const DataTreeIteratorBase* startPosition, const DataTreeNode* node);
-
- //##Documentation
- //## @brief Add itk-image to data tree
- //##
- //## The itk-image is converted into an mitk::Image.
- //## @param itkImage the itk-image to be added
- //## @param iterator the iterator used for adding the node, containing the image
- //## @param name string with the name of the image, stored in the property "name"
- //## @param replaceByName if @a true, the tree is searched starting at
- //## @a iterator for a node called @a name, which data is replaced with
- //## @a itkImage
- template < typename TImageType >
- mitk::DataTreeNode::Pointer
- AddItkImageToDataTree(TImageType* itkImage, mitk::DataTreeIteratorBase* iterator, const char* name=NULL, bool replaceByName=false)
- {
- itkImage->Update();
-
- mitk::Image::Pointer mitkImage = mitk::Image::New();
- mitk::CastToMitkImage(itkImage, mitkImage);
-
- mitk::DataTreeNode::Pointer node = NULL;
- bool done=false;
- if((replaceByName) && (name != NULL))
- {
- mitk::DataTreeIteratorClone it=iterator;
- mitk::DataTreeIteratorClone itByName = ((mitk::DataTree *) it->GetTree())->GetNext("name", mitk::StringProperty::New( name ));
-
- if( (itByName->IsAtEnd() == false) && (itByName->Get().IsNotNull()) )
- {
- node = itByName->Get();
- node->SetData(mitkImage);
- done = true;
- }
- }
- if(done==false)
- {
- node=mitk::DataTreeNode::New();
- node->SetData(mitkImage);
- if(name!=NULL)
- node->SetProperty("name", mitk::StringProperty::New(name));
- iterator->Add(node);
- }
-
- mitk::LevelWindowProperty::Pointer levWinProp = mitk::LevelWindowProperty::New();
- mitk::LevelWindow levelwindow;
- levelwindow.SetAuto( mitkImage );
- levWinProp->SetLevelWindow( levelwindow );
- node->SetProperty( "levelwindow", levWinProp );
-
- return node;
- }
- /** Get child node which has a specified name
- * @returns child node of iterator which has the given name
- */
- MitkExt_EXPORT DataTreeIteratorClone GetNamedChild(mitk::DataTreeIteratorBase* iterator, std::string name);
- };
-
-} // namespace mitk
-
-#endif /* DATATREEHELPER_H_HEADER_INCLUDED_C1C7797C */
-
-
Index: Modules/MitkExt/Rendering/mitkContourVtkMapper3D.h
===================================================================
--- Modules/MitkExt/Rendering/mitkContourVtkMapper3D.h (revision 21264)
+++ Modules/MitkExt/Rendering/mitkContourVtkMapper3D.h (working copy)
@@ -18,13 +18,11 @@
#ifndef MITK_CONTOUR_VTK_MAPPER_3D_H
#define MITK_CONTOUR_VTK_MAPPER_3D_H
-#include "mitkCommon.h"
#include "MitkExtExports.h"
#include "mitkBaseVtkMapper3D.h"
-#include "mitkContour.h"
-#include "mitkBaseRenderer.h"
#include <vtkPolyData.h>
+#include <vtkSmartPointer.h>
class vtkPolyDataMapper;
class vtkAppendPolyData;
@@ -33,9 +31,13 @@
namespace mitk {
-//##Documentation
-//## @brief Vtk-based mapper for mitk::Contour
-//## @ingroup Mapper
+class BaseRenderer;
+class Contour;
+
+/**
+ @brief Vtk-based mapper for mitk::Contour
+ @ingroup Mapper
+ */
class MitkExt_EXPORT ContourVtkMapper3D : public BaseVtkMapper3D
{
public:
@@ -53,15 +55,15 @@
virtual void GenerateData(mitk::BaseRenderer* renderer);
- vtkPolyDataMapper* m_PointVtkPolyDataMapper;
- vtkPolyDataMapper* m_VtkPolyDataMapper;
- vtkTubeFilter* m_TubeFilter;
+ vtkSmartPointer<vtkPolyDataMapper> m_VtkPolyDataMapper;
+ vtkSmartPointer<vtkTubeFilter> m_TubeFilter;
- vtkAppendPolyData *m_VtkPointList;
- vtkPolyData *m_Contour;
- vtkActor *m_Actor;
+ vtkSmartPointer<vtkAppendPolyData> m_VtkPointList;
+ vtkSmartPointer<vtkPolyData> m_Contour;
+ vtkSmartPointer<vtkActor> m_Actor;
};
} // namespace mitk
#endif // MITK_CONTOUR_VTK_MAPPER_3D_H
+
Index: Modules/MitkExt/Rendering/mitkLineMapper2D.h
===================================================================
--- Modules/MitkExt/Rendering/mitkLineMapper2D.h (revision 21264)
+++ Modules/MitkExt/Rendering/mitkLineMapper2D.h (working copy)
@@ -22,7 +22,7 @@
#include "mitkCommon.h"
#include "MitkExtExports.h"
#include "mitkPointSetMapper2D.h"
-//#include "mitkDataTree.h"
+//
namespace mitk {
Index: Modules/MitkExt/Rendering/mitkContourMapper2D.h
===================================================================
--- Modules/MitkExt/Rendering/mitkContourMapper2D.h (revision 21264)
+++ Modules/MitkExt/Rendering/mitkContourMapper2D.h (working copy)
@@ -22,8 +22,8 @@
#include "mitkCommon.h"
#include "MitkExtExports.h"
#include "mitkGLMapper2D.h"
-#include "mitkDataTree.h"
+
namespace mitk {
class BaseRenderer;
Index: Modules/MitkExt/Rendering/mitkContourVtkMapper3D.cpp
===================================================================
--- Modules/MitkExt/Rendering/mitkContourVtkMapper3D.cpp (revision 21264)
+++ Modules/MitkExt/Rendering/mitkContourVtkMapper3D.cpp (working copy)
@@ -21,29 +21,23 @@
#include "mitkProperties.h"
#include "mitkColorProperty.h"
#include "mitkVtkPropRenderer.h"
+#include "mitkContour.h"
-
#include <vtkActor.h>
-#include <vtkActor.h>
-#include <vtkCellArray.h>
#include <vtkAppendPolyData.h>
+#include <vtkAssembly.h>
+#include <vtkCellArray.h>
+#include <vtkFollower.h>
+#include <vtkLinearTransform.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
-#include <vtkFollower.h>
-#include <vtkAssembly.h>
+#include <vtkPolygon.h>
#include <vtkProp3DCollection.h>
+#include <vtkProperty.h>
#include <vtkRenderer.h>
-#include <vtkLinearTransform.h>
-#include <vtkTubeFilter.h>
-#include <vtkPolygon.h>
#include <vtkSphereSource.h>
+#include <vtkTubeFilter.h>
-
-
-#include <vtkProperty.h>
-#include <vtkPolyDataMapper.h>
-#include <stdlib.h>
-
mitk::ContourVtkMapper3D::ContourVtkMapper3D()
{
m_VtkPolyDataMapper = vtkPolyDataMapper::New();
@@ -51,16 +45,11 @@
m_Actor = vtkActor::New();
m_Actor->SetMapper(m_VtkPolyDataMapper);
- m_Contour = NULL;
m_TubeFilter = vtkTubeFilter::New();
}
mitk::ContourVtkMapper3D::~ContourVtkMapper3D()
{
- m_VtkPolyDataMapper->Delete();
- m_VtkPointList->Delete();
- if ( m_Contour!=NULL )
- m_Contour->Delete();
}
vtkProp* mitk::ContourVtkMapper3D::GetVtkProp(mitk::BaseRenderer* /*renderer*/)
@@ -77,19 +66,15 @@
}
m_Actor->VisibilityOn();
- if ( m_Contour!=NULL )
- m_Contour->Delete();
-
m_Contour = vtkPolyData::New();
-
mitk::Contour::Pointer input = const_cast<mitk::Contour*>(this->GetInput());
bool makeContour = true;
if ( makeContour )
{
- vtkPoints *points = vtkPoints::New();
- vtkCellArray *lines = vtkCellArray::New();
+ vtkSmartPointer<vtkPoints> points = vtkPoints::New();
+ vtkSmartPointer<vtkCellArray> lines = vtkCellArray::New();
int numPts=input->GetNumberOfPoints();
if ( numPts > 200000 )
@@ -116,7 +101,6 @@
this->GetDataTreeNode()->GetBoolProperty("show points", showPoints);
if ( showPoints )
{
- m_VtkPointList->Delete();
m_VtkPointList = vtkAppendPolyData::New();
}
for ( i=0, ccur=cstart; i<numPts; ++i, ccur+=cstep )
@@ -151,7 +135,6 @@
}
m_Contour->SetPoints(points);
- points->Delete();
m_Contour->SetLines(lines);
m_Contour->Update();
Index: Modules/MitkExt/Rendering/mitkPlanarFigureMapper2D.h
===================================================================
--- Modules/MitkExt/Rendering/mitkPlanarFigureMapper2D.h (revision 21264)
+++ Modules/MitkExt/Rendering/mitkPlanarFigureMapper2D.h (working copy)
@@ -22,9 +22,9 @@
#include "mitkCommon.h"
#include "MitkExtExports.h"
#include "mitkGLMapper2D.h"
-#include "mitkDataTree.h"
+
namespace mitk {
class BaseRenderer;
Index: Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponentControls.ui
===================================================================
--- Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponentControls.ui (revision 21264)
+++ Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponentControls.ui (working copy)
@@ -23,7 +23,6 @@
<layoutdefault spacing="6" margin="11" />
<includes>
<include location="local" >mitkCommon.h</include>
- <include location="local" >mitkDataTree.h</include>
</includes>
<resources/>
<connections/>
Index: Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.cpp
===================================================================
--- Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.cpp (revision 21264)
+++ Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.cpp (working copy)
@@ -23,7 +23,6 @@
#include "mitkRenderingManager.h"
#include "mitkProperties.h"
-#include "mitkDataTreeFilterFunctions.h"
#include "mitkDataTreeNodeFactory.h"
#include "mitkImageTimeSelector.h"
#include "mitkLevelWindowProperty.h"
@@ -43,7 +42,7 @@
/*************** CONSTRUCTOR ***************/
-QmitkThresholdComponent::QmitkThresholdComponent(QObject * parent, const char * parentName, bool updateSelector, bool showSelector, QmitkStdMultiWidget * /*mitkStdMultiWidget*/, mitk::DataTreeIteratorBase* /*it*/)
+QmitkThresholdComponent::QmitkThresholdComponent(QObject * parent, const char * parentName, bool updateSelector, bool showSelector, QmitkStdMultiWidget * /*mitkStdMultiWidget*/)
: QmitkFunctionalityComponentContainer(parent, parentName, updateSelector, showSelector),
m_ThresholdImageNode(NULL),
m_ThresholdComponentGUI(NULL),
@@ -286,9 +285,6 @@
m_ThresholdSelectDataGroupBox->setShown(m_ShowSelector);
//m_ThresholdSelectDataGroupBox->setShown(true);
}
-
- // m_TreeNodeSelector->GetFilter()->SetFilter(mitk::IsBaseDataTypeWithoutProperty<mitk::Image>("isComponentThresholdImage"));
-
}
/*************** GET CONTENT CONTAINER ***************/
Index: Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.h
===================================================================
--- Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.h (revision 21264)
+++ Modules/QmitkExt/QmitkFunctionalityComponents/QmitkThresholdComponent.h (working copy)
@@ -53,7 +53,7 @@
public:
/*************** CONSTRUCTOR ***************/
/** \brief Constructor. */
- QmitkThresholdComponent(QObject *parent=0, const char *parentName=0, bool updateSelector = true, bool showSelector = true, QmitkStdMultiWidget *mitkStdMultiWidget = NULL, mitk::DataTreeIteratorBase* dataIt = NULL);
+ QmitkThresholdComponent(QObject *parent=0, const char *parentName=0, bool updateSelector = true, bool showSelector = true, QmitkStdMultiWidget *mitkStdMultiWidget = NULL);
/*************** DESTRUCTOR ***************/
/** \brief Destructor. */
Index: Modules/QmitkExt/QmitkApplicationBase/QmitkCommonFunctionality.cpp
===================================================================
--- Modules/QmitkExt/QmitkApplicationBase/QmitkCommonFunctionality.cpp (revision 21264)
+++ Modules/QmitkExt/QmitkApplicationBase/QmitkCommonFunctionality.cpp (working copy)
@@ -275,72 +275,6 @@
QMessageBox::critical(NULL,"ERROR","Save not successful. Possibly no writing permission.");
}
}
-
-mitk::DataTreeNode::Pointer CommonFunctionality::AddVtkMeshToDataTree(vtkPolyData* polys, mitk::DataTreeIteratorBase* iterator, std::string str)
-{
- mitk::DataTreeIteratorClone it=iterator;
-
- mitk::DataTreeNode::Pointer node = NULL;
- mitk::DataTreeIteratorClone subTree = ((mitk::DataTree *) it->GetTree())->GetNext("name", mitk::StringProperty::New( str.c_str() ));
-
- if (subTree->IsAtEnd() || subTree->Get().IsNull() )
- {
- node=mitk::DataTreeNode::New();
- mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New(str.c_str());
- node->SetProperty("name",nameProp);
- it->Add(node);
- }
- else
- {
- node = subTree->Get();
- }
-
- mitk::Surface::Pointer surface = mitk::Surface::New();
- surface->SetVtkPolyData(polys);
- node->SetData( surface );
- node->SetProperty("layer", mitk::IntProperty::New(1));
- node->SetVisibility(true,NULL);
-
- float meshColor[3] = {1.0,0.5,0.5};
- node->SetColor(meshColor, NULL );
- node->SetVisibility(true, NULL );
-
- return node;
-}
-
-mitk::DataTreeNode::Pointer CommonFunctionality::AddPicImageToDataTree(mitkIpPicDescriptor * pic, mitk::DataTreeIteratorBase* iterator, std::string str)
-{
- mitk::DataTreeIteratorClone it=iterator;
-
- mitk::Image::Pointer image = mitk::Image::New();
- image->Initialize(pic);
- image->SetPicVolume(pic);
-
- mitk::DataTreeNode::Pointer node = NULL;
- mitk::DataTreeIteratorClone subTree = ((mitk::DataTree *) it->GetTree())->GetNext("name", mitk::StringProperty::New( str.c_str() ));
-
- if (subTree->IsAtEnd() || subTree->Get().IsNull() )
- {
- node=mitk::DataTreeNode::New();
- mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New(str.c_str());
- node->SetProperty("name",nameProp);
- node->SetData(image);
- it->Add(node);
- }
- else
- {
- node = subTree->Get();
- node->SetData(image);
- }
-
- mitk::LevelWindowProperty::Pointer levWinProp = mitk::LevelWindowProperty::New();
- mitk::LevelWindow levelWindow;
- levelWindow.SetAuto( image );
- levWinProp->SetLevelWindow(levelWindow);
- node->GetPropertyList()->SetProperty("levelwindow",levWinProp);
- return node;
-}
-
mitk::DataTreeNode::Pointer CommonFunctionality::FileOpen( const QString& fileName)
{
return FileOpen( fileName.toLocal8Bit().constData() );
@@ -479,119 +413,7 @@
return NULL;
}
}
-mitk::DataTreeIteratorBase* CommonFunctionality::GetIteratorToFirstImage(mitk::DataTreeIteratorBase* dataTreeIterator)
-{
- mitk::DataTreeIteratorClone it = dataTreeIterator;
- while ( !it->IsAtEnd() )
- {
- mitk::DataTreeNode::Pointer node = it->Get();
- if ( node->GetData() != NULL )
- {
- // access the original image
- mitk::Image::Pointer img = dynamic_cast<mitk::Image*>( node->GetData() );
- // enquiry whether img is NULL
- if ( img.IsNotNull() )
- {
- return it->Clone();
- }
- }
- ++it;
- }
- std::cout << "No node containing an mitk::Image found, returning NULL..." << std::endl;
- return NULL;
-}
-
-mitk::DataTreeIteratorBase* CommonFunctionality::GetIteratorToFirstImageInDataTree(mitk::DataTree::Pointer dataTree)
-{
- mitk::DataTreePreOrderIterator dataTreeIterator( dataTree );
-
- if ( dataTree.IsNull() )
- {
- std::cout << "iterator to data tree is NULL. I cannot work without datatree !!" << std::endl;
- return NULL;
- }
-
- return GetIteratorToFirstImage(&dataTreeIterator);
-}
-
-mitk::Image* CommonFunctionality::GetFirstImageInDataTree(mitk::DataTree::Pointer dataTree)
-{
- mitk::DataTreeIteratorClone it = GetIteratorToFirstImageInDataTree(dataTree);
- if(it.IsNull())
- return NULL;
- return static_cast<mitk::Image*>(it->Get()->GetData());
-}
-mitk::DataTreeNode* CommonFunctionality::GetFirstNodeByProperty( mitk::DataTreeIteratorClone it, std::string propertyKey, mitk::BaseProperty* property )
-{
- mitk::DataTreeIteratorClone pos = dynamic_cast<mitk::DataTree*>( it->GetTree() )->GetNext( propertyKey.c_str(), property, it.GetPointer() );
- if ( ! pos->IsAtEnd() )
- {
- return pos->Get();
- }
- else
- {
- return NULL;
- }
-
-}
-mitk::BaseData* CommonFunctionality::GetFirstDataByProperty( mitk::DataTreeIteratorClone it, std::string propertyKey, mitk::BaseProperty* property )
-{
- mitk::DataTreeNode* node = GetFirstNodeByProperty( it, propertyKey, property );
- if ( node == NULL )
- {
- return NULL;
- }
- else
- {
- return node->GetData();
- }
-}
-
-mitk::DataTreeNode* CommonFunctionality::GetNodeForData( mitk::DataTreeIteratorClone it, mitk::BaseData* data )
-{
- if ( it.GetPointer() == NULL )
- {
- return NULL;
- }
-
- mitk::DataTreeIteratorClone iteratorClone = it;
- while ( !iteratorClone->IsAtEnd() )
- {
- mitk::DataTreeNode::Pointer node = iteratorClone->Get();
- if ( node.IsNotNull() )
- {
- if ( node->GetData() == data )
- return node.GetPointer();
- }
- ++iteratorClone;
- }
- return NULL;
-}
-
-CommonFunctionality::DataTreeIteratorVector CommonFunctionality::FilterNodes(mitk::DataTreeIteratorClone it, bool (* FilterFunction)(mitk::DataTreeNode*))
-{
-
- DataTreeIteratorVector result;
-
- if ( it.GetPointer() != NULL )
- {
-
- mitk::DataTreeIteratorClone iteratorClone = it;
- while ( !iteratorClone->IsAtEnd() )
- {
- mitk::DataTreeNode::Pointer node = iteratorClone->Get();
- if ( (FilterFunction == NULL) || FilterFunction( node ) )
- {
- result.push_back(iteratorClone);
- }
- ++iteratorClone;
- }
- }
- return result;
-
-}
-
#include "mitkSurfaceVtkWriter.h"
#include <vtkSTLWriter.h>
#include <vtkPolyDataWriter.h>
Index: Modules/QmitkExt/QmitkApplicationBase/QmitkCommonFunctionality.h
===================================================================
--- Modules/QmitkExt/QmitkApplicationBase/QmitkCommonFunctionality.h (revision 21264)
+++ Modules/QmitkExt/QmitkApplicationBase/QmitkCommonFunctionality.h (working copy)
@@ -39,7 +39,6 @@
#include <mitkDataTreeNode.h>
#include <mitkDataTreeNodeFactory.h>
#include <mitkImageCast.h>
-#include <mitkDataTree.h>
#include <mitkSurface.h>
#include "itkImage.h"
#include <mitkFileWriterWithInformation.h>
@@ -68,7 +67,6 @@
namespace CommonFunctionality
{
- typedef std::vector<mitk::DataTreeIteratorClone> DataTreeIteratorVector;
typedef std::vector<mitk::DataTreeNode*> DataTreeNodeVector;
/** \brief compute min and max
*/
@@ -118,94 +116,6 @@
}
}
-
- /**
- * \brief converts the itk image to mitk image, creates a datatreenode and adds the node to
- * the referenced datatree
- */
- template < typename TImageType >
- static mitk::DataTreeNode::Pointer
- AddItkImageToDataTree(typename TImageType::Pointer itkImage, mitk::DataTreeIteratorBase* iterator, std::string str)
- {
- mitk::DataTreeIteratorClone it=iterator;
-
- mitk::Image::Pointer image = mitk::Image::New();
- image->InitializeByItk(itkImage.GetPointer());
- image->SetVolume(itkImage->GetBufferPointer());
-
- mitk::DataTreeNode::Pointer node = NULL;
- mitk::DataTreeIteratorClone subTree = ((mitk::DataTree *) it->GetTree())->GetNext("name", mitk::StringProperty::New( str.c_str() ));
-
- if (subTree->IsAtEnd() || subTree->Get().IsNull() )
- {
- node=mitk::DataTreeNode::New();
- node->SetData(image);
- mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New(str.c_str());
- node->SetProperty("name",nameProp);
- it->Add(node);
- }
- else
- {
- node = subTree->Get();
- node->SetData(image);
- }
- return node;
- }
-
-
-
- /**
- * \brief converts the itk image to mitk image, creates a datatreenode and adds the node to
- * the referenced datatree
- */
- template < typename TMeshType >
- static void AddItkMeshToDataTree(typename TMeshType::Pointer itkMesh, mitk::DataTreeIteratorBase* iterator, std::string str)
- {
- mitk::DataTreeIteratorClone it=iterator;
-
- mitk::DataTreeNode::Pointer node = NULL;
- mitk::DataTreeIteratorClone subTree = ((mitk::DataTree *) it->GetTree())->GetNext("name", mitk::StringProperty::New( str.c_str() ));
-
- if (subTree->IsAtEnd() || subTree->Get() == NULL )
- {
- node=mitk::DataTreeNode::New();
- mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New(str.c_str());
- node->SetProperty("name",nameProp);
- it->Add(node);
- }
- else
- {
- node = subTree->Get();
- }
-
- mitk::Surface::Pointer surface = mitk::Surface::New();
- // vtkPolyData* polys = MeshUtil<TMeshType>::MeshToPolyData( itkMesh );
- /**
- * @todo include Algorithms/itkMeshDeformation into Framework module so the upper line can be used
- * and the conversion works correctly
- */
- vtkPolyData* polys = vtkPolyData::New();
- surface->SetVtkPolyData(polys);
- node->SetData( surface );
- node->SetProperty("layer", mitk::IntProperty::New(1));
- node->SetVisibility(true,NULL);
-
- float meshColor[3] = {.5f,.5f,.5f};
- node->SetColor(meshColor, NULL );
- node->SetVisibility(true, NULL );
- }
- /**
- * \brief converts the itk image to mitk image, creates a datatreenode and adds the node to
- * the referenced datatree
- */
- QmitkExt_EXPORT mitk::DataTreeNode::Pointer AddVtkMeshToDataTree(vtkPolyData* polys, mitk::DataTreeIteratorBase* iterator, std::string str);
-
- /**
- * \brief creates a datatreenode for th PIC image and adds the node to
- * the referenced datatree
- */
- QmitkExt_EXPORT mitk::DataTreeNode::Pointer AddPicImageToDataTree(mitkIpPicDescriptor * pic, mitk::DataTreeIteratorBase* iterator, std::string str);
-
QmitkExt_EXPORT mitk::DataTreeNode::Pointer FileOpen( const QString& fileName);
QmitkExt_EXPORT mitk::DataTreeNode::Pointer FileOpen( const char *fileName );
QmitkExt_EXPORT mitk::DataTreeNode::Pointer FileOpenSpecific( const QString& fileExtensions);
@@ -238,11 +148,6 @@
QmitkExt_EXPORT void SaveBaseData( mitk::BaseData* data, const char* name = NULL );
- QmitkExt_EXPORT mitk::DataTreeIteratorBase* GetIteratorToFirstImage(mitk::DataTreeIteratorBase* dataTreeIterator);
-
- QmitkExt_EXPORT mitk::DataTreeIteratorBase* GetIteratorToFirstImageInDataTree(mitk::DataTree::Pointer dataTree);
- QmitkExt_EXPORT mitk::Image* GetFirstImageInDataTree(mitk::DataTree::Pointer dataTree);
-
/**
* Checks if the filename is valid for writing. This includes checking whether the file already exists.
* If so, the user is asked whether he wants to overwrite the existing file. In addition, the writing permission is checked.
@@ -250,236 +155,5 @@
* @returns true if the filename is valid for writing
*/
QmitkExt_EXPORT bool IsFilenameValidForWriting(const char* aFileName);
-
-
- /**
- * Searches for the first node in the data tree, which holds a given type.
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @returns the first node in the data tree which is of the type given by
- * the template parameter T, or NULL otherwise.
- */
- template <typename T>
- static mitk::DataTreeNode* GetFirstNodeByType( mitk::DataTreeIteratorClone it )
- {
- if ( it.GetPointer() == NULL )
- {
- return NULL;
- }
-
- mitk::DataTreeIteratorClone iteratorClone = it;
- while ( !iteratorClone->IsAtEnd() )
- {
- mitk::DataTreeNode::Pointer node = iteratorClone->Get();
- if ( node.IsNull() )
- {
- itkGenericOutputMacro("Iterator points to a node that is NULL!");
- }
- else if ( node->GetData() != NULL )
- {
- // access the original data
- T* data = dynamic_cast<T*>( node->GetData() );
-
- // enquiry whether img is NULL
- if ( data != NULL )
- {
- return node.GetPointer();
- }
- }
- ++iteratorClone;
- }
- return NULL;
- }
-
- /**
- * Searches for the data object in the data tree, which matches a given type.
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @returns the first data oobject in the data tree which is of the type given by
- * the template parameter T, or NULL otherwise.
- */
- template <typename T>
- static T* GetFirstDataByType( mitk::DataTreeIteratorClone it )
- {
- mitk::DataTreeNode* node = GetFirstNodeByType<T>(it);
- if ( node == NULL )
- {
- return NULL;
- }
- else
- {
- return dynamic_cast<T*>( node->GetData() );
- }
- }
-
- /**
- * Searches for the first node in the data tree, which holds a given type
- * and matches a given property key and value. This may be used to search
- * e.g. for a node holding an image with a given name in the data tree.
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @param propertyKey the name of the property we want to compare with
- * @param property the value of the property we want to search for in the data tree
- * @returns the first node in the data tree which is of the type given by
- * the template parameter T, and matches propertyKey and property, or NULL otherwise.
- */
- template <typename T>
- static mitk::DataTreeNode* GetFirstNodeByTypeAndProperty( mitk::DataTreeIteratorClone it, std::string propertyKey, mitk::BaseProperty* property )
- {
- if ( it.GetPointer() == NULL )
- {
- return NULL;
- }
-
- mitk::DataTreeIteratorClone iteratorClone = it;
- while ( !iteratorClone->IsAtEnd() )
- {
- mitk::DataTreeNode::Pointer node = iteratorClone->Get();
- if ( node.IsNull() )
- {
- itkGenericOutputMacro("Iterator points to a node that is NULL!");
- }
- else if ( node->GetData() != NULL )
- {
- // access the original data
- T* data = dynamic_cast<T*>( node->GetData() );
-
- // enquiry whether img is NULL
- if ( data != NULL )
- {
- // check, if the data has the given property...
- mitk::BaseProperty::Pointer tmp = node->GetPropertyList()->GetProperty( propertyKey.c_str() );
- if ( (*property) == *(tmp) )
- return node.GetPointer();
- }
- }
- ++iteratorClone;
- }
- return NULL;
- }
-
- /**
- * Searches for the first data object in the data tree, which is of a given type
- * and whose node matches a given property key and value. This may be used to search
- * e.g. for an image with a given name in the data tree.
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @param propertyKey the name of the property we want to compare with
- * @param property the value of the property we want to search for in the data tree
- * @returns the first data object in the data tree which is of the type given by
- * the template parameter T, and matches propertyKey and property, or NULL otherwise.
- */
- template <typename T>
- static T* GetFirstDataByTypeAndProperty( mitk::DataTreeIteratorClone it, std::string propertyKey, mitk::BaseProperty* property )
- {
- mitk::DataTreeNode* node = GetFirstNodeByTypeAndProperty<T>( it, propertyKey, property );
- if ( node == NULL )
- {
- return NULL;
- }
- else
- {
- return dynamic_cast<T*>( node->GetData() );
- }
- }
-
- /**
- * Searches for the first node in the data tree, which matches a given
- * property key and value. This may be used to search e.g. for a node holding
- * a data object with a given name in the data tree.
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @param propertyKey the name of the property we want to compare with
- * @param property the value of the property we want to search for in the data tree
- * @returns the first node in the data tree which matches propertyKey and property, or NULL otherwise.
- */
- QmitkExt_EXPORT mitk::DataTreeNode* GetFirstNodeByProperty( mitk::DataTreeIteratorClone it, std::string propertyKey, mitk::BaseProperty* property );
-
- /**
- * Searches for the first data object in the data tree, whose node matches a given
- * property key and value. This may be used to search e.g. for a node holding
- * a data object with a given name in the data tree.
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @param propertyKey the name of the property we want to compare with
- * @param property the value of the property we want to search for in the data tree
- * @returns the first data object in the data tree whose node matches propertyKey and property, or NULL otherwise.
- */
- QmitkExt_EXPORT mitk::BaseData* GetFirstDataByProperty( mitk::DataTreeIteratorClone it, std::string propertyKey, mitk::BaseProperty* property );
- /**
- * Searches for the node in the data tree which holds a given mitk::BaseData
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @param data the data object, for which the node in the tree should be searched.
- * @returns the node holding data, or NULL otherwise.
- */
- QmitkExt_EXPORT mitk::DataTreeNode* GetNodeForData( mitk::DataTreeIteratorClone it, mitk::BaseData* data );
-
- template <typename BaseDataType>
- static DataTreeNodeVector GetNodesForDataType(mitk::DataTreeIteratorClone it)
- {
- DataTreeNodeVector result;
-
- if ( it.GetPointer() != NULL )
- {
-
- mitk::DataTreeIteratorClone iteratorClone = it->Clone();
- while ( !iteratorClone->IsAtEnd() )
- {
- mitk::DataTreeNode::Pointer node = iteratorClone->Get();
- if ( dynamic_cast<BaseDataType*>( node->GetData() ) )
- {
- result.push_back(node);
- }
- ++iteratorClone;
- }
- }
- return result;
-
- }
-
- /**
- * Counts the number of nodes of a given type in a data tree. This
- * can for example be used to calculate the number of point sets in
- * the data tree.
- * @param it an iterator pointing to the position in the data tree, where
- * the search should start
- * @returns the number of nodes holding a data element of the given template
- * parameter
- */
- template <typename T>
- static unsigned int GetNumberOfNodesOfType( mitk::DataTreeIteratorClone it )
- {
- if ( it.GetPointer() == NULL )
- {
- return 0;
- }
- unsigned int numberOfNodes = 0;
- mitk::DataTreeIteratorClone iteratorClone = it;
- while ( !iteratorClone->IsAtEnd() )
- {
- mitk::DataTreeNode::Pointer node = iteratorClone->Get();
- if ( node.IsNotNull() )
- {
- if ( node->GetData() != NULL )
- {
- // access the original data
- T* data = dynamic_cast<T*>( node->GetData() );
-
- // enquiry whether data is NULL or not, that is
- // if the data is of type T
- if ( data != NULL )
- {
- numberOfNodes++;
- }
- }
- }
- ++iteratorClone;
- }
- return numberOfNodes;
- }
-
-
- QmitkExt_EXPORT DataTreeIteratorVector FilterNodes(mitk::DataTreeIteratorClone it, bool (* FilterFunction)(mitk::DataTreeNode*));
};
#endif // _CommonFunctionality__h_
Index: Modules/QmitkExt/QmitkFunctionalityComponentContainerControls.ui
===================================================================
--- Modules/QmitkExt/QmitkFunctionalityComponentContainerControls.ui (revision 21264)
+++ Modules/QmitkExt/QmitkFunctionalityComponentContainerControls.ui (working copy)
@@ -76,7 +76,6 @@
</customwidgets>
<includes>
<include location="local" >QmitkExtExports.h</include>
- <include location="local" >mitkDataTree.h</include>
</includes>
<resources/>
<connections/>
Index: Modules/FLApplications/MITKFLExample/MITKFltkExample.cpp
===================================================================
--- Modules/FLApplications/MITKFLExample/MITKFltkExample.cpp (revision 21264)
+++ Modules/FLApplications/MITKFLExample/MITKFltkExample.cpp (working copy)
@@ -8,7 +8,7 @@
// #include "mitkIpPic.h"
#include "mitkPicFileReader.h"
-#include "mitkDataTree.h"
+
#include "mitkStringProperty.h"
#include "mitkLevelWindowProperty.h"
#include "mitkSliceNavigationController.h"
Index: Modules/FLApplications/MITKFLExample/FLmitkComfortWidget.cpp
===================================================================
--- Modules/FLApplications/MITKFLExample/FLmitkComfortWidget.cpp (revision 21264)
+++ Modules/FLApplications/MITKFLExample/FLmitkComfortWidget.cpp (working copy)
@@ -1,7 +1,7 @@
#include <Fl/Fl.h>
#include "FLmitkComfortWidget.h"
//#include "mitkLevelWindow.h"
-// #include "mitkDataTree.h"
+//
FLmitkComfortWidget::FLmitkComfortWidget(int x,int y,int w,int h,const char* label) : FLmitkRenderWindow(x,y,w,h,label) {
}
Index: Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationViewControls.ui
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationViewControls.ui (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationViewControls.ui (working copy)
@@ -610,7 +610,6 @@
<include location="local">mitkEventMapper.h</include>
<include location="local">mitkInteractionConst.h</include>
<include location="local">mitkBaseData.h</include>
- <include location="global">mitkDataTree.h</include>
</includes>
<resources>
<include location="../../resources/QmitkPointBasedRegistrationView.qrc"/>
Index: Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationViewControls.ui
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationViewControls.ui (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationViewControls.ui (working copy)
@@ -861,7 +861,6 @@
</customwidgets>
<includes>
<include location="local">mitkDataTreeNode.h</include>
- <include location="local">mitkDataTree.h</include>
<include location="local">mitkBaseData.h</include>
</includes>
<resources>
Index: Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationViewControls.ui
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationViewControls.ui (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationViewControls.ui (working copy)
@@ -405,7 +405,6 @@
</customwidgets>
<includes>
<include location="local">mitkDataTreeNode.h</include>
- <include location="local">mitkDataTree.h</include>
<include location="local">mitkBaseData.h</include>
</includes>
<resources>
Index: Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp (working copy)
@@ -19,6 +19,7 @@
#include "mitkDataTreeNodeObject.h"
#include "mitkProperties.h"
#include "mitkSegTool2D.h"
+#include "mitkGlobalInteraction.h"
#include "QmitkStdMultiWidget.h"
#include "QmitkNewSegmentationDialog.h"
@@ -39,11 +40,14 @@
,m_MultiWidget(NULL)
,m_JustSentASelection(false)
,m_PostProcessing(NULL)
+,m_RenderingManagerObserverTag(0)
{
}
QmitkSegmentationView::~QmitkSegmentationView()
{
+ mitk::RenderingManager::GetInstance()->RemoveObserver( m_RenderingManagerObserverTag );
+
berry::ISelectionService* s = GetSite()->GetWorkbenchWindow()->GetSelectionService();
if(s)
{
@@ -56,7 +60,6 @@
.RemoveListener(berry::MessageDelegate1<QmitkSegmentationView, const berry::IBerryPreferences*>(this, &QmitkSegmentationView::PreferencesChanged));
}
-
delete m_PostProcessing;
delete m_Controls;
}
@@ -121,9 +124,42 @@
void QmitkSegmentationView::SetMultiWidget(QmitkStdMultiWidget* multiWidget)
{
- // save the actual multiwidget as the working widget
+ if (m_MultiWidget)
+ {
+ mitk::SlicesCoordinator* coordinator = m_MultiWidget->GetSlicesRotator();
+ if (coordinator)
+ {
+ coordinator->RemoveObserver( m_SlicesRotationObserverTag1 );
+ }
+ coordinator = m_MultiWidget->GetSlicesSwiveller();
+ if (coordinator)
+ {
+ coordinator->RemoveObserver( m_SlicesRotationObserverTag2 );
+ }
+ }
+
+ // save the current multiwidget as the working widget
m_MultiWidget = multiWidget;
+ if (m_MultiWidget)
+ {
+ mitk::SlicesCoordinator* coordinator = m_MultiWidget->GetSlicesRotator();
+ if (coordinator)
+ {
+ itk::ReceptorMemberCommand<QmitkSegmentationView>::Pointer command2 = itk::ReceptorMemberCommand<QmitkSegmentationView>::New();
+ command2->SetCallbackFunction( this, &QmitkSegmentationView::SliceRotation );
+ m_SlicesRotationObserverTag1 = coordinator->AddObserver( mitk::SliceRotationEvent(), command2 );
+ }
+
+ coordinator = m_MultiWidget->GetSlicesSwiveller();
+ if (coordinator)
+ {
+ itk::ReceptorMemberCommand<QmitkSegmentationView>::Pointer command2 = itk::ReceptorMemberCommand<QmitkSegmentationView>::New();
+ command2->SetCallbackFunction( this, &QmitkSegmentationView::SliceRotation );
+ m_SlicesRotationObserverTag2 = coordinator->AddObserver( mitk::SliceRotationEvent(), command2 );
+ }
+ }
+
if (m_Parent)
{
m_Parent->setEnabled(m_MultiWidget);
@@ -143,6 +179,17 @@
ForceDisplayPreferencesUponAllImages();
}
+void QmitkSegmentationView::RenderingManagerReinitialized(const itk::EventObject&)
+{
+ CheckImageAlignment();
+}
+
+void QmitkSegmentationView::SliceRotation(const itk::EventObject&)
+{
+ CheckImageAlignment();
+}
+
+
// protected slots
void QmitkSegmentationView::CreateNewSegmentation()
@@ -654,7 +701,12 @@
// call preferences changed for initialization
// changes GUI according to current data manager selection (because it might have changed before QmitkSegmentationView came into being)
this->PreferencesChanged(m_SegmentationPreferencesNode.GetPointer());
+
+ itk::ReceptorMemberCommand<QmitkSegmentationView>::Pointer command1 = itk::ReceptorMemberCommand<QmitkSegmentationView>::New();
+ command1->SetCallbackFunction( this, &QmitkSegmentationView::RenderingManagerReinitialized );
+ m_RenderingManagerObserverTag = mitk::RenderingManager::GetInstance()->AddObserver( mitk::RenderingManagerViewsInitializedEvent(), command1 );
}
-
+
+
// ATTENTION some methods for handling the known list of (organ names, colors) are defined in QmitkSegmentationOrganNamesHandling.cpp
Index: Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h (working copy)
@@ -60,6 +60,12 @@
// BlueBerry's notification about preference changes (e.g. from a dialog)
void PreferencesChanged(const berry::IBerryPreferences*);
+ // observer to mitk::RenderingManager's RenderingManagerViewsInitializedEvent event
+ void RenderingManagerReinitialized(const itk::EventObject&);
+
+ // observer to mitk::SliceController's SliceRotation event
+ void SliceRotation(const itk::EventObject&);
+
protected slots:
// reaction to the button "New segmentation"
@@ -138,6 +144,10 @@
bool m_JustSentASelection;
QmitkSegmentationPostProcessing* m_PostProcessing;
+
+ unsigned long m_RenderingManagerObserverTag;
+ unsigned long m_SlicesRotationObserverTag1;
+ unsigned long m_SlicesRotationObserverTag2;
};
#endif /*QMITKsegmentationVIEW_H_*/
Index: Modules/Bundles/org.mitk.gui.qt.datamanager/src/internal/QmitkDataManagerControls.ui
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.datamanager/src/internal/QmitkDataManagerControls.ui (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.datamanager/src/internal/QmitkDataManagerControls.ui (working copy)
@@ -372,7 +372,6 @@
</image>
</images>
<includes>
- <include location="global" >mitkDataTree.h</include>
<include location="local" >QmitkDataTreeViewItem.h</include>
<include location="global" >map</include>
<include location="local" >mitkBaseProperty.h</include>
Index: Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionViewControls.ui
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionViewControls.ui (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionViewControls.ui (working copy)
@@ -110,7 +110,6 @@
</customwidgets>
<includes>
<include location="global">mitkDataTreeNode.h</include>
- <include location="global">mitkDataTree.h</include>
<include location="global">mitkPointSet.h</include>
<include location="global">mitkPointSetInteractor.h</include>
</includes>
Index: Modules/Bundles/org.mitk.gui.qt.volumetry/src/internal/QmitkVolumetryView.cpp
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.volumetry/src/internal/QmitkVolumetryView.cpp (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.volumetry/src/internal/QmitkVolumetryView.cpp (working copy)
@@ -31,7 +31,6 @@
#include "itkImage.h"
#include <limits>
#include "mitkDataTreeNode.h"
-#include "mitkDataTreeHelper.h"
#include "mitkRenderingManager.h"
#include "mitkVolumeCalculator.h"
Index: Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperControls.ui
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperControls.ui (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperControls.ui (working copy)
@@ -351,7 +351,6 @@
</customwidget>
</customwidgets>
<includes>
- <include location="local" >mitkDataTree.h</include>
<include location="local" >QmitkDataStorageComboBox.h</include>
</includes>
<resources>
Index: Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.cpp
===================================================================
--- Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.cpp (revision 21264)
+++ Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.cpp (working copy)
@@ -32,7 +32,6 @@
#include <mitkGlobalInteraction.h>
#include "mitkUndoController.h"
#include "mitkCuboidObjectCutter.h"
-#include "mitkDataTreeHelper.h"
#include "mitkImageAccessByItk.h"
#include "mitkITKImageImport.h"
#include "mitkIDataStorageService.h"

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
435
Default Alt Text
patch-datatree.patch (51 KB)

Event Timeline

Patch with changes to remove DataTree