diff --git a/Core/Code/files.cmake b/Core/Code/files.cmake
index 80d17da680..73c72df125 100644
--- a/Core/Code/files.cmake
+++ b/Core/Code/files.cmake
@@ -1,420 +1,421 @@
set(H_FILES
Algorithms/itkImportMitkImageContainer.h
Algorithms/itkImportMitkImageContainer.txx
Algorithms/itkMITKScalarImageToHistogramGenerator.h
Algorithms/itkMITKScalarImageToHistogramGenerator.txx
Algorithms/mitkInstantiateAccessFunctions.h
Algorithms/mitkPixelTypeList.h
Algorithms/mitkPPArithmeticDec.h
Algorithms/mitkPPArgCount.h
Algorithms/mitkPPCat.h
Algorithms/mitkPPConfig.h
Algorithms/mitkPPControlExprIIf.h
Algorithms/mitkPPControlIf.h
Algorithms/mitkPPControlIIf.h
Algorithms/mitkPPDebugError.h
Algorithms/mitkPPDetailAutoRec.h
Algorithms/mitkPPDetailDMCAutoRec.h
Algorithms/mitkPPExpand.h
Algorithms/mitkPPFacilitiesEmpty.h
Algorithms/mitkPPFacilitiesExpand.h
Algorithms/mitkPPLogicalBool.h
Algorithms/mitkPPRepetitionDetailDMCFor.h
Algorithms/mitkPPRepetitionDetailEDGFor.h
Algorithms/mitkPPRepetitionDetailFor.h
Algorithms/mitkPPRepetitionDetailMSVCFor.h
Algorithms/mitkPPRepetitionFor.h
Algorithms/mitkPPSeqElem.h
Algorithms/mitkPPSeqForEach.h
Algorithms/mitkPPSeqForEachProduct.h
Algorithms/mitkPPSeq.h
Algorithms/mitkPPSeqEnum.h
Algorithms/mitkPPSeqSize.h
Algorithms/mitkPPSeqToTuple.h
Algorithms/mitkPPStringize.h
Algorithms/mitkPPTupleEat.h
Algorithms/mitkPPTupleElem.h
Algorithms/mitkPPTupleRem.h
Algorithms/mitkClippedSurfaceBoundsCalculator.h
Algorithms/mitkExtractSliceFilter.h
Algorithms/mitkConvert2Dto3DImageFilter.h
Algorithms/mitkPlaneClipping.h
Common/mitkCommon.h
Common/mitkExceptionMacro.h
Common/mitkGetClassHierarchy.h
DataManagement/mitkProportionalTimeGeometry.h
DataManagement/mitkTimeGeometry.h
DataManagement/mitkImageAccessByItk.h
DataManagement/mitkImageCast.h
DataManagement/mitkImagePixelAccessor.h
DataManagement/mitkImagePixelReadAccessor.h
DataManagement/mitkImagePixelWriteAccessor.h
DataManagement/mitkImageReadAccessor.h
DataManagement/mitkImageWriteAccessor.h
DataManagement/mitkITKImageImport.h
DataManagement/mitkITKImageImport.txx
DataManagement/mitkImageToItk.h
DataManagement/mitkShaderProperty.h
DataManagement/mitkImageToItk.txx
DataManagement/mitkTimeSlicedGeometry.h # Deprecated, empty for compatibility reasons.
DataManagement/mitkPropertyListReplacedObserver.cpp
DataManagement/mitkVectorDeprecated.h
DataManagement/mitkArray.h
DataManagement/mitkQuaternion.h
DataManagement/mitkNumericTypes.h
DataManagement/mitkVector.h
DataManagement/mitkPoint.h
DataManagement/mitkMatrix.h
Interactions/mitkEventMapperAddOn.h
+ Interactions/mitkInteractionConst.h
Interfaces/mitkIDataNodeReader.h
Interfaces/mitkIFileWriter.h
Interfaces/mitkIFileWriter.cpp
Interfaces/mitkIFileReader.h
Interfaces/mitkIFileReader.cpp
Rendering/mitkLocalStorageHandler.h
Rendering/Colortables/HotIron.h
Rendering/Colortables/Jet.h
Rendering/Colortables/PET20.h
Rendering/Colortables/PETColor.h
IO/mitkPixelTypeTraits.h
)
set(CPP_FILES
Algorithms/mitkBaseDataSource.cpp
Algorithms/mitkCompareImageDataFilter.cpp
Algorithms/mitkMultiComponentImageDataComparisonFilter.cpp
Algorithms/mitkDataNodeSource.cpp
Algorithms/mitkPlaneGeometryDataToSurfaceFilter.cpp
Algorithms/mitkHistogramGenerator.cpp
Algorithms/mitkImageChannelSelector.cpp
Algorithms/mitkImageSliceSelector.cpp
Algorithms/mitkImageSource.cpp
Algorithms/mitkImageTimeSelector.cpp
Algorithms/mitkImageToImageFilter.cpp
Algorithms/mitkImageToSurfaceFilter.cpp
Algorithms/mitkPointSetSource.cpp
Algorithms/mitkPointSetToPointSetFilter.cpp
Algorithms/mitkRGBToRGBACastImageFilter.cpp
Algorithms/mitkSubImageSelector.cpp
Algorithms/mitkSurfaceSource.cpp
Algorithms/mitkSurfaceToImageFilter.cpp
Algorithms/mitkSurfaceToSurfaceFilter.cpp
Algorithms/mitkUIDGenerator.cpp
Algorithms/mitkVolumeCalculator.cpp
Algorithms/mitkClippedSurfaceBoundsCalculator.cpp
Algorithms/mitkExtractSliceFilter.cpp
Algorithms/mitkConvert2Dto3DImageFilter.cpp
Controllers/mitkBaseController.cpp
Controllers/mitkCallbackFromGUIThread.cpp
Controllers/mitkCameraController.cpp
Controllers/mitkCameraRotationController.cpp
Controllers/mitkFocusManager.cpp
Controllers/mitkLimitedLinearUndo.cpp
Controllers/mitkOperationEvent.cpp
Controllers/mitkPlanePositionManager.cpp
Controllers/mitkProgressBar.cpp
Controllers/mitkRenderingManager.cpp
Controllers/mitkSliceNavigationController.cpp
Controllers/mitkSlicesCoordinator.cpp
Controllers/mitkSlicesRotator.cpp
Controllers/mitkSlicesSwiveller.cpp
Controllers/mitkStatusBar.cpp
Controllers/mitkStepper.cpp
Controllers/mitkTestManager.cpp
Controllers/mitkUndoController.cpp
Controllers/mitkVerboseLimitedLinearUndo.cpp
Controllers/mitkVtkInteractorCameraController.cpp
Controllers/mitkVtkLayerController.cpp
DataManagement/mitkProportionalTimeGeometry.cpp
DataManagement/mitkTimeGeometry.cpp
DataManagement/mitkAbstractTransformGeometry.cpp
DataManagement/mitkAnnotationProperty.cpp
DataManagement/mitkApplicationCursor.cpp
DataManagement/mitkBaseData.cpp
DataManagement/mitkBaseGeometry.cpp
DataManagement/mitkBaseProperty.cpp
DataManagement/mitkClippingProperty.cpp
DataManagement/mitkChannelDescriptor.cpp
DataManagement/mitkColorProperty.cpp
DataManagement/mitkDataStorage.cpp
# DataManagement/mitkDataTree.cpp
DataManagement/mitkDataNode.cpp
# DataManagement/mitkDataTreeStorage.cpp
DataManagement/mitkDisplayGeometry.cpp
DataManagement/mitkEnumerationProperty.cpp
DataManagement/mitkPlaneGeometryData.cpp
DataManagement/mitkGeometry3D.cpp
DataManagement/mitkGeometryData.cpp
DataManagement/mitkGroupTagProperty.cpp
DataManagement/mitkImage.cpp
DataManagement/mitkImageAccessorBase.cpp
DataManagement/mitkImageCaster.cpp
DataManagement/mitkImageCastPart1.cpp
DataManagement/mitkImageCastPart2.cpp
DataManagement/mitkImageCastPart3.cpp
DataManagement/mitkImageCastPart4.cpp
DataManagement/mitkImageDataItem.cpp
DataManagement/mitkImageDescriptor.cpp
DataManagement/mitkImageReadAccessor.cpp
DataManagement/mitkImageStatisticsHolder.cpp
DataManagement/mitkImageVtkAccessor.cpp
DataManagement/mitkImageVtkReadAccessor.cpp
DataManagement/mitkImageVtkWriteAccessor.cpp
DataManagement/mitkImageWriteAccessor.cpp
DataManagement/mitkLandmarkProjectorBasedCurvedGeometry.cpp
DataManagement/mitkLandmarkProjector.cpp
DataManagement/mitkLine.cpp
DataManagement/mitkLevelWindow.cpp
DataManagement/mitkLevelWindowManager.cpp
DataManagement/mitkLevelWindowPreset.cpp
DataManagement/mitkLevelWindowProperty.cpp
DataManagement/mitkLookupTable.cpp
DataManagement/mitkLookupTableProperty.cpp
DataManagement/mitkLookupTables.cpp # specializations of GenericLookupTable
DataManagement/mitkMemoryUtilities.cpp
DataManagement/mitkModalityProperty.cpp
DataManagement/mitkModeOperation.cpp
DataManagement/mitkModifiedLock.cpp
DataManagement/mitkNodePredicateAnd.cpp
DataManagement/mitkNodePredicateBase.cpp
DataManagement/mitkNodePredicateCompositeBase.cpp
DataManagement/mitkNodePredicateData.cpp
DataManagement/mitkNodePredicateDataType.cpp
DataManagement/mitkNodePredicateDimension.cpp
DataManagement/mitkNodePredicateFirstLevel.cpp
DataManagement/mitkNodePredicateNot.cpp
DataManagement/mitkNodePredicateOr.cpp
DataManagement/mitkNodePredicateProperty.cpp
DataManagement/mitkNodePredicateSource.cpp
DataManagement/mitkPlaneOrientationProperty.cpp
DataManagement/mitkPlaneGeometry.cpp
DataManagement/mitkPlaneOperation.cpp
DataManagement/mitkPointOperation.cpp
DataManagement/mitkPointSet.cpp
DataManagement/mitkProperties.cpp
DataManagement/mitkPropertyList.cpp
DataManagement/mitkPropertyObserver.cpp
DataManagement/mitkRestorePlanePositionOperation.cpp
DataManagement/mitkApplyTransformMatrixOperation.cpp
DataManagement/mitkRotationOperation.cpp
DataManagement/mitkSlicedData.cpp
DataManagement/mitkSlicedGeometry3D.cpp
DataManagement/mitkSmartPointerProperty.cpp
DataManagement/mitkStandaloneDataStorage.cpp
DataManagement/mitkStateTransitionOperation.cpp
DataManagement/mitkStringProperty.cpp
DataManagement/mitkSurface.cpp
DataManagement/mitkSurfaceOperation.cpp
DataManagement/mitkThinPlateSplineCurvedGeometry.cpp
DataManagement/mitkTransferFunction.cpp
DataManagement/mitkTransferFunctionProperty.cpp
DataManagement/mitkTransferFunctionInitializer.cpp
DataManagement/mitkVector.cpp
DataManagement/mitkNumericConstants.cpp
DataManagement/mitkVtkInterpolationProperty.cpp
DataManagement/mitkVtkRepresentationProperty.cpp
DataManagement/mitkVtkResliceInterpolationProperty.cpp
DataManagement/mitkVtkScalarModeProperty.cpp
DataManagement/mitkVtkVolumeRenderingProperty.cpp
DataManagement/mitkWeakPointerProperty.cpp
DataManagement/mitkRenderingModeProperty.cpp
DataManagement/mitkResliceMethodProperty.cpp
DataManagement/mitkMaterial.cpp
DataManagement/mitkPointSetShapeProperty.cpp
DataManagement/mitkFloatPropertyExtension.cpp
DataManagement/mitkIntPropertyExtension.cpp
DataManagement/mitkPropertyExtension.cpp
DataManagement/mitkPropertyFilter.cpp
DataManagement/mitkPropertyAliases.cpp
DataManagement/mitkPropertyDescriptions.cpp
DataManagement/mitkPropertyExtensions.cpp
DataManagement/mitkPropertyFilters.cpp
DataManagement/mitkShaderProperty.cpp
Interactions/mitkAction.cpp
Interactions/mitkAffineInteractor.cpp
Interactions/mitkBindDispatcherInteractor.cpp
Interactions/mitkCoordinateSupplier.cpp
Interactions/mitkDataInteractor.cpp
Interactions/mitkDispatcher.cpp
Interactions/mitkDisplayCoordinateOperation.cpp
Interactions/mitkDisplayInteractor.cpp
Interactions/mitkDisplayPositionEvent.cpp
# Interactions/mitkDisplayVectorInteractorLevelWindow.cpp # legacy, prob even now unneeded
# Interactions/mitkDisplayVectorInteractorScroll.cpp
Interactions/mitkEvent.cpp
Interactions/mitkEventConfig.cpp
Interactions/mitkEventDescription.cpp
Interactions/mitkEventFactory.cpp
Interactions/mitkInteractionEventHandler.cpp
Interactions/mitkEventMapper.cpp
Interactions/mitkEventRecorder.cpp
Interactions/mitkEventStateMachine.cpp
Interactions/mitkGlobalInteraction.cpp
Interactions/mitkInteractor.cpp
Interactions/mitkInternalEvent.cpp
Interactions/mitkInteractionEvent.cpp
Interactions/mitkInteractionEventConst.cpp
Interactions/mitkInteractionPositionEvent.cpp
Interactions/mitkInteractionKeyEvent.cpp
Interactions/mitkMousePressEvent.cpp
Interactions/mitkMouseMoveEvent.cpp
Interactions/mitkMouseReleaseEvent.cpp
Interactions/mitkMouseWheelEvent.cpp
Interactions/mitkMouseDoubleClickEvent.cpp
Interactions/mitkMouseModeSwitcher.cpp
Interactions/mitkMouseMovePointSetInteractor.cpp
Interactions/mitkMoveBaseDataInteractor.cpp
Interactions/mitkNodeDepententPointSetInteractor.cpp
Interactions/mitkPointSetDataInteractor.cpp
Interactions/mitkPointSetInteractor.cpp
Interactions/mitkPositionEvent.cpp
Interactions/mitkPositionTracker.cpp
Interactions/mitkSinglePointDataInteractor.cpp
Interactions/mitkStateMachineAction.cpp
Interactions/mitkStateMachineCondition.cpp
Interactions/mitkStateMachineState.cpp
Interactions/mitkStateMachineTransition.cpp
Interactions/mitkState.cpp
Interactions/mitkStateMachineContainer.cpp
Interactions/mitkStateEvent.cpp
Interactions/mitkStateMachine.cpp
Interactions/mitkStateMachineFactory.cpp
Interactions/mitkTransition.cpp
Interactions/mitkWheelEvent.cpp
Interactions/mitkKeyEvent.cpp
Interactions/mitkVtkEventAdapter.cpp
Interactions/mitkVtkInteractorStyle.cxx
Interactions/mitkCrosshairPositionEvent.cpp
Interactions/mitkXML2EventParser.cpp
Interfaces/mitkIMimeTypeProvider.cpp
Interfaces/mitkInteractionEventObserver.cpp
Interfaces/mitkIShaderRepository.cpp
Interfaces/mitkIPropertyAliases.cpp
Interfaces/mitkIPropertyDescriptions.cpp
Interfaces/mitkIPropertyExtensions.cpp
Interfaces/mitkIPropertyFilters.cpp
Interfaces/mitkIPersistenceService.cpp
IO/mitkAbstractFileReader.cpp
IO/mitkAbstractFileWriter.cpp
IO/mitkAbstractFileIO.cpp
IO/mitkCustomMimeType.cpp
IO/mitkDicomSeriesReader.cpp
IO/mitkDicomSR_LoadDICOMScalar.cpp
IO/mitkDicomSR_LoadDICOMScalar4D.cpp
IO/mitkDicomSR_LoadDICOMRGBPixel.cpp
IO/mitkDicomSR_LoadDICOMRGBPixel4D.cpp
IO/mitkDicomSR_ImageBlockDescriptor.cpp
IO/mitkDicomSR_GantryTiltInformation.cpp
IO/mitkDicomSR_SliceGroupingResult.cpp
IO/mitkFileReader.cpp
IO/mitkFileReaderRegistry.cpp
IO/mitkFileReaderSelector.cpp
IO/mitkFileWriter.cpp
IO/mitkFileWriterRegistry.cpp
IO/mitkFileWriterSelector.cpp
IO/mitkIFileIO.cpp
# IO/mitkIpPicGet.c
IO/mitkImageGenerator.cpp
IO/mitkIOConstants.cpp
IO/mitkIOUtil.cpp
IO/mitkIOMimeTypes.cpp
IO/mitkItkLoggingAdapter.cpp
IO/mitkMimeType.cpp
IO/mitkOperation.cpp
# IO/mitkPicFileIOFactory.cpp
# IO/mitkPicFileReader.cpp
# IO/mitkPicFileWriter.cpp
# IO/mitkPicHelper.cpp
# IO/mitkPicVolumeTimeSeriesIOFactory.cpp
# IO/mitkPicVolumeTimeSeriesReader.cpp
IO/mitkPixelType.cpp
IO/mitkStandardFileLocations.cpp
IO/mitkVtkLoggingAdapter.cpp
IO/mitkLog.cpp
Rendering/mitkBaseRenderer.cpp
Rendering/mitkVtkMapper.cpp
Rendering/mitkRenderWindowFrame.cpp
Rendering/mitkPlaneGeometryDataMapper2D.cpp
Rendering/mitkPlaneGeometryDataVtkMapper3D.cpp
#Rendering/mitkGLMapper.cpp Moved to deprecated LegacyGL Module
Rendering/mitkGradientBackground.cpp
Rendering/mitkManufacturerLogo.cpp
Rendering/mitkMapper.cpp
Rendering/mitkPointSetVtkMapper2D.cpp
Rendering/mitkPointSetVtkMapper3D.cpp
Rendering/mitkSurfaceVtkMapper2D.cpp
#Rendering/mitkSurfaceGLMapper2D.cpp Moved to deprecated LegacyGL Module
Rendering/mitkSurfaceVtkMapper3D.cpp
Rendering/mitkVolumeDataVtkMapper3D.cpp
Rendering/mitkVtkPropRenderer.cpp
Rendering/mitkVtkWidgetRendering.cpp
Rendering/vtkMitkRectangleProp.cpp
Rendering/vtkMitkRenderProp.cpp
Rendering/mitkVtkEventProvider.cpp
Rendering/mitkRenderWindow.cpp
Rendering/mitkRenderWindowBase.cpp
Rendering/mitkImageVtkMapper2D.cpp
Rendering/vtkMitkThickSlicesFilter.cpp
Rendering/vtkMitkLevelWindowFilter.cpp
Rendering/vtkNeverTranslucentTexture.cpp
Rendering/mitkOverlay.cpp
Rendering/mitkVtkOverlay.cpp
Rendering/mitkVtkOverlay2D.cpp
Rendering/mitkVtkOverlay3D.cpp
Rendering/mitkOverlayManager.cpp
Rendering/mitkAbstractOverlayLayouter.cpp
Common/mitkException.cpp
Common/mitkCoreObjectFactoryBase.cpp
Common/mitkCoreObjectFactory.cpp
Common/mitkCoreServices.cpp
Internal/mitkCoreActivator.cpp
Internal/mitkDicomSeriesReaderService.cpp
Internal/mitkFileReaderWriterBase.cpp
Internal/mitkImageVtkLegacyIO.cpp
Internal/mitkImageVtkXmlIO.cpp
Internal/mitkItkImageIO.cpp
Internal/mitkLegacyFileReaderService.cpp
Internal/mitkLegacyFileWriterService.cpp
Internal/mitkMimeTypeProvider.cpp
Internal/mitkPointSetReaderService.cpp
Internal/mitkPointSetWriterService.cpp
Internal/mitkRawImageFileReader.cpp
Internal/mitkSurfaceStlIO.cpp
Internal/mitkSurfaceVtkIO.cpp
Internal/mitkSurfaceVtkLegacyIO.cpp
Internal/mitkSurfaceVtkXmlIO.cpp
)
set(RESOURCE_FILES
Interactions/globalConfig.xml
Interactions/DisplayInteraction.xml
Interactions/DisplayConfig.xml
Interactions/DisplayConfigPACS.xml
Interactions/DisplayConfigPACSPan.xml
Interactions/DisplayConfigPACSScroll.xml
Interactions/DisplayConfigPACSZoom.xml
Interactions/DisplayConfigPACSLevelWindow.xml
Interactions/DisplayConfigMITK.xml
Interactions/PointSet.xml
Interactions/Legacy/StateMachine.xml
Interactions/Legacy/DisplayConfigMITKTools.xml
Interactions/PointSetConfig.xml
mitkLevelWindowPresets.xml
)
diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineConfig.xml b/Modules/DataTypesExt/Resources/Interactions/AffineConfig.xml
new file mode 100644
index 0000000000..4040972f11
--- /dev/null
+++ b/Modules/DataTypesExt/Resources/Interactions/AffineConfig.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineInteraction3D.xml b/Modules/DataTypesExt/Resources/Interactions/AffineInteraction3D.xml
index 36d4e14d15..5b0ddf80b5 100644
--- a/Modules/DataTypesExt/Resources/Interactions/AffineInteraction3D.xml
+++ b/Modules/DataTypesExt/Resources/Interactions/AffineInteraction3D.xml
@@ -1,72 +1,64 @@
-
+
-
+
-
+
-
-
+
+
+
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
-
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineDeformationConfig.xml b/Modules/DataTypesExt/Resources/Interactions/ClippingPlaneDeformationConfig.xml
similarity index 100%
rename from Modules/DataTypesExt/Resources/Interactions/AffineDeformationConfig.xml
rename to Modules/DataTypesExt/Resources/Interactions/ClippingPlaneDeformationConfig.xml
diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineInteraction3D.xml b/Modules/DataTypesExt/Resources/Interactions/ClippingPlaneInteraction3D.xml
similarity index 100%
copy from Modules/DataTypesExt/Resources/Interactions/AffineInteraction3D.xml
copy to Modules/DataTypesExt/Resources/Interactions/ClippingPlaneInteraction3D.xml
diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineRotationConfig.xml b/Modules/DataTypesExt/Resources/Interactions/ClippingPlaneRotationConfig.xml
similarity index 100%
rename from Modules/DataTypesExt/Resources/Interactions/AffineRotationConfig.xml
rename to Modules/DataTypesExt/Resources/Interactions/ClippingPlaneRotationConfig.xml
diff --git a/Modules/DataTypesExt/Resources/Interactions/AffineTranslationConfig.xml b/Modules/DataTypesExt/Resources/Interactions/ClippingPlaneTranslationConfig.xml
similarity index 100%
rename from Modules/DataTypesExt/Resources/Interactions/AffineTranslationConfig.xml
rename to Modules/DataTypesExt/Resources/Interactions/ClippingPlaneTranslationConfig.xml
diff --git a/Modules/DataTypesExt/files.cmake b/Modules/DataTypesExt/files.cmake
index 770004c602..8333dbac6f 100644
--- a/Modules/DataTypesExt/files.cmake
+++ b/Modules/DataTypesExt/files.cmake
@@ -1,39 +1,43 @@
set(CPP_FILES
mitkAffineDataInteractor3D.cpp
mitkApplyDiffImageOperation.cpp
mitkBoundingObject.cpp
mitkBoundingObjectGroup.cpp
mitkCellOperation.cpp
+ mitkClippingPlaneInteractor3D.cpp
mitkColorSequence.cpp
mitkColorSequenceCycleH.cpp
mitkColorSequenceRainbow.cpp
mitkCompressedImageContainer.cpp
mitkCone.cpp
mitkCuboid.cpp
mitkCylinder.cpp
mitkDataStorageSelection.cpp
mitkEllipsoid.cpp
mitkGridRepresentationProperty.cpp
mitkGridVolumeMapperProperty.cpp
mitkLabeledImageLookupTable.cpp
mitkLabeledImageVolumeCalculator.cpp
mitkLineOperation.cpp
mitkLookupTableSource.cpp
mitkMesh.cpp
mitkMultiStepper.cpp
mitkOrganTypeProperty.cpp
mitkPlane.cpp
mitkSurfaceDeformationDataInteractor3D.cpp
mitkUnstructuredGrid.cpp
mitkUnstructuredGridSource.cpp
mitkVideoSource.cpp
Internal/mitkColorConversions.cpp
)
set(RESOURCE_FILES
Interactions/AffineInteraction3D.xml
- Interactions/AffineTranslationConfig.xml
- Interactions/AffineRotationConfig.xml
- Interactions/AffineDeformationConfig.xml
+ Interactions/AffineConfig.xml
+
+ Interactions/ClippingPlaneInteraction3D.xml
+ Interactions/ClippingPlaneTranslationConfig.xml
+ Interactions/ClippingPlaneRotationConfig.xml
+ Interactions/ClippingPlaneDeformationConfig.xml
)
diff --git a/Modules/DataTypesExt/mitkAffineDataInteractor3D.cpp b/Modules/DataTypesExt/mitkAffineDataInteractor3D.cpp
index 27958f7987..0b1206a7cf 100644
--- a/Modules/DataTypesExt/mitkAffineDataInteractor3D.cpp
+++ b/Modules/DataTypesExt/mitkAffineDataInteractor3D.cpp
@@ -1,356 +1,544 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "mitkAffineDataInteractor3D.h"
-#include "mitkInteractionConst.h"
-#include "mitkInteractionPositionEvent.h"
-#include "mitkRotationOperation.h"
-#include "mitkSurface.h"
+#include
+#include
+#include
+#include
#include
#include
#include
#include
#include
#include
+#include
+const char* translationStepSizePropertyName = "AffineDataInteractor3D.Translation Step Size";
+const char* selectedColorPropertyName = "AffineDataInteractor3D.Selected Color";
+const char* deselectedColorPropertyName = "AffineDataInteractor3D.Deselected Color";
+const char* priorPropertyName = "AffineDataInteractor3D.Prior Color";
+const char* rotationStepSizePropertyName = "AffineDataInteractor3D.Rotation Step Size";
+const char* scaleStepSizePropertyName = "AffineDataInteractor3D.Scale Step Size";
mitk::AffineDataInteractor3D::AffineDataInteractor3D()
{
- m_OriginalGeometry = Geometry3D::New();
+ m_OriginalGeometry = mitk::Geometry3D::New();
// Initialize vector arithmetic
m_ObjectNormal[0] = 0.0;
m_ObjectNormal[1] = 0.0;
m_ObjectNormal[2] = 1.0;
}
mitk::AffineDataInteractor3D::~AffineDataInteractor3D()
{
+ this->RestoreNodeProperties();
}
void mitk::AffineDataInteractor3D::ConnectActionsAndFunctions()
{
// **Conditions** that can be used in the state machine, to ensure that certain conditions are met, before actually executing an action
CONNECT_CONDITION("isOverObject", CheckOverObject);
// **Function** in the statmachine patterns also referred to as **Actions**
CONNECT_FUNCTION("selectObject",SelectObject);
CONNECT_FUNCTION("deselectObject",DeselectObject);
CONNECT_FUNCTION("initTranslate",InitTranslate);
CONNECT_FUNCTION("initRotate",InitRotate);
CONNECT_FUNCTION("translateObject",TranslateObject);
CONNECT_FUNCTION("rotateObject",RotateObject);
+
+ CONNECT_FUNCTION("translateUpKey",TranslateUpKey);
+ CONNECT_FUNCTION("translateDownKey",TranslateDownKey);
+ CONNECT_FUNCTION("translateLeftKey",TranslateLeftKey);
+ CONNECT_FUNCTION("translateRightKey",TranslateRightKey);
+ CONNECT_FUNCTION("translateUpModifierKey",TranslateUpModifierKey);
+ CONNECT_FUNCTION("translateDownModifierKey",TranslateDownModifierKey);
+
+ CONNECT_FUNCTION("scaleDownKey",ScaleDownKey);
+ CONNECT_FUNCTION("scaleUpKey",ScaleUpKey);
+
+ CONNECT_FUNCTION("rotateUpKey",RotateUpKey);
+ CONNECT_FUNCTION("rotateDownKey",RotateDownKey);
+ CONNECT_FUNCTION("rotateLeftKey",RotateLeftKey);
+ CONNECT_FUNCTION("rotateRightKey",RotateRightKey);
+ CONNECT_FUNCTION("rotateUpModifierKey",RotateUpModifierKey);
+ CONNECT_FUNCTION("rotateDownModifierKey",RotateDownModifierKey);
+}
+
+bool mitk::AffineDataInteractor3D::TranslateUpKey(StateMachineAction*, InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(translationStepSizePropertyName, stepSize);
+ mitk::Vector3D movementVector;
+ movementVector.Fill(0.0);
+ movementVector.SetElement(2, stepSize);
+ this->TranslateGeometry(movementVector, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::TranslateDownKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(translationStepSizePropertyName, stepSize);
+ mitk::Vector3D movementVector;
+ movementVector.Fill(0.0);
+ movementVector.SetElement(2, -stepSize);
+ this->TranslateGeometry(movementVector, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::TranslateLeftKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(translationStepSizePropertyName, stepSize);
+ mitk::Vector3D movementVector;
+ movementVector.Fill(0.0);
+ movementVector.SetElement(0, -stepSize);
+ this->TranslateGeometry(movementVector, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::TranslateRightKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(translationStepSizePropertyName, stepSize);
+ mitk::Vector3D movementVector;
+ movementVector.Fill(0.0);
+ movementVector.SetElement(0, stepSize);
+ this->TranslateGeometry(movementVector, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::TranslateUpModifierKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(translationStepSizePropertyName, stepSize);
+ mitk::Vector3D movementVector;
+ movementVector.Fill(0.0);
+ movementVector.SetElement(1, stepSize);
+ this->TranslateGeometry(movementVector, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::TranslateDownModifierKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(translationStepSizePropertyName, stepSize);
+ mitk::Vector3D movementVector;
+ movementVector.Fill(0.0);
+ movementVector.SetElement(1, -stepSize);
+ this->TranslateGeometry(movementVector, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::RotateUpKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(rotationStepSizePropertyName, stepSize);
+ this->RotateGeometry(-stepSize, 0, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::RotateDownKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(rotationStepSizePropertyName, stepSize);
+ this->RotateGeometry(stepSize, 0, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::RotateLeftKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(rotationStepSizePropertyName, stepSize);
+ this->RotateGeometry(-stepSize, 2, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::RotateRightKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(rotationStepSizePropertyName, stepSize);
+ this->RotateGeometry(stepSize, 2, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::RotateUpModifierKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(rotationStepSizePropertyName, stepSize);
+ this->RotateGeometry(stepSize, 1, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::RotateDownModifierKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 1.0f;
+ this->GetDataNode()->GetFloatProperty(rotationStepSizePropertyName, stepSize);
+ this->RotateGeometry(-stepSize, 1, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::ScaleUpKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 0.1f;
+ this->GetDataNode()->GetFloatProperty(scaleStepSizePropertyName, stepSize);
+ mitk::Point3D newScale;
+ newScale.Fill(stepSize);
+ this->ScaleGeometry(newScale, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+bool mitk::AffineDataInteractor3D::ScaleDownKey(mitk::StateMachineAction*, mitk::InteractionEvent* interactionEvent)
+{
+ float stepSize = 0.1f;
+ this->GetDataNode()->GetFloatProperty(scaleStepSizePropertyName, stepSize);
+ mitk::Point3D newScale;
+ newScale.Fill(-stepSize);
+ this->ScaleGeometry(newScale, this->GetUpdatedTimeGeometry(interactionEvent));
+ return true;
+}
+
+void mitk::AffineDataInteractor3D::ScaleGeometry(mitk::Point3D newScale, mitk::BaseGeometry* geometry)
+{
+ PointOperation* doOp = new mitk::PointOperation(OpSCALE, newScale, 0);
+ geometry->ExecuteOperation(doOp);
+
+ mitk::RenderingManager::GetInstance()->RequestUpdateAll();
+}
+
+void mitk::AffineDataInteractor3D::RotateGeometry(mitk::ScalarType angle, int rotationaxis, mitk::BaseGeometry* geometry)
+{
+ mitk::Vector3D rotationAxis = geometry->GetAxisVector(rotationaxis);
+ mitk::Point3D center = geometry->GetCenter();
+
+ mitk::RotationOperation* doOp = new mitk::RotationOperation(OpROTATE, center, rotationAxis, angle);
+
+ geometry->ExecuteOperation(doOp);
+ delete doOp;
+ mitk::RenderingManager::GetInstance()->RequestUpdateAll();
+}
+
+void mitk::AffineDataInteractor3D::TranslateGeometry(mitk::Vector3D translate, mitk::BaseGeometry* geometry)
+{
+ geometry->Translate(translate);
+ this->GetDataNode()->Modified();
+ mitk::RenderingManager::GetInstance()->RequestUpdateAll();
+}
+
+mitk::BaseGeometry* mitk::AffineDataInteractor3D::GetUpdatedTimeGeometry(mitk::InteractionEvent* interactionEvent)
+{
+ //Get the correct time geometry to support 3D + t
+ int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
+ BaseGeometry* geometry = this->GetDataNode()->GetData()->GetUpdatedTimeGeometry()->GetGeometryForTimeStep( timeStep );
+ if(geometry == NULL)
+ MITK_ERROR << "Geometry is NULL. Cannot modify it.";
+ return geometry;
}
void mitk::AffineDataInteractor3D::DataNodeChanged()
{
+ mitk::DataNode::Pointer newInputNode = this->GetDataNode();
+ //add default properties
+ newInputNode->AddProperty( selectedColorPropertyName, mitk::ColorProperty::New(0.0,1.0,0.0) );
+ newInputNode->AddProperty( deselectedColorPropertyName, mitk::ColorProperty::New(0.0,0.0,1.0) );
+ newInputNode->AddProperty( translationStepSizePropertyName, mitk::FloatProperty::New(1.0f) );
+ newInputNode->AddProperty( rotationStepSizePropertyName, mitk::FloatProperty::New(1.0f) );
+ newInputNode->AddProperty( scaleStepSizePropertyName, mitk::FloatProperty::New(0.1f) );
+
+ //save the previous color of the node, in order to restore it after the interactor is destroyed
+ mitk::ColorProperty::Pointer priorColor = dynamic_cast(newInputNode->GetProperty("color"));
+ if ( priorColor.IsNotNull() )
+ {
+ mitk::ColorProperty::Pointer tmpCopyOfPriorColor = mitk::ColorProperty::New();
+ tmpCopyOfPriorColor->SetColor( priorColor->GetColor() );
+ newInputNode->AddProperty( priorPropertyName, tmpCopyOfPriorColor );
+ }
+ newInputNode->SetColor(0.0,0.0,1.0);
+ mitk::RenderingManager::GetInstance()->RequestUpdateAll();
+}
+
+void mitk::AffineDataInteractor3D::SetDataNode(mitk::DataInteractor::NodeType node)
+{
+ this->RestoreNodeProperties(); //if there was another node set, restore it's color
+ DataInteractor::SetDataNode(node);
}
bool mitk::AffineDataInteractor3D::CheckOverObject(const InteractionEvent* interactionEvent)
{
const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
Point3D currentWorldPoint;
if(interactionEvent->GetSender()->PickObject(positionEvent->GetPointerPositionOnScreen(), currentWorldPoint) == this->GetDataNode().GetPointer())
return true;
return false;
}
bool mitk::AffineDataInteractor3D::SelectObject(StateMachineAction*, InteractionEvent* interactionEvent)
{
DataNode::Pointer node = this->GetDataNode();
if (node.IsNull())
return false;
- node->SetColor(1.0, 0.0, 0.0);
-
- // Colorize surface / wireframe dependend on distance from picked point
- this->ColorizeSurface(interactionEvent->GetSender(), 0.0);
-
+ mitk::ColorProperty::Pointer selectedColor = dynamic_cast(node->GetProperty(selectedColorPropertyName));
+ if ( selectedColor.IsNotNull() )
+ {
+ node->GetPropertyList()->SetProperty("color", selectedColor);
+ }
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
bool mitk::AffineDataInteractor3D::DeselectObject(StateMachineAction*, InteractionEvent* interactionEvent)
{
DataNode::Pointer node = this->GetDataNode();
if (node.IsNull())
return false;
- node->SetColor( 1.0, 1.0, 1.0 );
-
- // Colorize surface / wireframe as inactive
- this->ColorizeSurface(interactionEvent->GetSender(), -1.0);
+ mitk::ColorProperty::Pointer selectedColor = dynamic_cast(node->GetProperty(deselectedColorPropertyName));
+ if ( selectedColor.IsNotNull() )
+ {
+ node->GetPropertyList()->SetProperty("color", selectedColor);
+ }
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
bool mitk::AffineDataInteractor3D::InitTranslate(StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
m_InitialPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
m_InitialPickedDisplayPoint[0],
m_InitialPickedDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
m_InitialPickedWorldPoint );
// Get the timestep to also support 3D+t
int timeStep = 0;
if ((interactionEvent->GetSender()) != NULL)
timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// Make deep copy of current Geometry3D of the plane
this->GetDataNode()->GetData()->UpdateOutputInformation(); // make sure that the Geometry is up-to-date
m_OriginalGeometry = static_cast(this->GetDataNode()->GetData()->GetGeometry(timeStep)->Clone().GetPointer());
return true;
}
bool mitk::AffineDataInteractor3D::InitRotate(StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
- if(positionEvent == NULL)
- return false;
m_InitialPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
m_InitialPickedDisplayPoint[0],
m_InitialPickedDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
m_InitialPickedWorldPoint );
// Get the timestep to also support 3D+t
int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// Make deep copy of current Geometry3D of the plane
this->GetDataNode()->GetData()->UpdateOutputInformation(); // make sure that the Geometry is up-to-date
m_OriginalGeometry = static_cast(this->GetDataNode()->GetData()->GetGeometry(timeStep)->Clone().GetPointer());
return true;
}
bool mitk::AffineDataInteractor3D::TranslateObject (StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
double currentWorldPoint[4];
mitk::Point2D currentDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
currentDisplayPoint[0],
currentDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
currentWorldPoint);
Vector3D interactionMove;
interactionMove[0] = currentWorldPoint[0] - m_InitialPickedWorldPoint[0];
interactionMove[1] = currentWorldPoint[1] - m_InitialPickedWorldPoint[1];
interactionMove[2] = currentWorldPoint[2] - m_InitialPickedWorldPoint[2];
Point3D origin = m_OriginalGeometry->GetOrigin();
// Get the timestep to also support 3D+t
int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// If data is an mitk::Surface, extract it
Surface::Pointer surface = dynamic_cast< Surface* >(this->GetDataNode()->GetData());
vtkPolyData* polyData = NULL;
if (surface.IsNotNull())
{
polyData = surface->GetVtkPolyData( timeStep );
// Extract surface normal from surface (if existent, otherwise use default)
vtkPointData* pointData = polyData->GetPointData();
if (pointData != NULL)
{
vtkDataArray* normal = polyData->GetPointData()->GetVectors("planeNormal");
if (normal != NULL)
{
m_ObjectNormal[0] = normal->GetComponent( 0, 0 );
m_ObjectNormal[1] = normal->GetComponent( 0, 1 );
m_ObjectNormal[2] = normal->GetComponent( 0, 2 );
}
}
}
Vector3D transformedObjectNormal;
this->GetDataNode()->GetData()->GetGeometry( timeStep )->IndexToWorld(m_ObjectNormal, transformedObjectNormal);
this->GetDataNode()->GetData()->GetGeometry( timeStep )->SetOrigin(origin + transformedObjectNormal * (interactionMove * transformedObjectNormal));
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
bool mitk::AffineDataInteractor3D::RotateObject (StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
double currentWorldPoint[4];
Point2D currentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
currentPickedDisplayPoint[0],
currentPickedDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
currentWorldPoint);
vtkCamera* camera = NULL;
vtkRenderer* currentVtkRenderer = NULL;
if ((interactionEvent->GetSender()) != NULL)
{
vtkRenderWindow* renderWindow = interactionEvent->GetSender()->GetRenderWindow();
if (renderWindow != NULL)
{
vtkRenderWindowInteractor* renderWindowInteractor = renderWindow->GetInteractor();
if ( renderWindowInteractor != NULL )
{
currentVtkRenderer = renderWindowInteractor->GetInteractorStyle()->GetCurrentRenderer();
if (currentVtkRenderer != NULL)
camera = currentVtkRenderer->GetActiveCamera();
}
}
}
if ( camera )
{
double vpn[3];
camera->GetViewPlaneNormal( vpn );
Vector3D viewPlaneNormal;
viewPlaneNormal[0] = vpn[0];
viewPlaneNormal[1] = vpn[1];
viewPlaneNormal[2] = vpn[2];
Vector3D interactionMove;
interactionMove[0] = currentWorldPoint[0] - m_InitialPickedWorldPoint[0];
interactionMove[1] = currentWorldPoint[1] - m_InitialPickedWorldPoint[1];
interactionMove[2] = currentWorldPoint[2] - m_InitialPickedWorldPoint[2];
if (interactionMove[0] == 0 && interactionMove[1] == 0 && interactionMove[2] == 0)
return true;
Vector3D rotationAxis = itk::CrossProduct(viewPlaneNormal, interactionMove);
rotationAxis.Normalize();
int* size = currentVtkRenderer->GetSize();
double l2 =
(currentPickedDisplayPoint[0] - m_InitialPickedDisplayPoint[0]) *
(currentPickedDisplayPoint[0] - m_InitialPickedDisplayPoint[0]) +
(currentPickedDisplayPoint[1] - m_InitialPickedDisplayPoint[1]) *
(currentPickedDisplayPoint[1] - m_InitialPickedDisplayPoint[1]);
double rotationAngle = 360.0 * sqrt(l2 / (size[0] * size[0] + size[1] * size[1]));
// Use center of data bounding box as center of rotation
Point3D rotationCenter = m_OriginalGeometry->GetCenter();
int timeStep = 0;
if ((interactionEvent->GetSender()) != NULL)
timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// Reset current Geometry3D to original state (pre-interaction) and
// apply rotation
RotationOperation op( OpROTATE, rotationCenter, rotationAxis, rotationAngle );
Geometry3D::Pointer newGeometry = static_cast(m_OriginalGeometry->Clone().GetPointer());
newGeometry->ExecuteOperation( &op );
mitk::TimeGeometry::Pointer timeGeometry = this->GetDataNode()->GetData()->GetTimeGeometry();
if (timeGeometry.IsNotNull())
timeGeometry->SetTimeStepGeometry(newGeometry, timeStep);
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
else
return false;
}
-
-bool mitk::AffineDataInteractor3D::ColorizeSurface(BaseRenderer::Pointer renderer, double scalar)
+void mitk::AffineDataInteractor3D::RestoreNodeProperties()
{
- BaseData::Pointer data = this->GetDataNode()->GetData();
- if(data.IsNull())
- {
- MITK_ERROR << "AffineInteractor3D: No data object present!";
- return false;
- }
-
- // Get the timestep to also support 3D+t
- int timeStep = 0;
- if (renderer.IsNotNull())
- timeStep = renderer->GetTimeStep(data);
-
-
- // If data is an mitk::Surface, extract it
- Surface::Pointer surface = dynamic_cast< Surface* >(data.GetPointer());
- vtkPolyData* polyData = NULL;
- if (surface.IsNotNull())
- polyData = surface->GetVtkPolyData(timeStep);
-
- if (polyData == NULL)
- {
- MITK_ERROR << "AffineInteractor3D: No poly data present!";
- return false;
- }
-
- vtkPointData* pointData = polyData->GetPointData();
- if (pointData == NULL)
- {
- MITK_ERROR << "AffineInteractor3D: No point data present!";
- return false;
- }
-
- vtkDataArray* scalars = pointData->GetScalars();
- if (scalars == NULL)
+ mitk::DataNode::Pointer inputNode = this->GetDataNode();
+ if(inputNode.IsNull())
+ return;
+ mitk::ColorProperty::Pointer color = dynamic_cast(inputNode->GetProperty(priorPropertyName));
+ if ( color.IsNotNull() )
{
- MITK_ERROR << "AffineInteractor3D: No scalars for point data present!";
- return false;
+ inputNode->GetPropertyList()->SetProperty("color", color);
}
- for (vtkIdType i = 0; i < pointData->GetNumberOfTuples(); ++i)
- {
- scalars->SetComponent(i, 0, scalar);
- }
-
- polyData->Modified();
- pointData->Update();
+ inputNode->GetPropertyList()->DeleteProperty(selectedColorPropertyName);
+ inputNode->GetPropertyList()->DeleteProperty(deselectedColorPropertyName);
+ inputNode->GetPropertyList()->DeleteProperty(priorPropertyName);
+ inputNode->GetPropertyList()->DeleteProperty(translationStepSizePropertyName);
+ inputNode->GetPropertyList()->DeleteProperty(rotationStepSizePropertyName);
+ inputNode->GetPropertyList()->DeleteProperty(scaleStepSizePropertyName);
- return true;
+ //update rendering
+ mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
diff --git a/Modules/DataTypesExt/mitkAffineDataInteractor3D.h b/Modules/DataTypesExt/mitkAffineDataInteractor3D.h
index 38a7cac017..20a24a42a7 100644
--- a/Modules/DataTypesExt/mitkAffineDataInteractor3D.h
+++ b/Modules/DataTypesExt/mitkAffineDataInteractor3D.h
@@ -1,82 +1,101 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef mitkAffineDataInteractor3D_h_
#define mitkAffineDataInteractor3D_h_
-#include "mitkBaseRenderer.h"
-#include "mitkDataInteractor.h"
+#include
+#include
#include "MitkDataTypesExtExports.h"
-#include "mitkGeometry3D.h"
namespace mitk
{
/**
* \brief Affine interaction with objects in 3D windows.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MitkDataTypesExt_EXPORT AffineDataInteractor3D: public DataInteractor
{
public:
mitkClassMacro(AffineDataInteractor3D, DataInteractor);
itkFactorylessNewMacro(Self)
itkCloneMacro(Self)
+ virtual void SetDataNode(NodeType node);
+ void TranslateGeometry(mitk::Vector3D translate, mitk::BaseGeometry* geometry);
+ void RotateGeometry(mitk::ScalarType angle, int rotationaxis, mitk::BaseGeometry* geometry);
+ void ScaleGeometry(mitk::Point3D newScale, mitk::BaseGeometry* geometry);
+ mitk::BaseGeometry *GetUpdatedTimeGeometry(mitk::InteractionEvent *interactionEvent);
protected:
AffineDataInteractor3D();
virtual ~AffineDataInteractor3D();
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
virtual void ConnectActionsAndFunctions();
/**
* This function is called when a DataNode has been set/changed.
*/
virtual void DataNodeChanged();
+
/**
* Initializes the movement, stores starting position.
*/
- virtual bool CheckOverObject (const InteractionEvent *);
+ virtual bool CheckOverObject (const InteractionEvent*);
virtual bool SelectObject (StateMachineAction*, InteractionEvent*);
virtual bool DeselectObject (StateMachineAction*, InteractionEvent*);
virtual bool InitTranslate (StateMachineAction*, InteractionEvent*);
virtual bool InitRotate (StateMachineAction*, InteractionEvent*);
virtual bool TranslateObject (StateMachineAction*, InteractionEvent*);
virtual bool RotateObject (StateMachineAction*, InteractionEvent*);
+ virtual bool TranslateUpKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool TranslateDownKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool TranslateLeftKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool TranslateRightKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool TranslateUpModifierKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool TranslateDownModifierKey(StateMachineAction*, InteractionEvent* interactionEvent);
+
+ virtual bool RotateUpKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool RotateDownKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool RotateLeftKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool RotateRightKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool RotateUpModifierKey(StateMachineAction*, InteractionEvent* interactionEvent);
+ virtual bool RotateDownModifierKey(StateMachineAction*, InteractionEvent* interactionEvent);
+
+ virtual bool ScaleDownKey(mitk::StateMachineAction *, mitk::InteractionEvent* interactionEvent);
+ virtual bool ScaleUpKey(mitk::StateMachineAction *, mitk::InteractionEvent* interactionEvent);
-private:
- bool ColorizeSurface(BaseRenderer::Pointer renderer, double scalar = 0.0);
+ virtual void RestoreNodeProperties();
+
+private:
double m_InitialPickedWorldPoint[4];
Point2D m_InitialPickedDisplayPoint;
- //Point3D m_CurrentPickedPoint;
- //Point2D m_CurrentPickedDisplayPoint;
-
Geometry3D::Pointer m_OriginalGeometry;
Vector3D m_ObjectNormal;
};
}
#endif
diff --git a/Modules/DataTypesExt/mitkAffineDataInteractor3D.cpp b/Modules/DataTypesExt/mitkClippingPlaneInteractor3D.cpp
similarity index 87%
copy from Modules/DataTypesExt/mitkAffineDataInteractor3D.cpp
copy to Modules/DataTypesExt/mitkClippingPlaneInteractor3D.cpp
index 27958f7987..45cf054240 100644
--- a/Modules/DataTypesExt/mitkAffineDataInteractor3D.cpp
+++ b/Modules/DataTypesExt/mitkClippingPlaneInteractor3D.cpp
@@ -1,356 +1,356 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#include "mitkAffineDataInteractor3D.h"
+#include "mitkClippingPlaneInteractor3D.h"
-#include "mitkInteractionConst.h"
-#include "mitkInteractionPositionEvent.h"
-#include "mitkRotationOperation.h"
-#include "mitkSurface.h"
+#include
+#include
+#include
+#include
#include
#include
#include
#include
#include
#include
-mitk::AffineDataInteractor3D::AffineDataInteractor3D()
+mitk::ClippingPlaneInteractor3D::ClippingPlaneInteractor3D()
{
m_OriginalGeometry = Geometry3D::New();
// Initialize vector arithmetic
m_ObjectNormal[0] = 0.0;
m_ObjectNormal[1] = 0.0;
m_ObjectNormal[2] = 1.0;
}
-mitk::AffineDataInteractor3D::~AffineDataInteractor3D()
+mitk::ClippingPlaneInteractor3D::~ClippingPlaneInteractor3D()
{
}
-void mitk::AffineDataInteractor3D::ConnectActionsAndFunctions()
+void mitk::ClippingPlaneInteractor3D::ConnectActionsAndFunctions()
{
// **Conditions** that can be used in the state machine, to ensure that certain conditions are met, before actually executing an action
CONNECT_CONDITION("isOverObject", CheckOverObject);
// **Function** in the statmachine patterns also referred to as **Actions**
CONNECT_FUNCTION("selectObject",SelectObject);
CONNECT_FUNCTION("deselectObject",DeselectObject);
CONNECT_FUNCTION("initTranslate",InitTranslate);
CONNECT_FUNCTION("initRotate",InitRotate);
CONNECT_FUNCTION("translateObject",TranslateObject);
CONNECT_FUNCTION("rotateObject",RotateObject);
}
-void mitk::AffineDataInteractor3D::DataNodeChanged()
+void mitk::ClippingPlaneInteractor3D::DataNodeChanged()
{
}
-bool mitk::AffineDataInteractor3D::CheckOverObject(const InteractionEvent* interactionEvent)
+bool mitk::ClippingPlaneInteractor3D::CheckOverObject(const InteractionEvent* interactionEvent)
{
const InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
Point3D currentWorldPoint;
if(interactionEvent->GetSender()->PickObject(positionEvent->GetPointerPositionOnScreen(), currentWorldPoint) == this->GetDataNode().GetPointer())
return true;
return false;
}
-bool mitk::AffineDataInteractor3D::SelectObject(StateMachineAction*, InteractionEvent* interactionEvent)
+bool mitk::ClippingPlaneInteractor3D::SelectObject(StateMachineAction*, InteractionEvent* interactionEvent)
{
DataNode::Pointer node = this->GetDataNode();
if (node.IsNull())
return false;
node->SetColor(1.0, 0.0, 0.0);
// Colorize surface / wireframe dependend on distance from picked point
this->ColorizeSurface(interactionEvent->GetSender(), 0.0);
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
-bool mitk::AffineDataInteractor3D::DeselectObject(StateMachineAction*, InteractionEvent* interactionEvent)
+bool mitk::ClippingPlaneInteractor3D::DeselectObject(StateMachineAction*, InteractionEvent* interactionEvent)
{
DataNode::Pointer node = this->GetDataNode();
if (node.IsNull())
return false;
node->SetColor( 1.0, 1.0, 1.0 );
// Colorize surface / wireframe as inactive
this->ColorizeSurface(interactionEvent->GetSender(), -1.0);
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
-bool mitk::AffineDataInteractor3D::InitTranslate(StateMachineAction*, InteractionEvent* interactionEvent)
+bool mitk::ClippingPlaneInteractor3D::InitTranslate(StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
m_InitialPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
m_InitialPickedDisplayPoint[0],
m_InitialPickedDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
m_InitialPickedWorldPoint );
// Get the timestep to also support 3D+t
int timeStep = 0;
if ((interactionEvent->GetSender()) != NULL)
timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// Make deep copy of current Geometry3D of the plane
this->GetDataNode()->GetData()->UpdateOutputInformation(); // make sure that the Geometry is up-to-date
m_OriginalGeometry = static_cast(this->GetDataNode()->GetData()->GetGeometry(timeStep)->Clone().GetPointer());
return true;
}
-bool mitk::AffineDataInteractor3D::InitRotate(StateMachineAction*, InteractionEvent* interactionEvent)
+bool mitk::ClippingPlaneInteractor3D::InitRotate(StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
m_InitialPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
m_InitialPickedDisplayPoint[0],
m_InitialPickedDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
m_InitialPickedWorldPoint );
// Get the timestep to also support 3D+t
int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// Make deep copy of current Geometry3D of the plane
this->GetDataNode()->GetData()->UpdateOutputInformation(); // make sure that the Geometry is up-to-date
m_OriginalGeometry = static_cast(this->GetDataNode()->GetData()->GetGeometry(timeStep)->Clone().GetPointer());
return true;
}
-bool mitk::AffineDataInteractor3D::TranslateObject (StateMachineAction*, InteractionEvent* interactionEvent)
+bool mitk::ClippingPlaneInteractor3D::TranslateObject (StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
double currentWorldPoint[4];
mitk::Point2D currentDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
currentDisplayPoint[0],
currentDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
currentWorldPoint);
Vector3D interactionMove;
interactionMove[0] = currentWorldPoint[0] - m_InitialPickedWorldPoint[0];
interactionMove[1] = currentWorldPoint[1] - m_InitialPickedWorldPoint[1];
interactionMove[2] = currentWorldPoint[2] - m_InitialPickedWorldPoint[2];
Point3D origin = m_OriginalGeometry->GetOrigin();
// Get the timestep to also support 3D+t
int timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// If data is an mitk::Surface, extract it
Surface::Pointer surface = dynamic_cast< Surface* >(this->GetDataNode()->GetData());
vtkPolyData* polyData = NULL;
if (surface.IsNotNull())
{
polyData = surface->GetVtkPolyData( timeStep );
// Extract surface normal from surface (if existent, otherwise use default)
vtkPointData* pointData = polyData->GetPointData();
if (pointData != NULL)
{
vtkDataArray* normal = polyData->GetPointData()->GetVectors("planeNormal");
if (normal != NULL)
{
m_ObjectNormal[0] = normal->GetComponent( 0, 0 );
m_ObjectNormal[1] = normal->GetComponent( 0, 1 );
m_ObjectNormal[2] = normal->GetComponent( 0, 2 );
}
}
}
Vector3D transformedObjectNormal;
this->GetDataNode()->GetData()->GetGeometry( timeStep )->IndexToWorld(m_ObjectNormal, transformedObjectNormal);
this->GetDataNode()->GetData()->GetGeometry( timeStep )->SetOrigin(origin + transformedObjectNormal * (interactionMove * transformedObjectNormal));
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
-bool mitk::AffineDataInteractor3D::RotateObject (StateMachineAction*, InteractionEvent* interactionEvent)
+bool mitk::ClippingPlaneInteractor3D::RotateObject (StateMachineAction*, InteractionEvent* interactionEvent)
{
InteractionPositionEvent* positionEvent = dynamic_cast(interactionEvent);
if(positionEvent == NULL)
return false;
double currentWorldPoint[4];
Point2D currentPickedDisplayPoint = positionEvent->GetPointerPositionOnScreen();
vtkInteractorObserver::ComputeDisplayToWorld(
interactionEvent->GetSender()->GetVtkRenderer(),
currentPickedDisplayPoint[0],
currentPickedDisplayPoint[1],
0.0, //m_InitialInteractionPickedPoint[2],
currentWorldPoint);
vtkCamera* camera = NULL;
vtkRenderer* currentVtkRenderer = NULL;
if ((interactionEvent->GetSender()) != NULL)
{
vtkRenderWindow* renderWindow = interactionEvent->GetSender()->GetRenderWindow();
if (renderWindow != NULL)
{
vtkRenderWindowInteractor* renderWindowInteractor = renderWindow->GetInteractor();
if ( renderWindowInteractor != NULL )
{
currentVtkRenderer = renderWindowInteractor->GetInteractorStyle()->GetCurrentRenderer();
if (currentVtkRenderer != NULL)
camera = currentVtkRenderer->GetActiveCamera();
}
}
}
if ( camera )
{
double vpn[3];
camera->GetViewPlaneNormal( vpn );
Vector3D viewPlaneNormal;
viewPlaneNormal[0] = vpn[0];
viewPlaneNormal[1] = vpn[1];
viewPlaneNormal[2] = vpn[2];
Vector3D interactionMove;
interactionMove[0] = currentWorldPoint[0] - m_InitialPickedWorldPoint[0];
interactionMove[1] = currentWorldPoint[1] - m_InitialPickedWorldPoint[1];
interactionMove[2] = currentWorldPoint[2] - m_InitialPickedWorldPoint[2];
if (interactionMove[0] == 0 && interactionMove[1] == 0 && interactionMove[2] == 0)
return true;
Vector3D rotationAxis = itk::CrossProduct(viewPlaneNormal, interactionMove);
rotationAxis.Normalize();
int* size = currentVtkRenderer->GetSize();
double l2 =
(currentPickedDisplayPoint[0] - m_InitialPickedDisplayPoint[0]) *
(currentPickedDisplayPoint[0] - m_InitialPickedDisplayPoint[0]) +
(currentPickedDisplayPoint[1] - m_InitialPickedDisplayPoint[1]) *
(currentPickedDisplayPoint[1] - m_InitialPickedDisplayPoint[1]);
double rotationAngle = 360.0 * sqrt(l2 / (size[0] * size[0] + size[1] * size[1]));
// Use center of data bounding box as center of rotation
Point3D rotationCenter = m_OriginalGeometry->GetCenter();
int timeStep = 0;
if ((interactionEvent->GetSender()) != NULL)
timeStep = interactionEvent->GetSender()->GetTimeStep(this->GetDataNode()->GetData());
// Reset current Geometry3D to original state (pre-interaction) and
// apply rotation
RotationOperation op( OpROTATE, rotationCenter, rotationAxis, rotationAngle );
Geometry3D::Pointer newGeometry = static_cast(m_OriginalGeometry->Clone().GetPointer());
newGeometry->ExecuteOperation( &op );
mitk::TimeGeometry::Pointer timeGeometry = this->GetDataNode()->GetData()->GetTimeGeometry();
if (timeGeometry.IsNotNull())
timeGeometry->SetTimeStepGeometry(newGeometry, timeStep);
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return true;
}
else
return false;
}
-bool mitk::AffineDataInteractor3D::ColorizeSurface(BaseRenderer::Pointer renderer, double scalar)
+bool mitk::ClippingPlaneInteractor3D::ColorizeSurface(BaseRenderer::Pointer renderer, double scalar)
{
BaseData::Pointer data = this->GetDataNode()->GetData();
if(data.IsNull())
{
- MITK_ERROR << "AffineInteractor3D: No data object present!";
+ MITK_ERROR << "ClippingPlaneInteractor3D: No data object present!";
return false;
}
// Get the timestep to also support 3D+t
int timeStep = 0;
if (renderer.IsNotNull())
timeStep = renderer->GetTimeStep(data);
// If data is an mitk::Surface, extract it
Surface::Pointer surface = dynamic_cast< Surface* >(data.GetPointer());
vtkPolyData* polyData = NULL;
if (surface.IsNotNull())
polyData = surface->GetVtkPolyData(timeStep);
if (polyData == NULL)
{
- MITK_ERROR << "AffineInteractor3D: No poly data present!";
+ MITK_ERROR << "ClippingPlaneInteractor3D: No poly data present!";
return false;
}
vtkPointData* pointData = polyData->GetPointData();
if (pointData == NULL)
{
- MITK_ERROR << "AffineInteractor3D: No point data present!";
+ MITK_ERROR << "ClippingPlaneInteractor3D: No point data present!";
return false;
}
vtkDataArray* scalars = pointData->GetScalars();
if (scalars == NULL)
{
- MITK_ERROR << "AffineInteractor3D: No scalars for point data present!";
+ MITK_ERROR << "ClippingPlaneInteractor3D: No scalars for point data present!";
return false;
}
for (vtkIdType i = 0; i < pointData->GetNumberOfTuples(); ++i)
{
scalars->SetComponent(i, 0, scalar);
}
polyData->Modified();
pointData->Update();
return true;
}
diff --git a/Modules/DataTypesExt/mitkAffineDataInteractor3D.h b/Modules/DataTypesExt/mitkClippingPlaneInteractor3D.h
similarity index 79%
copy from Modules/DataTypesExt/mitkAffineDataInteractor3D.h
copy to Modules/DataTypesExt/mitkClippingPlaneInteractor3D.h
index 38a7cac017..51dfb9b0fe 100644
--- a/Modules/DataTypesExt/mitkAffineDataInteractor3D.h
+++ b/Modules/DataTypesExt/mitkClippingPlaneInteractor3D.h
@@ -1,82 +1,77 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#ifndef mitkAffineDataInteractor3D_h_
-#define mitkAffineDataInteractor3D_h_
+#ifndef mitkClippingPlaneInteractor3D_h
+#define mitkClippingPlaneInteractor3D_h
-#include "mitkBaseRenderer.h"
-#include "mitkDataInteractor.h"
+#include
+#include
+#include
#include "MitkDataTypesExtExports.h"
-#include "mitkGeometry3D.h"
namespace mitk
{
/**
- * \brief Affine interaction with objects in 3D windows.
+ * \brief Specialized interactor for clipping planes.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
-class MitkDataTypesExt_EXPORT AffineDataInteractor3D: public DataInteractor
+class MitkDataTypesExt_EXPORT ClippingPlaneInteractor3D: public DataInteractor
{
public:
- mitkClassMacro(AffineDataInteractor3D, DataInteractor);
+ mitkClassMacro(ClippingPlaneInteractor3D, DataInteractor);
itkFactorylessNewMacro(Self)
itkCloneMacro(Self)
protected:
- AffineDataInteractor3D();
- virtual ~AffineDataInteractor3D();
+ ClippingPlaneInteractor3D();
+ virtual ~ClippingPlaneInteractor3D();
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
virtual void ConnectActionsAndFunctions();
/**
* This function is called when a DataNode has been set/changed.
*/
virtual void DataNodeChanged();
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject (const InteractionEvent *);
virtual bool SelectObject (StateMachineAction*, InteractionEvent*);
virtual bool DeselectObject (StateMachineAction*, InteractionEvent*);
virtual bool InitTranslate (StateMachineAction*, InteractionEvent*);
virtual bool InitRotate (StateMachineAction*, InteractionEvent*);
virtual bool TranslateObject (StateMachineAction*, InteractionEvent*);
virtual bool RotateObject (StateMachineAction*, InteractionEvent*);
private:
bool ColorizeSurface(BaseRenderer::Pointer renderer, double scalar = 0.0);
double m_InitialPickedWorldPoint[4];
Point2D m_InitialPickedDisplayPoint;
- //Point3D m_CurrentPickedPoint;
- //Point2D m_CurrentPickedDisplayPoint;
-
Geometry3D::Pointer m_OriginalGeometry;
Vector3D m_ObjectNormal;
-
};
-
}
-#endif
+#endif //mitkClippingPlaneInteractor3D_h
diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake
index d6b37284cb..b4ff345857 100644
--- a/Plugins/PluginList.cmake
+++ b/Plugins/PluginList.cmake
@@ -1,50 +1,51 @@
# Plug-ins must be ordered according to their dependencies
set(MITK_EXT_PLUGINS
org.mitk.core.services:ON
org.mitk.gui.common:ON
org.mitk.planarfigure:ON
org.mitk.core.ext:OFF
org.mitk.core.jobs:OFF
org.mitk.diffusionimaging:OFF
org.mitk.simulation:OFF
org.mitk.gui.qt.application:ON
org.mitk.gui.qt.coreapplication:OFF
org.mitk.gui.qt.ext:OFF
org.mitk.gui.qt.extapplication:OFF
org.mitk.gui.qt.common:ON
org.mitk.gui.qt.stdmultiwidgeteditor:ON
org.mitk.gui.qt.common.legacy:OFF
org.mitk.gui.qt.cmdlinemodules:OFF
org.mitk.gui.qt.diffusionimagingapp:OFF
org.mitk.gui.qt.datamanager:ON
org.mitk.gui.qt.datamanagerlight:OFF
org.mitk.gui.qt.properties:ON
org.mitk.gui.qt.basicimageprocessing:OFF
org.mitk.gui.qt.dicom:OFF
org.mitk.gui.qt.diffusionimaging:OFF
org.mitk.gui.qt.dtiatlasapp:OFF
+ org.mitk.gui.qt.geometrytools:OFF
org.mitk.gui.qt.igtexamples:OFF
org.mitk.gui.qt.igttracking:OFF
org.mitk.gui.qt.imagecropper:OFF
org.mitk.gui.qt.imagenavigator:ON
org.mitk.gui.qt.viewnavigator:OFF
org.mitk.gui.qt.materialeditor:OFF
org.mitk.gui.qt.measurementtoolbox:OFF
org.mitk.gui.qt.moviemaker:OFF
org.mitk.gui.qt.pointsetinteraction:OFF
org.mitk.gui.qt.python:OFF
org.mitk.gui.qt.registration:OFF
org.mitk.gui.qt.remeshing:OFF
org.mitk.gui.qt.segmentation:OFF
org.mitk.gui.qt.simulation:OFF
org.mitk.gui.qt.aicpregistration:OFF
org.mitk.gui.qt.toftutorial:OFF
org.mitk.gui.qt.tofutil:OFF
org.mitk.gui.qt.ugvisualization:OFF
org.mitk.gui.qt.ultrasound:OFF
org.mitk.gui.qt.volumevisualization:OFF
org.mitk.gui.qt.eventrecorder:OFF
org.mitk.gui.qt.xnat:OFF
)
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/CMakeLists.txt b/Plugins/org.mitk.gui.qt.geometrytools/CMakeLists.txt
new file mode 100644
index 0000000000..f5f6599fe5
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/CMakeLists.txt
@@ -0,0 +1,7 @@
+project(org_mitk_gui_qt_geometrytools)
+
+MACRO_CREATE_MITK_CTK_PLUGIN(
+ EXPORT_DIRECTIVE GEOMETRYTOOLS_EXPORT
+ EXPORTED_INCLUDE_SUFFIXES src
+ MODULE_DEPENDS MitkQtWidgetsExt
+)
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.geometrytools/documentation/UserManual/Manual.dox
new file mode 100644
index 0000000000..43ddcf1d36
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/documentation/UserManual/Manual.dox
@@ -0,0 +1,17 @@
+/**
+\page org_mitk_gui_qt_geometrytools The Geometry Tools
+
+\imageMacro{icon.png,"Icon of Geometry Tools",2.00}
+
+\tableofcontents
+
+\section org_mitk_gui_qt_geometrytoolsOverview Overview
+Describe the features of your awesome plugin here
+
+- Increases productivity
+
- Creates beautiful images
+
- Generates PhD thesis
+
- Brings world peace
+
+
+*/
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/documentation/UserManual/icon.xpm b/Plugins/org.mitk.gui.qt.geometrytools/documentation/UserManual/icon.xpm
new file mode 100644
index 0000000000..9057c20bc6
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/documentation/UserManual/icon.xpm
@@ -0,0 +1,21 @@
+/* XPM */
+static const char * icon_xpm[] = {
+"16 16 2 1",
+" c #FF0000",
+". c #000000",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" ",
+" "};
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.geometrytools/documentation/doxygen/modules.dox
new file mode 100644
index 0000000000..257a5d7d17
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/documentation/doxygen/modules.dox
@@ -0,0 +1,16 @@
+/**
+ \defgroup org_mitk_gui_qt_geometrytools org.mitk.gui.qt.geometrytools
+ \ingroup MITKPlugins
+
+ \brief Describe your plugin here.
+
+*/
+
+/**
+ \defgroup org_mitk_gui_qt_geometrytools_internal Internal
+ \ingroup org_mitk_gui_qt_geometrytools
+
+ \brief This subcategory includes the internal classes of the org.mitk.gui.qt.geometrytools plugin. Other
+ plugins must not rely on these classes. They contain implementation details and their interface
+ may change at any time. We mean it.
+*/
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/files.cmake b/Plugins/org.mitk.gui.qt.geometrytools/files.cmake
new file mode 100644
index 0000000000..599f90d2a6
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/files.cmake
@@ -0,0 +1,52 @@
+set(SRC_CPP_FILES
+
+)
+
+set(INTERNAL_CPP_FILES
+ org_mitk_gui_qt_geometrytools_Activator.cpp
+ QmitkGeometryToolsView.cpp
+)
+
+set(UI_FILES
+ src/internal/QmitkGeometryToolsViewControls.ui
+)
+
+set(MOC_H_FILES
+ src/internal/org_mitk_gui_qt_geometrytools_Activator.h
+ src/internal/QmitkGeometryToolsView.h
+)
+
+# list of resource files which can be used by the plug-in
+# system without loading the plug-ins shared library,
+# for example the icon used in the menu and tabs for the
+# plug-in views in the workbench
+set(CACHED_RESOURCE_FILES
+ resources/icon.xpm
+ resources/key_ctrl.png
+ resources/key_alt.png
+ resources/key_dash.png
+ resources/key_down.png
+ resources/key_left.png
+ resources/key_plus.png
+ resources/key_right.png
+ resources/key_shift.png
+ resources/key_up.png
+
+ plugin.xml
+)
+
+# list of Qt .qrc files which contain additional resources
+# specific to this plugin
+set(QRC_FILES
+
+)
+
+set(CPP_FILES )
+
+foreach(file ${SRC_CPP_FILES})
+ set(CPP_FILES ${CPP_FILES} src/${file})
+endforeach(file ${SRC_CPP_FILES})
+
+foreach(file ${INTERNAL_CPP_FILES})
+ set(CPP_FILES ${CPP_FILES} src/internal/${file})
+endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.geometrytools/manifest_headers.cmake
new file mode 100644
index 0000000000..17165dc97f
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/manifest_headers.cmake
@@ -0,0 +1,5 @@
+set(Plugin-Name "Geometry Tools")
+set(Plugin-Version "0.1")
+set(Plugin-Vendor "DKFZ")
+set(Plugin-ContactAddress "")
+set(Require-Plugin org.mitk.gui.qt.common)
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/plugin.xml b/Plugins/org.mitk.gui.qt.geometrytools/plugin.xml
new file mode 100644
index 0000000000..47404dc68e
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/plugin.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/icon.xpm b/Plugins/org.mitk.gui.qt.geometrytools/resources/icon.xpm
new file mode 100644
index 0000000000..7b3b16dec1
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/resources/icon.xpm
@@ -0,0 +1,896 @@
+/* XPM */
+static char * geometrytools_color_xpm[] = {
+"100 97 796 2",
+" c None",
+". c #0070C0",
+"+ c #74B349",
+"@ c #466C2C",
+"# c #121C0C",
+"$ c #223516",
+"% c #60943D",
+"& c #42672A",
+"* c #111B0B",
+"= c #263B18",
+"- c #649A3F",
+"; c #73B149",
+"> c #3F6128",
+", c #10190A",
+"' c #2A401B",
+") c #679F41",
+"! c #71AF48",
+"~ c #3B5B26",
+"{ c #10180A",
+"] c #2D471D",
+"^ c #6AA443",
+"/ c #70AC47",
+"( c #375523",
+"_ c #0F180A",
+": c #314C1F",
+"< c #6EAA46",
+"[ c #74B34A",
+"} c #73B249",
+"| c #71AE48",
+"1 c #70AD47",
+"2 c #7ABD4D",
+"3 c #3F6229",
+"4 c #000000",
+"5 c #0A1305",
+"6 c #588C35",
+"7 c #71B245",
+"8 c #33521F",
+"9 c #0F1A08",
+"0 c #5D9338",
+"a c #6FB044",
+"b c #2E4B1C",
+"c c #14220B",
+"d c #61993B",
+"e c #6EAD43",
+"f c #2A4419",
+"g c #19290E",
+"h c #659F3D",
+"i c #6CAA41",
+"j c #253C16",
+"k c #1F3412",
+"l c #558634",
+"m c #41642A",
+"n c #476E2D",
+"o c #639D3D",
+"p c #6DAC42",
+"q c #6CAB42",
+"r c #6EAC44",
+"s c #0E1609",
+"t c #0A0B09",
+"u c #73876A",
+"v c #A6C39A",
+"w c #B9D9AC",
+"x c #8AA280",
+"y c #5C6C54",
+"z c #6F8367",
+"A c #AAC79E",
+"B c #B8D8AB",
+"C c #879E7D",
+"D c #5B6B54",
+"E c #ADCBA0",
+"F c #B7D6A9",
+"G c #839A7A",
+"H c #5A6A53",
+"I c #768B6E",
+"J c #B0CEA3",
+"K c #B5D5A8",
+"L c #809676",
+"M c #819878",
+"N c #63735C",
+"O c #141713",
+"P c #90A985",
+"Q c #B6D5A8",
+"R c #B7D6AB",
+"S c #97C37D",
+"T c #6DAC43",
+"U c #10120F",
+"V c #C7EBB7",
+"W c #B5D5A6",
+"X c #B4D4A4",
+"Y c #B7D8A8",
+"Z c #BBDCAB",
+"` c #B9DAAA",
+" . c #B4D4A5",
+".. c #B9DAA9",
+"+. c #B4D5A5",
+"@. c #B8D8A8",
+"#. c #B8D9A8",
+"$. c #BEE0AE",
+"%. c #6E8165",
+"&. c #0F110D",
+"*. c #252C22",
+"=. c #92AD86",
+"-. c #B6D6A7",
+";. c #B5D5A7",
+">. c #95C37B",
+",. c #3F6228",
+"'. c #365422",
+"). c #536A46",
+"!. c #BBDCAC",
+"~. c #B3D4A4",
+"{. c #A1BF94",
+"]. c #8AA37E",
+"^. c #90A984",
+"/. c #ABCA9C",
+"(. c #B4D4A6",
+"_. c #95C27A",
+":. c #72B248",
+"<. c #9AC880",
+"[. c #B2D3A3",
+"}. c #B6D8A7",
+"|. c #BCDEAC",
+"1. c #BADDAB",
+"2. c #73B248",
+"3. c #9BC980",
+"4. c #B5D7A6",
+"5. c #8EA882",
+"6. c #5E7057",
+"7. c #6A7E61",
+"8. c #A1BF93",
+"9. c #0C1208",
+"0. c #0B0D0B",
+"a. c #BFE3AE",
+"b. c #B1D3A2",
+"c. c #B8DBA8",
+"d. c #627459",
+"e. c #10130F",
+"f. c #8CA680",
+"g. c #B3D6A4",
+"h. c #B2D4A4",
+"i. c #94C279",
+"j. c #0D1408",
+"k. c #0D0F0C",
+"l. c #BEE2AD",
+"m. c #B1D2A1",
+"n. c #B6D9A6",
+"o. c #6E8465",
+"p. c #161A14",
+"q. c #2A3327",
+"r. c #91AD85",
+"s. c #B3D4A3",
+"t. c #94C179",
+"u. c #49712E",
+"v. c #416629",
+"w. c #5F7B4F",
+"x. c #B7D9A7",
+"y. c #B0D2A0",
+"z. c #A2C294",
+"A. c #90AC83",
+"B. c #94B187",
+"C. c #AACA9B",
+"D. c #B0D3A1",
+"E. c #93C278",
+"F. c #72B048",
+"G. c #71B047",
+"H. c #97C57C",
+"I. c #B1D2A2",
+"J. c #AFD19F",
+"K. c #B2D5A2",
+"L. c #B7DAA6",
+"M. c #B6D9A5",
+"N. c #B1D3A1",
+"O. c #93C178",
+"P. c #6FAC46",
+"Q. c #94C17A",
+"R. c #88A37C",
+"S. c #56664E",
+"T. c #627559",
+"U. c #9DBB8E",
+"V. c #B0D2A1",
+"W. c #0A1007",
+"X. c #090A09",
+"Y. c #BBE1AA",
+"Z. c #AED19E",
+"`. c #B5D9A4",
+" + c #5F7256",
+".+ c #0E100C",
+"++ c #89A47C",
+"@+ c #B0D4A0",
+"#+ c #AFD2A0",
+"$+ c #92C177",
+"%+ c #0C1207",
+"&+ c #0B0C0B",
+"*+ c #BBE0AA",
+"=+ c #AED09E",
+"-+ c #B3D6A2",
+";+ c #708666",
+">+ c #1D231B",
+",+ c #313A2C",
+"'+ c #90AD83",
+")+ c #AFD29F",
+"!+ c #AFD1A0",
+"~+ c #92C077",
+"{+ c #527F34",
+"]+ c #4D7730",
+"^+ c #6B8C58",
+"/+ c #ADD09C",
+"(+ c #AED19D",
+"_+ c #A3C493",
+":+ c #95B387",
+"<+ c #98B78A",
+"[+ c #A8CA98",
+"}+ c #ADD09D",
+"|+ c #92C076",
+"1+ c #71AE47",
+"2+ c #70AE46",
+"3+ c #AED09F",
+"4+ c #ACCF9C",
+"5+ c #AED29E",
+"6+ c #B1D5A0",
+"7+ c #ADD09E",
+"8+ c #91C076",
+"9+ c #6BA544",
+"0+ c #69A342",
+"a+ c #8CB772",
+"b+ c #AFD19E",
+"c+ c #ACCF9B",
+"d+ c #AFD39E",
+"e+ c #839E76",
+"f+ c #4C5C45",
+"g+ c #596C51",
+"h+ c #99B889",
+"i+ c #91C075",
+"j+ c #0A0F06",
+"k+ c #080908",
+"l+ c #B8DFA6",
+"m+ c #ABCF9A",
+"n+ c #B2D7A0",
+"o+ c #5D7053",
+"p+ c #0C0F0B",
+"q+ c #86A279",
+"r+ c #ADD19C",
+"s+ c #0B1007",
+"t+ c #B8DEA5",
+"u+ c #AACE99",
+"v+ c #AFD49E",
+"w+ c #718966",
+"x+ c #242C21",
+"y+ c #374231",
+"z+ c #8FAD81",
+"A+ c #ACD09B",
+"B+ c #90BF75",
+"C+ c #5B8D3A",
+"D+ c #578737",
+"E+ c #769B60",
+"F+ c #A3C693",
+"G+ c #99BA8A",
+"H+ c #9CBD8C",
+"I+ c #A7CA96",
+"J+ c #ABCF9B",
+"K+ c #90BF74",
+"L+ c #6FAD46",
+"M+ c #92C176",
+"N+ c #A9CE98",
+"O+ c #AACF99",
+"P+ c #ABD09A",
+"Q+ c #AACF9A",
+"R+ c #649B40",
+"S+ c #61973D",
+"T+ c #81AA69",
+"U+ c #ABD19B",
+"V+ c #A8CE97",
+"W+ c #ACD29A",
+"X+ c #7D9970",
+"Y+ c #43523C",
+"Z+ c #506248",
+"`+ c #93B584",
+" @ c #A9CF98",
+".@ c #A9CF99",
+"+@ c #8FBF73",
+"@@ c #B5DDA1",
+"#@ c #A8CD96",
+"$@ c #AED59B",
+"%@ c #5B6F51",
+"&@ c #0B0D0A",
+"*@ c #83A075",
+"=@ c #AAD098",
+"-@ c #A9CE97",
+";@ c #8FBF72",
+">@ c #C0EDAB",
+",@ c #B3DDA0",
+"'@ c #A8CF96",
+")@ c #A6CD94",
+"!@ c #A8D096",
+"~@ c #A7CE95",
+"{@ c #A9D197",
+"]@ c #A7CD95",
+"^@ c #AAD298",
+"/@ c #ACD399",
+"(@ c #B7E2A3",
+"_@ c #7F9C71",
+":@ c #2B3627",
+"<@ c #43533C",
+"[@ c #91B381",
+"}@ c #A8CE96",
+"|@ c #8EBF72",
+"1@ c #63993F",
+"2@ c #60963D",
+"3@ c #709659",
+"4@ c #0F110E",
+"5@ c #8FB17F",
+"6@ c #A6CD93",
+"7@ c #8DAE7D",
+"8@ c #0B0E0A",
+"9@ c #99BD88",
+"0@ c #A6CE94",
+"a@ c #81A073",
+"b@ c #0D100C",
+"c@ c #0C0E0B",
+"d@ c #A1C78F",
+"e@ c #A8CF95",
+"f@ c #759067",
+"g@ c #0F120D",
+"h@ c #A7CF94",
+"i@ c #A9D196",
+"j@ c #67805C",
+"k@ c #11150F",
+"l@ c #A2C990",
+"m@ c #526649",
+"n@ c #809E72",
+"o@ c #8EBF71",
+"p@ c #7EAA64",
+"q@ c #8BAC7B",
+"r@ c #A5CD92",
+"s@ c #88A978",
+"t@ c #96BA85",
+"u@ c #A5CE92",
+"v@ c #7B996D",
+"w@ c #9FC68D",
+"x@ c #6C8760",
+"y@ c #A6CF93",
+"z@ c #A8D195",
+"A@ c #5D7453",
+"B@ c #54694B",
+"C@ c #1B2218",
+"D@ c #8DBF70",
+"E@ c #81AF66",
+"F@ c #1A1F18",
+"G@ c #191F16",
+"H@ c #90B27F",
+"I@ c #A5CC92",
+"J@ c #8EB07E",
+"K@ c #181E15",
+"L@ c #99BD87",
+"M@ c #83A374",
+"N@ c #1A2017",
+"O@ c #181E16",
+"P@ c #A0C78E",
+"Q@ c #A6CE93",
+"R@ c #78946A",
+"S@ c #192017",
+"T@ c #A8CF94",
+"U@ c #6C865F",
+"V@ c #1D241A",
+"W@ c #1F271C",
+"X@ c #53684A",
+"Y@ c #030302",
+"Z@ c #1D2419",
+"`@ c #8EB17E",
+" # c #A8D094",
+".# c #8DBE70",
+"+# c #8FC172",
+"@# c #B1DC9E",
+"## c #AFDA9B",
+"$# c #A3CC91",
+"%# c #A4CD91",
+" c #A4CC91",
+"*# c #A3CC90",
+"=# c #A7D194",
+"-# c #A8D295",
+";# c #AFDA9A",
+"># c #A6D093",
+",# c #586F4E",
+"'# c #050604",
+")# c #86A776",
+"!# c #AAD496",
+"~# c #8CBE70",
+"{# c #8DBF71",
+"]# c #A3CC8F",
+"^# c #A2CB8E",
+"/# c #596F4E",
+"(# c #192016",
+"_# c #82A272",
+":# c #A9D394",
+"<# c #8CBE6F",
+"[# c #A2CC8E",
+"}# c #A5D091",
+"|# c #536A4A",
+"1# c #86AA77",
+"2# c #A4CE90",
+"3# c #728E65",
+"4# c #90C372",
+"5# c #8DBE6F",
+"6# c #A3CD8F",
+"7# c #A1CC8D",
+"8# c #AAD795",
+"9# c #506647",
+"0# c #1B2318",
+"a# c #8DB27B",
+"b# c #263021",
+"c# c #1D2319",
+"d# c #8FC371",
+"e# c #6FAC45",
+"f# c #A3CC8E",
+"g# c #A1CB8C",
+"h# c #A0CA8B",
+"i# c #A8D593",
+"j# c #556C4A",
+"k# c #020302",
+"l# c #11140F",
+"m# c #69934F",
+"n# c #71AF47",
+"o# c #8CBE6E",
+"p# c #A0CB8B",
+"q# c #A2CE8D",
+"r# c #546B49",
+"s# c #030303",
+"t# c #405F2C",
+"u# c #8CBE6D",
+"v# c #9FCB8A",
+"w# c #97C082",
+"x# c #2B3625",
+"y# c #233616",
+"z# c #6AA444",
+"A# c #8BBE6D",
+"B# c #A0CC8B",
+"C# c #9ECB89",
+"D# c #9FCD8A",
+"E# c #4D6343",
+"F# c #0C1308",
+"G# c #5C8D3A",
+"H# c #70AE47",
+"I# c #89BD6A",
+"J# c #9CC986",
+"K# c #9BC883",
+"L# c #9FCE87",
+"M# c #8EB979",
+"N# c #536D46",
+"O# c #1D2818",
+"P# c #0B1008",
+"Q# c #020401",
+"R# c #486E2E",
+"S# c #77B151",
+"T# c #7DB559",
+"U# c #7CB558",
+"V# c #7EB759",
+"W# c #83BE5E",
+"X# c #609040",
+"Y# c #3D5E26",
+"Z# c #203114",
+"`# c #334E20",
+" $ c #6DA845",
+".$ c #61963D",
+"+$ c #6FAB46",
+"@$ c #0070C2",
+"#$ c #2671AB",
+"$$ c #2F71A6",
+"%$ c #2771AB",
+"&$ c #41719C",
+"*$ c #3C719F",
+"=$ c #0F71B8",
+"-$ c #0070C1",
+";$ c #3171A5",
+">$ c #43719B",
+",$ c #0C70B9",
+"'$ c #ED7D31",
+")$ c #ED7D30",
+"!$ c #0B70BA",
+"~$ c #3271A5",
+"{$ c #40719C",
+"]$ c #ED7C2F",
+"^$ c #ED7B2D",
+"/$ c #EC7A2B",
+"($ c #EC792A",
+"_$ c #ED7F35",
+":$ c #ED7B2C",
+"<$ c #ED7A2C",
+"[$ c #ED7B2E",
+"}$ c #0770BC",
+"|$ c #ED7F34",
+"1$ c #F09053",
+"2$ c #F3A376",
+"3$ c #F6B290",
+"4$ c #F7BBA1",
+"5$ c #F7BDA3",
+"6$ c #F7BCA3",
+"7$ c #F6B495",
+"8$ c #F4A87F",
+"9$ c #F1965D",
+"0$ c #EE823B",
+"a$ c #ED7C31",
+"b$ c #ED7C30",
+"c$ c #EF8845",
+"d$ c #F3A172",
+"e$ c #F6B99E",
+"f$ c #F8BEA7",
+"g$ c #F7BCA4",
+"h$ c #F7BBA2",
+"i$ c #F7BEA6",
+"j$ c #F7BCA2",
+"k$ c #F4A77E",
+"l$ c #F08C4D",
+"m$ c #EE8138",
+"n$ c #EF8947",
+"o$ c #F2A274",
+"p$ c #F7BAA0",
+"q$ c #F7B99F",
+"r$ c #F7BAA1",
+"s$ c #F7BBA3",
+"t$ c #F08F51",
+"u$ c #EC7D31",
+"v$ c #88776E",
+"w$ c #3B3737",
+"x$ c #3B3838",
+"y$ c #F19862",
+"z$ c #F5B394",
+"A$ c #F6BAA2",
+"B$ c #F6B9A0",
+"C$ c #F6B99F",
+"D$ c #F6BCA5",
+"E$ c #F5B293",
+"F$ c #F5AE8C",
+"G$ c #F5AD89",
+"H$ c #F5B190",
+"I$ c #F6BAA1",
+"J$ c #F7BDA6",
+"K$ c #F6BBA3",
+"L$ c #F5B69A",
+"M$ c #F2A071",
+"N$ c #ED7E33",
+"O$ c #E17C38",
+"P$ c #70767C",
+"Q$ c #0570BD",
+"R$ c #F3A67D",
+"S$ c #F6B79C",
+"T$ c #F6B89F",
+"U$ c #F6B89E",
+"V$ c #F3A981",
+"W$ c #F09157",
+"X$ c #EE833C",
+"Y$ c #EE8037",
+"Z$ c #ED8036",
+"`$ c #EF8C4C",
+" % c #F3A276",
+".% c #F6B79B",
+"+% c #F4AE8A",
+"@% c #EE7C30",
+"#% c #E77D34",
+"$% c #F3A67C",
+"%% c #F6B79D",
+"&% c #F6B69B",
+"*% c #F5AA84",
+"=% c #EF8742",
+"-% c #EE8139",
+";% c #F29E6F",
+">% c #F6B498",
+",% c #F5B191",
+"'% c #EE8036",
+")% c #F3A175",
+"!% c #F4AE8C",
+"~% c #F08F53",
+"{% c #EC7A2C",
+"]% c #F4A880",
+"^% c #F4AB87",
+"/% c #3A3737",
+"(% c #F29C6B",
+"_% c #F6B59A",
+":% c #F6B69C",
+"<% c #F4A67D",
+"[% c #EE8541",
+"}% c #ED7C2E",
+"|% c #EE7D30",
+"1% c #EE7C2E",
+"2% c #F29C6A",
+"3% c #F6B59B",
+"4% c #F3A379",
+"5% c #3A3636",
+"6% c #434040",
+"7% c #595757",
+"8% c #393636",
+"9% c #3C3939",
+"0% c #5D5B5B",
+"a% c #F09055",
+"b% c #F6B49A",
+"c% c #F6B499",
+"d% c #F3A47C",
+"e% c #E87D34",
+"f% c #F07D2E",
+"g% c #ED7D32",
+"h% c #F19964",
+"i% c #F29B6A",
+"j% c #413F3F",
+"k% c #848484",
+"l% c #6D6C6C",
+"m% c #373434",
+"n% c #858585",
+"o% c #686767",
+"p% c #F5B297",
+"q% c #F5B498",
+"r% c #F5B59A",
+"s% c #F4AA85",
+"t% c #ED7E32",
+"u% c #1A71B0",
+"v% c #D17B42",
+"w% c #F07D2F",
+"x% c #F19E6F",
+"y% c #F5B599",
+"z% c #F5B59C",
+"A% c #EE8845",
+"B% c #423F3F",
+"C% c #878686",
+"D% c #929292",
+"E% c #6A6868",
+"F% c #363232",
+"G% c #868585",
+"H% c #959696",
+"I% c #605E5E",
+"J% c #F3A57C",
+"K% c #F5B397",
+"L% c #F5B499",
+"M% c #F4AC8A",
+"N% c #EE8137",
+"O% c #1D72AF",
+"P% c #F87D2A",
+"Q% c #EC7B2C",
+"R% c #F4A57D",
+"S% c #F4AA88",
+"T% c #454242",
+"U% c #808080",
+"V% c #939393",
+"W% c #8F8F8F",
+"X% c #8D8D8D",
+"Y% c #919191",
+"Z% c #969696",
+"`% c #5D5A5A",
+" & c #F5B194",
+".& c #F08D4F",
+"+& c #F4AC8C",
+"@& c #F5B398",
+"#& c #F5B49A",
+"$& c #F19865",
+"%& c #7B7A7A",
+"&& c #949494",
+"*& c #625F5F",
+"=& c #F3A37B",
+"-& c #F5B296",
+";& c #F5B195",
+">& c #F29D6E",
+",& c #EC7C30",
+"'& c #F08F54",
+")& c #F5B196",
+"!& c #F4AD8E",
+"~& c #EE833D",
+"{& c #444242",
+"]& c #7D7C7C",
+"^& c #909090",
+"/& c #656464",
+"(& c #3C3A3A",
+"_& c #EF8D4F",
+":& c #F5AF92",
+"<& c #F5B094",
+"[& c #F4AB8A",
+"}& c #EF8744",
+"|& c #EE823A",
+"1& c #F3A47D",
+"2& c #F5B093",
+"3& c #F19764",
+"4& c #3A3838",
+"5& c #383535",
+"6& c #6C6B6B",
+"7& c #8E8E8E",
+"8& c #888787",
+"9& c #4F4D4D",
+"0& c #F29C6D",
+"a& c #F29F71",
+"b& c #F09259",
+"c& c #F5AE91",
+"d& c #F5AF93",
+"e& c #F3A47E",
+"f& c #767575",
+"g& c #8C8C8C",
+"h& c #898989",
+"i& c #F5AB8A",
+"j& c #F6AF92",
+"k& c #F6AF91",
+"l& c #F6AD8E",
+"m& c #EF8743",
+"n& c #EE8038",
+"o& c #F4A57F",
+"p& c #F6AD8D",
+"q& c #F08D50",
+"r& c #3E3C3C",
+"s& c #737272",
+"t& c #8A8A8A",
+"u& c #8B8B8B",
+"v& c #363333",
+"w& c #F08E51",
+"x& c #F7B196",
+"y& c #F6AD8F",
+"z& c #F6AE91",
+"A& c #F4A27A",
+"B& c #ED7A2B",
+"C& c #F29A69",
+"D& c #F6AD90",
+"E& c #F6AF93",
+"F& c #F29967",
+"G& c #706F6F",
+"H& c #888888",
+"I& c #878787",
+"J& c #7D7D7D",
+"K& c #717070",
+"L& c #727171",
+"M& c #848383",
+"N& c #838383",
+"O& c #585656",
+"P& c #F39E71",
+"Q& c #F08A4A",
+"R& c #F6AC8C",
+"S& c #F6AE90",
+"T& c #F5A47D",
+"U& c #EE813A",
+"V& c #403D3D",
+"W& c #868686",
+"X& c #3E3B3B",
+"Y& c #413E3E",
+"Z& c #7B7B7B",
+"`& c #828282",
+" * c #555353",
+".* c #F6AB8C",
+"+* c #F6AC8D",
+"@* c #F7AD8E",
+"#* c #ED7E34",
+"$* c #F6A985",
+"%* c #F7AD8F",
+"&* c #EE8540",
+"** c #6E6D6D",
+"=* c #646363",
+"-* c #383434",
+";* c #EF8542",
+">* c #F8AD8F",
+",* c #F7AB8B",
+"'* c #F7AC8D",
+")* c #F59E73",
+"!* c #F29867",
+"~* c #F8AE90",
+"{* c #F18E52",
+"]* c #504E4E",
+"^* c #393535",
+"/* c #F29158",
+"(* c #F7AB8A",
+"_* c #F7AD8D",
+":* c #F2945F",
+"<* c #F08B4E",
+"[* c #F39968",
+"}* c #F39A69",
+"|* c #F7AA8A",
+"1* c #F7A988",
+"2* c #F8AC8E",
+"3* c #F08A4B",
+"4* c #EE823C",
+"5* c #F49C6E",
+"6* c #F7AA8B",
+"7* c #F7AA89",
+"8* c #F6A683",
+"9* c #F39662",
+"0* c #F59F75",
+"a* c #F7A987",
+"b* c #F7A887",
+"c* c #EF8846",
+"d* c #F7A784",
+"e* c #F7A580",
+"f* c #EF843F",
+"g* c #F6A57F",
+"h* c #F7A885",
+"i* c #F7A886",
+"j* c #F7A783",
+"k* c #EF843E",
+"l* c #F6A47F",
+"m* c #F6A782",
+"n* c #EF8642",
+"o* c #F7A37D",
+"p* c #F7A47E",
+"q* c #F7A47F",
+"r* c #F7A178",
+"s* c #F08948",
+"t* c #F08846",
+"u* c #F08744",
+" ",
+" . ",
+" . . ",
+" . . . ",
+" . . . . ",
+" . . . . . ",
+" . . . . . . ",
+" . . . . . . . + @ # $ % + & * = - ; > , ' ) ! ~ { ] ^ / ( _ : < [ } | 1 1 1 1 1 1 1 1 1 1 1 ",
+" . . . 2 3 4 5 6 7 8 4 9 0 a b 4 c d e f 4 g h i j 4 k l m n o p q q q q q q q r 1 1 ",
+" . . . s 4 t u v w x y z A B C D u E F G H I J K L H M N 4 O P B Q Q Q Q Q Q R S T 1 ",
+" . . . s 4 U V W X Y Z ` W .Y Z ..+. .@.Z ..+. .#.Z $.%.&.*.=.-. . . . . . .;.>.r 1 ",
+" . . . ,.'.).!.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.+.{.].^./.X ~.~.~.~.~.~.(._.r 1 ",
+" . . . ; :.<.(.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.}.|.1.+.[.[.[.[.[.[.[. ._.r 1 ",
+" . . . } 2.3.(.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.4.5.6.7.8.~.[.[.[.[.[.[. ._.r 1 ",
+" . . . 9.4 0.a.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.c.d.4 e.f.g.b.b.b.b.b.b.h.i.r 1 ",
+" . . . j.4 k.l.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.m.n.o.p.q.r.s.m.m.m.m.m.m.[.t.r 1 ",
+" . . . u.v.w.x.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.b.z.A.B.C.D.y.y.y.y.y.y.b.E.r 1 ",
+" . . . F.G.H.I.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.K.L.M.N.J.J.J.J.J.J.J.m.O.r 1 ",
+" . . . 1 P.Q.I.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.K.R.S.T.U.y.J.J.J.J.J.J.V.O.r 1 ",
+" . . . W.4 X.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.`. +4 .+++@+Z.Z.Z.Z.Z.Z.#+$+r 1 ",
+" . . . %+4 &+*+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+-+;+>+,+'+)+=+=+=+=+=+=+!+~+r 1 ",
+" . . . {+]+^+-+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+(+_+:+<+[+}+/+/+/+/+/+/+Z.|+r 1 ",
+" . . . 1+2+i.3+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+4+5+6+@+}+4+4+4+4+4+4+4+7+8+r 1 ",
+" . . . 9+0+a+b+c+c+c+c+c+c+c+c+c+c+c+c+c+c+c+c+c+c+c+d+e+f+g+h+/+c+c+c+c+c+c+}+i+r 1 ",
+" . . . j+4 k+l+m+m+m+m+m+m+m+m+m+m+m+m+m+m+m+m+m+m+m+n+o+4 p+q+r+m+m+m+m+m+m+4+i+r 1 ",
+" . . . s+4 X.t+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+v+w+x+y+z+A+u+u+u+u+u+u+c+B+r 1 ",
+" . . . C+D+E+5+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+u+m+F+G+H+I+u+u+u+u+u+u+u+J+K+r 1 ",
+" . . . 1 L+M+J+N+N+N+N+N+N+N+N+N+N+N+N+N+N+N+N+N+N+N+N+O+P+P+N+N+N+N+N+N+N+N+Q+K+r 1 ",
+" . . . R+S+T+U+V+V+V+V+V+V+V+V+V+V+V+V+V+V+V+V+V+V+V+W+X+Y+Z+`+ @V+V+V+V+V+V+.@+@r 1 ",
+" . . . j+4 k+@@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@#@$@%@4 &@*@=@#@#@#@#@#@#@-@;@r 1 ",
+" . . . j+4 X.>@,@'@)@!@,@,@~@)@{@,@,@]@)@^@,@,@)@)@/@(@_@:@<@[@'@)@)@)@)@)@)@}@|@r 1 ",
+" . . . 1@2@3@4@p+5@6@7@p+8@9@0@a@b@c@d@e@f@g@b@h@i@j@k@&@l@m@n@i@6@6@6@6@6@6@~@o@r 1 ",
+" . . . 1 L+p@4 4 q@r@s@4 4 t@u@v@4 4 w@h@x@4 4 y@z@A@4 4 B@4 C@5@r@r@r@r@r@r@0@D@r 1 ",
+" . . . 1 L+E@F@G@H@I@J@G@K@L@I@M@N@O@P@Q@R@C@S@6@T@U@V@W@X@Y@4 Z@`@ #I@I@I@I@6@.#r 1 ",
+" . . . 1 L++#@###u@$#u@####%#$#y@####*#=#####*#*#-###;#>#,#'#4 C@)#!#*#$#$#r@~#r 1 ",
+" . . . 1 L+{#r@]#]#]#]#]#]#]#]#]#]#]#]#]#]#]#]#]#]#]#]#]#*#^#/#Y@4 (#_#:#]#*#-#<#r 1 ",
+" . . . 1 L+{#%#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#[#}#|#4 4 (#1#2#[#3#4#r 1 ",
+" . . . 1 L+5#6#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#7#8#9#4 4 0#a#b#c#d#e#1 ",
+" . . . 1 L+<#f#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#h#i#j#'#4 k#4 l#m#n#1 ",
+" . . . 1 L+o#[#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#p#q#r#4 4 4 s#t#} 1 ",
+" . . . 1 L+u#7#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#v#w#x#4 4 4 4 y#z#1 ",
+" . . . 1 L+A#B#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#C#D#E#4 4 4 4 4 F#G#H# ",
+" . . . 1 L+I#J#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#K#L#M#N#O#P#Q#4 R#1 ",
+" . . . 1 1 S#T#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#U#V#W#W#X#Y#Z#`# $ ",
+" . . . 1 1 L+P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.L+! } $.$+$ ",
+" . . . 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 H#| 1 ",
+" . . . ",
+" . . . ",
+" @$@$@$ ",
+" #$$$%$ . . . ",
+" &$&$&$*$ . . . . . ",
+" &$&$&$&$*$=$-$. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+" ;$>$&$&$*$,$-$. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+" '$'$'$'$'$)$)$'$'$'$'$'$ . !$~${$&$ . . . . ",
+" '$'$'$'$]$^$/$($'$_$:$/$<$[$)$'$'$'$ . . . }$ . . ",
+" '$'$'$'$|$1$2$3$4$5$6$6$7$8$9$0$'$'$'$'$ . . . . ",
+" a$'$b$_$c$d$e$f$g$h$4$4$4$4$h$6$i$j$k$l$m$b$'$a$ -$. . . ",
+" '$'$[$n$o$e$g$p$q$q$p$r$4$h$r$p$q$q$p$s$g$8$t$'$)$u$v$. -$. w$ w$x$ ",
+" '$'$<$y$z$A$B$C$C$A$D$g$E$F$G$H$I$J$K$B$C$C$I$L$M$N$)$O$P$Q$ x$x$ x$x$ ",
+" '$)$b$R$S$T$U$U$C$B$V$W$X$Y$Y$Z$Y$m$`$ %.%B$U$U$T$U$+%Z$@%#% x$x$x$ x$x$x$ ",
+" '$'$Z$$%%%%%%%%%&%*%=%<$b$'$'$'$'$'$'$)$[$-%;%>%%%%%%%U$,%0$b$'$ x$x$x$x$ x$x$x$x$ ",
+" '$'$'%)%U$S$S$%%!%~%{%]$'$'$'$'$ '$'$'$'$)$($c$]%.%S$S$%%^%0$b$'$ x$/%x$x$x$ x$x$x$x$x$ ",
+" '$'$]$(%%%&%_%:%<%[%}%'$'$ '$|%1%_$2%>%&%3%:%4%Z$'$'$ x$5%6%7%8%x$ x$x$9%0%9%/%x$ ",
+" '$[$a%3%b%c%:%d%_$b$'$ e%f%g%h%c%c%b%3%i%'$'$'$ x$8%j%k%l%m%x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$9%n%o%x$x$x$ ",
+" '$b$X$p%q%q%r%s%t%'$'$ -$u%v%w%^$x%y%q%q%z%A%)$'$ x$/%B%C%D%E%F%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%/%x$G%H%I%9%x$x$ ",
+" '$[$J%K%K%L%M%N%'$'$ . . -$O%P%'$Q%R%L%K%q%S%'$'$'$ x$x$T%U%V%D%W%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%X%Y%D%Z%`%x$x$x$ ",
+" '$[$a% &p%p% &.&'$'$ . . . . '$)$-%+&@&p%#&$&^$'$ x$/%T%%&V%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%&&*&x$/%x$ ",
+" '$'$Y$=&-&;&-&>&N$'$,& . . . . '$'$'&@&)&;&!&~&b$'$ x$/%{&]&D%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%W%^&W%/&(&x$x$ ",
+" '$b$_&:&<&<&[&}&b$'$ . . . . '$'$|&1&)&<&2&3&<$'$ 4&x$5&6&D%7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&7&W%8&9&/%x$4& ",
+" '$_$0&;&:&:&a&:$'$ . . . . '$]$b&c&:&d&e&-%)$a$ x$x$x$f&7&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&g&h&0%5&x$/% ",
+" '$'$X$i&j&k&l&m&]$'$ . . . . '$)$n&o&k&k&p&q&b$'$ x$x$r&s&t&t&h&t&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&u&t&h&t&C%0%v&x$/% ",
+" '$'$w&x&y&z&A&B&'$ . . . . '${%C&y&D&E&F&N$'$ x$/%j%G&H&I&J&K&L&L&L&L&L&L&L&L&L&L&L&L&L&L&L&L&L&L&L&L&s&M&h&N&O&m%x$/% ",
+" '$b$P&z&l&j&~%}%'$ . . . . '$]$Q&R&l&S&T&U&'$'$ /%/%V&G&W&/&X&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&Y&B%Z&`& */%x$/% ",
+" '$'$)$.*+*R&@*#*'$'$ . . . . '$'$}%$*R&R&%*&*'$'$ 4&x$9%**=*-*x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$x$9%f&O&/%x$/% ",
+" '$b$;*>*,*'*)*b$'$ . . . . '$'$'$'$'$^$!*'*,*~*{*'$'$'$'$'$'$ x$x$x$9&5%x$ x$x$x$]*^*x$/% ",
+" '$}%/*'*(*_*:*)$'$ . . . . '$'$'$'$N$<*'*(*'*[*'%N$'$'$'$ x$x$8%x$x$ x$x$8%x$/% ",
+" '$^$}*|*1*2*3*'$'$ . . . . '$'$b$4*5*6*1*7*8*9*'$'$'$ /%x$x$x$ x$x$x$/% ",
+" '$Q%0*a*b*|*~&'$'$ . . . . '$'$g%c*d*1*1*e*f*)$'$ /%x$x$ x$x$/% ",
+" '$/$g*h*i*j*|&'$'$ . . . . '$'$'$k*l*m*n*'$'$'$ x$x$ x$x$ ",
+" '${%o*p*q*r*m$'$'$ . . . . '$'$)$f*s*'$'$'$ x$ /% ",
+" '$'$t*t*t*u*N$'$'$ . . . . '$'$]$]$'$'$ ",
+" '$'$]$]$]$b$'$'$'$ . . . . '$'$'$ ",
+" '$'$'$'$'$'$'$'$ . . . . '$ ",
+" . . . . ",
+" . . . . ",
+" . . . . ",
+" . . . . ",
+" . . . . ",
+" . . . . . . ",
+" . . . . . . ",
+" . . . . . ",
+" . . . . . . ",
+" . . . . . . . ",
+" . . . . . ",
+" . . . ",
+" ",
+" "};
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_alt.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_alt.png
new file mode 100644
index 0000000000..cbfc4ed6cc
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_alt.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_ctrl.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_ctrl.png
new file mode 100644
index 0000000000..a5670bc077
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_ctrl.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_dash.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_dash.png
new file mode 100644
index 0000000000..e71a5194a1
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_dash.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_down.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_down.png
new file mode 100644
index 0000000000..14cdcc119c
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_down.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_left.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_left.png
new file mode 100644
index 0000000000..80d3c92233
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_left.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_plus.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_plus.png
new file mode 100644
index 0000000000..7bba5edd89
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_plus.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_right.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_right.png
new file mode 100644
index 0000000000..74dcb4af06
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_right.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_shift.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_shift.png
new file mode 100644
index 0000000000..7d64848a2a
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_shift.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/resources/key_up.png b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_up.png
new file mode 100644
index 0000000000..f651b67abb
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.geometrytools/resources/key_up.png differ
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.cpp b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.cpp
new file mode 100644
index 0000000000..ee781fb27e
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.cpp
@@ -0,0 +1,138 @@
+/*===================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center,
+Division of Medical and Biological Informatics.
+All rights reserved.
+
+This software is distributed WITHOUT ANY WARRANTY; without
+even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE.
+
+See LICENSE.txt or http://www.mitk.org for details.
+
+===================================================================*/
+
+
+//Blueberry
+#include
+#include
+
+//Qmitk
+#include "QmitkGeometryToolsView.h"
+
+//mitk
+#include
+#include
+
+//micro services
+#include
+#include
+
+const std::string QmitkGeometryToolsView::VIEW_ID = "org.mitk.views.geometrytools";
+
+void QmitkGeometryToolsView::SetFocus()
+{
+ m_Controls.m_AddInteractor->setFocus();
+}
+
+void QmitkGeometryToolsView::CreateQtPartControl( QWidget *parent )
+{
+ m_Controls.setupUi( parent );
+ connect( m_Controls.m_AddInteractor, SIGNAL(clicked()), this, SLOT(AddInteractor()) );
+ connect( m_Controls.m_RemoveInteractor, SIGNAL(clicked()), this, SLOT(RemoveInteractor()) );
+ connect( m_Controls.m_TranslationStep, SIGNAL(valueChanged(double)), this, SLOT(OnTranslationSpinBoxChanged(double)) );
+ connect( m_Controls.m_RotationStep, SIGNAL(valueChanged(double)), this, SLOT(OnRotationSpinBoxChanged(double)) );
+ connect( m_Controls.m_ScaleFactor, SIGNAL(valueChanged(double)), this, SLOT(OnScaleSpinBoxChanged(double)) );
+ connect( m_Controls.m_UsageInfoCheckBox, SIGNAL(clicked(bool)), this, SLOT(OnUsageInfoBoxChanged(bool)) );
+
+ m_Controls.m_UsageInfo->hide();
+}
+
+void QmitkGeometryToolsView::OnUsageInfoBoxChanged(bool flag)
+{
+ m_Controls.m_UsageInfo->setVisible(flag);
+}
+
+void QmitkGeometryToolsView::OnSelectionChanged( berry::IWorkbenchPart::Pointer /*source*/,
+ const QList& nodes )
+{
+ foreach( mitk::DataNode::Pointer node, nodes )
+ {
+ if( node.IsNotNull() )
+ {
+ m_Controls.m_AddInteractor->setEnabled( true );
+ return;
+ }
+ }
+ m_Controls.m_AddInteractor->setEnabled( false );
+}
+
+
+void QmitkGeometryToolsView::AddInteractor()
+{
+ QList nodes = this->GetDataManagerSelection();
+ foreach( mitk::DataNode::Pointer node, nodes )
+ {
+ if( node.IsNotNull() )
+ {
+ mitk::AffineDataInteractor3D::Pointer affineDataInteractor = mitk::AffineDataInteractor3D::New();
+ affineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ affineDataInteractor->SetEventConfig("AffineConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ affineDataInteractor->SetDataNode(node);
+ node->SetBoolProperty("pickable", true);
+ node->SetFloatProperty("AffineDataInteractor3D.Translation Step Size", m_Controls.m_TranslationStep->value());
+ node->SetFloatProperty("AffineDataInteractor3D.Rotation Step Size", m_Controls.m_RotationStep->value());
+ node->SetFloatProperty("AffineDataInteractor3D.Scale Step Size", m_Controls.m_ScaleFactor->value());
+ }
+ }
+}
+
+void QmitkGeometryToolsView::RemoveInteractor()
+{
+ QList nodes = this->GetDataManagerSelection();
+ foreach( mitk::DataNode::Pointer node, nodes )
+ {
+ if( (node.IsNotNull()) && (node->GetDataInteractor().IsNotNull()) )
+ {
+ node->SetDataInteractor(NULL);
+ }
+ }
+}
+
+void QmitkGeometryToolsView::OnTranslationSpinBoxChanged(double step)
+{
+ QList nodes = this->GetDataManagerSelection();
+ foreach( mitk::DataNode::Pointer node, nodes )
+ {
+ if( node.IsNotNull() && (node->GetDataInteractor().IsNotNull()) )
+ {
+ node->SetFloatProperty("AffineDataInteractor3D.Translation Step Size", step);
+ }
+ }
+}
+
+void QmitkGeometryToolsView::OnRotationSpinBoxChanged(double step)
+{
+ QList nodes = this->GetDataManagerSelection();
+ foreach( mitk::DataNode::Pointer node, nodes )
+ {
+ if( node.IsNotNull() && (node->GetDataInteractor().IsNotNull()) )
+ {
+ node->SetFloatProperty("AffineDataInteractor3D.Rotation Step Size", step);
+ }
+ }
+}
+
+void QmitkGeometryToolsView::OnScaleSpinBoxChanged(double factor)
+{
+ QList nodes = this->GetDataManagerSelection();
+ foreach( mitk::DataNode::Pointer node, nodes )
+ {
+ if( node.IsNotNull() && (node->GetDataInteractor().IsNotNull()) )
+ {
+ node->SetFloatProperty("AffineDataInteractor3D.Scale Step Size", factor);
+ }
+ }
+}
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h
new file mode 100644
index 0000000000..98bc50632e
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h
@@ -0,0 +1,85 @@
+/*===================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center,
+Division of Medical and Biological Informatics.
+All rights reserved.
+
+This software is distributed WITHOUT ANY WARRANTY; without
+even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE.
+
+See LICENSE.txt or http://www.mitk.org for details.
+
+===================================================================*/
+
+
+#ifndef QmitkGeometryToolsView_h
+#define QmitkGeometryToolsView_h
+
+#include
+
+#include
+#include
+
+#include "ui_QmitkGeometryToolsViewControls.h"
+
+/**
+ \brief QmitkGeometryToolsView to modify geometry of mitkBaseData via interaction.
+
+ \warning This is an experimental view to play with the geometry of all mitkBaseDatas.
+ The current implementation allows to translate, rotate and scale objects with the
+ keyboard.
+
+ \warning Scaling is not supported for images, yet, and will not happen in coordinate origin.
+ \warning Surfaces
+
+ \sa QmitkAbstractView
+ \ingroup ${plugin_target}_internal
+*/
+class QmitkGeometryToolsView : public QmitkAbstractView
+{
+ // this is needed for all Qt objects that should have a Qt meta-object
+ // (everything that derives from QObject and wants to have signal/slots)
+ Q_OBJECT
+
+ public:
+
+ static const std::string VIEW_ID;
+
+protected slots:
+
+ /**
+ * @brief Add/remove the affine interactor.
+ */
+ void AddInteractor();
+ void RemoveInteractor();
+
+ /**
+ * @brief Slots to adapt the step size for interaction.
+ */
+ void OnRotationSpinBoxChanged(double step);
+ void OnScaleSpinBoxChanged(double factor);
+ void OnTranslationSpinBoxChanged(double step);
+
+ /**
+ * @brief OnUsageInfoBoxChanged show help.
+ * @param flag yes/no.
+ */
+ void OnUsageInfoBoxChanged(bool flag);
+
+ protected:
+
+ virtual void CreateQtPartControl(QWidget *parent);
+
+ virtual void SetFocus();
+
+ /// \brief called by QmitkFunctionality when DataManager's selection has changed
+ virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
+ const QList& nodes );
+
+ Ui::QmitkGeometryToolsViewControls m_Controls;
+};
+
+#endif // QmitkGeometryToolsView_h
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsViewControls.ui b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsViewControls.ui
new file mode 100644
index 0000000000..346390e752
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsViewControls.ui
@@ -0,0 +1,408 @@
+
+
+ QmitkGeometryToolsViewControls
+
+
+
+ 0
+ 0
+ 372
+ 607
+
+
+
+
+ 0
+ 0
+
+
+
+ QmitkTemplate
+
+
+ -
+
+
+ Keyboard Mode (default)
+
+
+
+ -
+
+
+ Remove Interactor
+
+
+
+ -
+
+
+ Mouse Mode (not implemented, yet)
+
+
+
+ -
+
+
+ Rotation step size (°)
+
+
+
+ -
+
+
+ 360.000000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ Scale factor (%)
+
+
+
+ -
+
+
+ 200.000000000000000
+
+
+ 0.100000000000000
+
+
+ 0.100000000000000
+
+
+
+ -
+
+
+ Scale in origin (not implemented, yet)
+
+
+ true
+
+
+
+ -
+
+
+ Show usage information
+
+
+
+ -
+
+
+
-
+
+
-
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_up.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_shift.png
+
+
+
+ -
+
+
+ +
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_up.png
+
+
+
+ -
+
+
+ +
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_right.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_left.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_up.png
+
+
+
+ -
+
+
+ +
+
+
+
+ -
+
+
+ <html><head/><body><p>Translate <br/>Coronal</p></body></html>
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_down.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_ctrl.png
+
+
+
+ -
+
+
+ <html><head/><body><p>Rotate <br/>Coronal</p></body></html>
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_ctrl.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_down.png
+
+
+
+ -
+
+
+ <html><head/><body><p>Rotate <br/>Sagittal/Axial</p></body></html>
+
+
+
+ -
+
+
+ +
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_down.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_down.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_down.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_shift.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_up.png
+
+
+
+ -
+
+
+ <html><head/><body><p>Translate <br/>Sagittal/Axial</p></body></html>
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_left.png
+
+
+
+ -
+
+
+ Scale*
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_plus.png
+
+
+
+ -
+
+
+
+
+
+ :/org.mitk.gui.qt.geometrytools/resources/key_dash.png
+
+
+
+
+
+ -
+
+
+ *currently does not work with images
+
+
+
+
+
+
+ -
+
+
+ Do image processing
+
+
+ Add Interactor
+
+
+
+ -
+
+
+ Translation step size (mm)
+
+
+
+ -
+
+
+ 2
+
+
+ 1000.000000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/org_mitk_gui_qt_geometrytools_Activator.cpp b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/org_mitk_gui_qt_geometrytools_Activator.cpp
new file mode 100644
index 0000000000..1f87bea92f
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/org_mitk_gui_qt_geometrytools_Activator.cpp
@@ -0,0 +1,40 @@
+/*===================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center,
+Division of Medical and Biological Informatics.
+All rights reserved.
+
+This software is distributed WITHOUT ANY WARRANTY; without
+even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE.
+
+See LICENSE.txt or http://www.mitk.org for details.
+
+===================================================================*/
+
+
+#include "org_mitk_gui_qt_geometrytools_Activator.h"
+
+#include
+
+#include "QmitkGeometryToolsView.h"
+
+namespace mitk {
+
+void org_mitk_gui_qt_geometrytools_Activator::start(ctkPluginContext* context)
+{
+ BERRY_REGISTER_EXTENSION_CLASS(QmitkGeometryToolsView, context)
+}
+
+void org_mitk_gui_qt_geometrytools_Activator::stop(ctkPluginContext* context)
+{
+ Q_UNUSED(context)
+}
+
+}
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ Q_EXPORT_PLUGIN2(org_mitk_gui_qt_geometrytools, mitk::org_mitk_gui_qt_geometrytools_Activator)
+#endif
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/org_mitk_gui_qt_geometrytools_Activator.h b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/org_mitk_gui_qt_geometrytools_Activator.h
new file mode 100644
index 0000000000..324aff00a6
--- /dev/null
+++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/org_mitk_gui_qt_geometrytools_Activator.h
@@ -0,0 +1,43 @@
+/*===================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center,
+Division of Medical and Biological Informatics.
+All rights reserved.
+
+This software is distributed WITHOUT ANY WARRANTY; without
+even the implied warranty of MERCHANTABILITY or FITNESS FOR
+A PARTICULAR PURPOSE.
+
+See LICENSE.txt or http://www.mitk.org for details.
+
+===================================================================*/
+
+
+#ifndef org_mitk_gui_qt_geometrytools_Activator_h
+#define org_mitk_gui_qt_geometrytools_Activator_h
+
+#include
+
+namespace mitk {
+
+class org_mitk_gui_qt_geometrytools_Activator :
+ public QObject, public ctkPluginActivator
+{
+ Q_OBJECT
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+ Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_geometrytools")
+#endif
+ Q_INTERFACES(ctkPluginActivator)
+
+public:
+
+ void start(ctkPluginContext* context);
+ void stop(ctkPluginContext* context);
+
+}; // org_mitk_gui_qt_geometrytools_Activator
+
+}
+
+#endif // org_mitk_gui_qt_geometrytools_Activator_h
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp
index 1c779e3099..027b2ce3ed 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.cpp
@@ -1,633 +1,633 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDeformableClippingPlaneView.h"
-#include "mitkAffineDataInteractor3D.h"
+#include "mitkClippingPlaneInteractor3D.h"
#include "mitkHeightFieldSurfaceClipImageFilter.h"
#include "mitkImageToSurfaceFilter.h"
#include "mitkInteractionConst.h"
#include "mitkLabeledImageLookupTable.h"
#include "mitkLabeledImageVolumeCalculator.h"
#include "mitkLevelWindowProperty.h"
#include "mitkLookupTableProperty.h"
#include "mitkNodePredicateProperty.h"
#include "mitkNodePredicateDataType.h"
#include "mitkRenderingModeProperty.h"
#include "mitkRotationOperation.h"
#include "mitkSurfaceDeformationDataInteractor3D.h"
#include "mitkSurfaceVtkMapper3D.h"
#include "mitkVtkRepresentationProperty.h"
#include "usModuleRegistry.h"
#include "vtkFloatArray.h"
#include "vtkPointData.h"
#include "vtkProperty.h"
#include
const std::string QmitkDeformableClippingPlaneView::VIEW_ID = "org.mitk.views.deformableclippingplane";
QmitkDeformableClippingPlaneView::QmitkDeformableClippingPlaneView()
: QmitkFunctionality()
, m_MultiWidget(NULL)
, m_ReferenceNode(NULL)
, m_WorkingNode(NULL)
{
}
QmitkDeformableClippingPlaneView::~QmitkDeformableClippingPlaneView()
{
}
void QmitkDeformableClippingPlaneView::CreateQtPartControl(QWidget *parent)
{
// create GUI widgets
m_Controls.setupUi(parent);
this->CreateConnections();
}
void QmitkDeformableClippingPlaneView::StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget)
{
m_MultiWidget = &stdMultiWidget;
}
void QmitkDeformableClippingPlaneView::StdMultiWidgetNotAvailable()
{
m_MultiWidget = NULL;
}
void QmitkDeformableClippingPlaneView::CreateConnections()
{
mitk::NodePredicateProperty::Pointer clipPredicate = mitk::NodePredicateProperty::New("clippingPlane",mitk::BoolProperty::New(true));
//set only clipping planes in the list of the selector
m_Controls.clippingPlaneSelector->SetDataStorage(this->GetDefaultDataStorage());
m_Controls.clippingPlaneSelector->SetPredicate(clipPredicate);
//No working data set, yet
m_Controls.volumeGroupBox->setEnabled(false);
m_Controls.interactionSelectionBox->setEnabled(false);
m_Controls.noSelectedImageLabel->show();
m_Controls.planesWarningLabel->hide();
connect (m_Controls.translationPushButton, SIGNAL(toggled(bool)), this, SLOT(OnTranslationMode(bool)));
connect (m_Controls.rotationPushButton, SIGNAL(toggled(bool)), this, SLOT(OnRotationMode(bool)));
connect (m_Controls.deformationPushButton, SIGNAL(toggled(bool)), this, SLOT(OnDeformationMode(bool)));
connect (m_Controls.createNewPlanePushButton, SIGNAL(clicked()), this, SLOT(OnCreateNewClippingPlane()));
connect (m_Controls.updateVolumePushButton, SIGNAL(clicked()), this, SLOT(OnCalculateClippingVolume()));
connect (m_Controls.clippingPlaneSelector, SIGNAL(OnSelectionChanged(const mitk::DataNode*)),
this, SLOT(OnComboBoxSelectionChanged(const mitk::DataNode*)));
}
void QmitkDeformableClippingPlaneView::Activated()
{
QmitkFunctionality::Activated();
//If a tube graph already exist in the data storage, set the working node correctly
m_WorkingNode = m_Controls.clippingPlaneSelector->GetSelectedNode();
this->UpdateView();
}
void QmitkDeformableClippingPlaneView::Deactivated()
{
if(m_WorkingNode.IsNotNull())
{
if(m_WorkingNode->GetDataInteractor().IsNotNull())
m_WorkingNode->SetDataInteractor(NULL);
}
QmitkFunctionality::Deactivated();
}
void QmitkDeformableClippingPlaneView::OnComboBoxSelectionChanged( const mitk::DataNode* node )
{
this->DeactivateInteractionButtons();
mitk::DataNode* selectedNode = const_cast(node);
if( selectedNode != NULL )
{
if(m_WorkingNode.IsNotNull())
selectedNode->SetDataInteractor(m_WorkingNode->GetDataInteractor());
m_WorkingNode = selectedNode;
}
this->UpdateView();
}
void QmitkDeformableClippingPlaneView::OnSelectionChanged(mitk::DataNode* node)
{
std::vector nodes;
nodes.push_back(node);
this->OnSelectionChanged(nodes);
}
void QmitkDeformableClippingPlaneView::OnSelectionChanged(std::vector nodes)
{
bool isClippingPlane(false);
for(unsigned int i = 0; i < nodes.size(); ++i)
{
if(nodes.at(i)->GetBoolProperty("clippingPlane", isClippingPlane))
m_Controls.clippingPlaneSelector->setCurrentIndex( m_Controls.clippingPlaneSelector->Find(nodes.at(i)) );
else
{
if(dynamic_cast (nodes.at(i)->GetData())&& nodes.at(i))
{
if(m_ReferenceNode.IsNotNull() && nodes.at(i)->GetData() == m_ReferenceNode->GetData())
return;
m_ReferenceNode =nodes.at(i);
}
}
}
this->UpdateView();
}
void::QmitkDeformableClippingPlaneView::NodeChanged(const mitk::DataNode* /*node*/)
{
this->UpdateView();
}
void QmitkDeformableClippingPlaneView::NodeRemoved(const mitk::DataNode* node)
{
bool isClippingPlane(false);
if (node->GetBoolProperty("clippingPlane", isClippingPlane))
{
if(this->GetAllClippingPlanes()->Size()<=1)
{
m_WorkingNode = NULL;
this->UpdateView();
}
else
{
if (GetAllClippingPlanes()->front()!= node)
this->OnSelectionChanged(GetAllClippingPlanes()->front());
else
this->OnSelectionChanged(GetAllClippingPlanes()->ElementAt(1));
}
}
else
{
if(m_ReferenceNode.IsNotNull())
{
if(node->GetData() == m_ReferenceNode->GetData())
{
m_ReferenceNode = NULL;
m_Controls.volumeList->clear();
}
this->UpdateView();
}
}
}
void QmitkDeformableClippingPlaneView::UpdateView()
{
if (m_ReferenceNode.IsNotNull())
{
m_Controls.noSelectedImageLabel->hide();
m_Controls.selectedImageLabel->setText(QString::fromUtf8(m_ReferenceNode->GetName().c_str()));
if (m_WorkingNode.IsNotNull())
{
bool isSegmentation(false);
m_ReferenceNode->GetBoolProperty("binary", isSegmentation);
m_Controls.interactionSelectionBox->setEnabled(true);
m_Controls.volumeGroupBox->setEnabled(isSegmentation);
//clear list --> than search for all shown clipping plans (max 7 planes)
m_Controls.selectedVolumePlanesLabel->setText("");
m_Controls.planesWarningLabel->hide();
int volumePlanes=0;
mitk::DataStorage::SetOfObjects::ConstPointer allClippingPlanes = this->GetAllClippingPlanes();
for (mitk::DataStorage::SetOfObjects::ConstIterator itPlanes = allClippingPlanes->Begin(); itPlanes != allClippingPlanes->End(); itPlanes++)
{
bool isVisible(false);
itPlanes.Value()->GetBoolProperty("visible",isVisible);
if (isVisible)
{
if (volumePlanes<7)
{
volumePlanes ++;
m_Controls.selectedVolumePlanesLabel->setText(m_Controls.selectedVolumePlanesLabel->text().append(QString::fromStdString(itPlanes.Value()->GetName()+"\n")));
}
else
{
m_Controls.planesWarningLabel->show();
return;
}
}
}
}
else
{
m_Controls.volumeGroupBox->setEnabled(false);
m_Controls.interactionSelectionBox->setEnabled(false);
m_Controls.selectedVolumePlanesLabel->setText("");
m_Controls.volumeList->clear();
}
}
else
{
m_Controls.volumeGroupBox->setEnabled(false);
m_Controls.noSelectedImageLabel->show();
m_Controls.selectedImageLabel->setText("");
m_Controls.selectedVolumePlanesLabel->setText("");
m_Controls.planesWarningLabel->hide();
if(m_WorkingNode.IsNull())
m_Controls.interactionSelectionBox->setEnabled(false);
else
m_Controls.interactionSelectionBox->setEnabled(true);
}
}
void QmitkDeformableClippingPlaneView::OnCreateNewClippingPlane()
{
this->DeactivateInteractionButtons();
//the new clipping plane
mitk::Surface::Pointer plane = mitk::Surface::New();
mitk::Image::Pointer referenceImage = mitk::Image::New();
vtkSmartPointer planeSource = vtkSmartPointer::New();
// default initialization of the clipping plane
planeSource->SetOrigin( -32.0, -32.0, 0.0 );
planeSource->SetPoint1( 32.0, -32.0, 0.0 );
planeSource->SetPoint2( -32.0, 32.0, 0.0 );
planeSource->SetResolution( 128, 128 );
planeSource->Update();
plane->SetVtkPolyData(planeSource->GetOutput());
double imageDiagonal = 200;
if (m_ReferenceNode.IsNotNull())
{
referenceImage = dynamic_cast (m_ReferenceNode->GetData());
if (referenceImage.IsNotNull())
{
// check if user wants a surface model
if(m_Controls.surfaceModelCheckBox->isChecked())
{
//Check if there is a surface node from the image. If not, create one
bool createSurfaceFromImage(true);
mitk::NodePredicateDataType::Pointer isDwi = mitk::NodePredicateDataType::New("DiffusionImage");
mitk::NodePredicateDataType::Pointer isSurface = mitk::NodePredicateDataType::New("Surface");
mitk::DataStorage::SetOfObjects::ConstPointer childNodes = GetDataStorage()->GetDerivations(m_ReferenceNode,isSurface, true);
for (mitk::DataStorage::SetOfObjects::ConstIterator itChildNodes = childNodes->Begin();
itChildNodes != childNodes->End(); itChildNodes++)
{
if (itChildNodes.Value().IsNotNull())
createSurfaceFromImage=false;
}
if(createSurfaceFromImage)
{
//Lsg 2: Surface for the 3D-perspective
mitk::ImageToSurfaceFilter::Pointer surfaceFilter = mitk::ImageToSurfaceFilter::New();
surfaceFilter->SetInput(referenceImage);
surfaceFilter->SetThreshold(1);
surfaceFilter->SetSmooth(true);
//Downsampling
surfaceFilter->SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro);
mitk::DataNode::Pointer surfaceNode = mitk::DataNode::New();
surfaceNode->SetData(surfaceFilter->GetOutput());
surfaceNode->SetProperty("color", m_ReferenceNode->GetProperty("color"));
surfaceNode->SetOpacity(0.5);
surfaceNode->SetName(m_ReferenceNode->GetName());
GetDataStorage()->Add(surfaceNode, m_ReferenceNode);
}
}
//If an image is selected trim the plane to this.
imageDiagonal = referenceImage->GetGeometry()->GetDiagonalLength();
plane->SetOrigin( referenceImage->GetGeometry()->GetCenter());
// Rotate plane
mitk::Vector3D rotationAxis;
mitk::FillVector3D(rotationAxis, 0.0, 1.0, 0.0);
mitk::RotationOperation op(mitk::OpROTATE, referenceImage->GetGeometry()->GetCenter(), rotationAxis, 90.0);
plane->GetGeometry()->ExecuteOperation(&op);
}
}
//set some properties for the clipping plane
// plane->SetExtent(imageDiagonal * 0.9, imageDiagonal * 0.9);
// plane->SetResolution(64, 64);
// eequivalent to the extent and resolution function of the clipping plane
const double x = imageDiagonal * 0.9;
planeSource->SetOrigin( -x / 2.0, -x / 2.0, 0.0 );
planeSource->SetPoint1( x / 2.0, -x / 2.0, 0.0 );
planeSource->SetPoint2( -x / 2.0, x / 2.0, 0.0 );
planeSource->SetResolution( 64, 64 );
planeSource->Update();
plane->SetVtkPolyData(planeSource->GetOutput());
// Set scalars (for colorization of plane)
vtkFloatArray *scalars = vtkFloatArray::New();
scalars->SetName("Distance");
scalars->SetNumberOfComponents(1);
for ( unsigned int i = 0; i < plane->GetVtkPolyData(0)->GetNumberOfPoints(); ++i)
{
scalars->InsertNextValue(-1.0);
}
plane->GetVtkPolyData(0)->GetPointData()->SetScalars(scalars);
plane->GetVtkPolyData(0)->GetPointData()->Update();
mitk::DataNode::Pointer planeNode = mitk::DataNode::New();
planeNode->SetData(plane);
std::stringstream planeName;
planeName << "ClippingPlane ";
planeName << this->GetAllClippingPlanes()->Size() + 1;
planeNode->SetName(planeName.str());
planeNode->AddProperty("clippingPlane",mitk::BoolProperty::New(true));
// Make plane pickable
planeNode->SetBoolProperty("pickable", true);
mitk::SurfaceVtkMapper3D::SetDefaultProperties(planeNode);
// Don't include plane in bounding box!
planeNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
// Set lookup table for plane surface visualization
vtkSmartPointer lookupTable = vtkSmartPointer::New();
lookupTable->SetHueRange(0.6, 0.0);
lookupTable->SetSaturationRange(1.0, 1.0);
lookupTable->SetValueRange(1.0, 1.0);
lookupTable->SetTableRange(-1.0, 1.0);
lookupTable->Build();
mitk::LookupTable::Pointer lut = mitk::LookupTable::New();
lut->SetVtkLookupTable(lookupTable);
mitk::LookupTableProperty::Pointer prop = mitk::LookupTableProperty::New(lut);
planeNode->SetProperty("LookupTable", prop);
planeNode->SetBoolProperty("scalar visibility", true);
planeNode->SetBoolProperty("color mode", true);
planeNode->SetFloatProperty("ScalarsRangeMinimum", -1.0);
planeNode->SetFloatProperty("ScalarsRangeMaximum", 1.0);
// Configure material so that only scalar colors are shown
planeNode->SetColor(0.0f,0.0f,0.0f);
planeNode->SetOpacity(1.0f);
planeNode->SetFloatProperty("material.wireframeLineWidth",2.0f);
//Set view of plane to wireframe
planeNode->SetProperty("material.representation", mitk::VtkRepresentationProperty::New(VTK_WIREFRAME));
//Set the plane as working data for the tools and selected it
this->OnSelectionChanged (planeNode);
//Add the plane to data storage
this->GetDataStorage()->Add(planeNode);
//Change the index of the selector to the new generated node
m_Controls.clippingPlaneSelector->setCurrentIndex( m_Controls.clippingPlaneSelector->Find(planeNode) );
m_Controls.interactionSelectionBox->setEnabled(true);
// set crosshair invisible
mitk::DataNode* dataNode;
dataNode = this->m_MultiWidget->GetWidgetPlane1();
if(dataNode) dataNode->SetVisibility(false);
dataNode = this->m_MultiWidget->GetWidgetPlane2();
if(dataNode) dataNode->SetVisibility(false);
dataNode = this->m_MultiWidget->GetWidgetPlane3();
if(dataNode) dataNode->SetVisibility(false);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkDeformableClippingPlaneView::OnCalculateClippingVolume()
{
bool isSegmentation(false);
m_ReferenceNode->GetBoolProperty("binary", isSegmentation);
if(m_ReferenceNode.IsNull() || !isSegmentation)
{
MITK_ERROR << "No segmentation selected! Can't calculate volume";
return;
}
std::vector clippingPlanes;
mitk::DataStorage::SetOfObjects::ConstPointer allClippingPlanes = this->GetAllClippingPlanes();
for (mitk::DataStorage::SetOfObjects::ConstIterator itPlanes = allClippingPlanes->Begin(); itPlanes != allClippingPlanes->End(); itPlanes++)
{
bool isVisible(false);
itPlanes.Value()->GetBoolProperty("visible",isVisible);
mitk::Surface* plane = dynamic_cast(itPlanes.Value()->GetData());
if (isVisible && plane)
clippingPlanes.push_back(plane);
}
if (clippingPlanes.empty())
{
MITK_ERROR << "No clipping plane selected! Can't calculate volume";
return;
}
// deactivate Tools
this->DeactivateInteractionButtons();
//Clear the list of volumes, before calculating the new values
m_Controls.volumeList->clear();
m_ReferenceNode->SetBoolProperty("visible", false);
//set some properties for clipping the image-->Output: labled Image
mitk::HeightFieldSurfaceClipImageFilter::Pointer surfaceClipFilter = mitk::HeightFieldSurfaceClipImageFilter::New();
surfaceClipFilter->SetInput(dynamic_cast (m_ReferenceNode->GetData()));
surfaceClipFilter->SetClippingModeToMultiPlaneValue();
surfaceClipFilter->SetClippingSurfaces(clippingPlanes);
surfaceClipFilter->Update();
//delete the old clipped image node
mitk::DataStorage::SetOfObjects::ConstPointer oldClippedNode = this->GetDataStorage()->GetSubset(mitk::NodePredicateProperty::New("name", mitk::StringProperty::New("Clipped Image")));
if (oldClippedNode.IsNotNull())
this->GetDataStorage()->Remove(oldClippedNode);
//add the new clipped image node
mitk::DataNode::Pointer clippedNode = mitk::DataNode::New();
mitk::Image::Pointer clippedImage = surfaceClipFilter->GetOutput();
clippedImage->DisconnectPipeline();
clippedNode->SetData(clippedImage);
//clippedNode->SetProperty("helper object", mitk::BoolProperty::New(true));
clippedNode->SetName("Clipped Image");
clippedNode->SetColor(1.0,1.0,1.0); // color property will not be used, labeled image lookuptable will be used instead
clippedNode->SetProperty ("use color", mitk::BoolProperty::New(false));
clippedNode->SetOpacity(0.4);
this->GetDataStorage()->Add(clippedNode);
mitk::LabeledImageVolumeCalculator::Pointer volumeCalculator = mitk::LabeledImageVolumeCalculator::New();
volumeCalculator->SetImage(clippedImage);
volumeCalculator->Calculate();
std::vector volumes = volumeCalculator->GetVolumes();
mitk::LabeledImageLookupTable::Pointer lut = mitk::LabeledImageLookupTable::New();
int lablesWithVolume=0;
for(unsigned int i = 1; i < volumes.size(); ++i)
{
if(volumes.at(i)!=0)
{
lablesWithVolume++;
mitk::Color color (GetLabelColor(lablesWithVolume));
lut->SetColorForLabel(i,color.GetRed(), color.GetGreen(), color.GetBlue(), 1.0);
QColor qcolor;
qcolor.setRgbF(color.GetRed(), color.GetGreen(), color.GetBlue(), 0.7);
//output volume as string "x.xx ml"
std::stringstream stream;
stream<< std::fixed << std::setprecision(2)<setText(QString::fromStdString(stream.str()));
item->setBackgroundColor(qcolor);
m_Controls.volumeList->addItem(item);
}
}
//set the rendering mode to use the lookup table and level window
clippedNode->SetProperty("Image Rendering.Mode", mitk::RenderingModeProperty::New(mitk::RenderingModeProperty::LOOKUPTABLE_LEVELWINDOW_COLOR));
mitk::LookupTableProperty::Pointer lutProp = mitk::LookupTableProperty::New(lut.GetPointer());
clippedNode->SetProperty("LookupTable", lutProp);
// it is absolutely important, to use the LevelWindow settings provided by
// the LUT generator, otherwise, it is not guaranteed, that colors show
// up correctly.
clippedNode->SetProperty("levelwindow", mitk::LevelWindowProperty::New(lut->GetLevelWindow()));
}
mitk::DataStorage::SetOfObjects::ConstPointer QmitkDeformableClippingPlaneView::GetAllClippingPlanes()
{
mitk::NodePredicateProperty::Pointer clipPredicate= mitk::NodePredicateProperty::New("clippingPlane",mitk::BoolProperty::New(true));
mitk::DataStorage::SetOfObjects::ConstPointer allPlanes = GetDataStorage()->GetSubset(clipPredicate);
return allPlanes;
}
mitk::Color QmitkDeformableClippingPlaneView::GetLabelColor(int label)
{
float red, green, blue;
switch ( label % 6 )
{
case 0:
{red = 1.0; green = 0.0; blue = 0.0; break;}
case 1:
{red = 0.0; green = 1.0; blue = 0.0; break;}
case 2:
{red = 0.0; green = 0.0; blue = 1.0;break;}
case 3:
{red = 1.0; green = 1.0; blue = 0.0;break;}
case 4:
{red = 1.0; green = 0.0; blue = 1.0;break;}
case 5:
{red = 0.0; green = 1.0; blue = 1.0;break;}
default:
{red = 0.0; green = 0.0; blue = 0.0;}
}
float tmp[3] = { red, green, blue };
double factor;
int outerCycleNr = label / 6;
int cycleSize = pow(2.0,(int)(log((double)(outerCycleNr))/log( 2.0 )));
if (cycleSize==0)
cycleSize = 1;
int insideCycleCounter = outerCycleNr % cycleSize;
if ( outerCycleNr == 0)
factor = 255;
else
factor = ( 256 / ( 2 * cycleSize ) ) + ( insideCycleCounter * ( 256 / cycleSize ) );
tmp[0]= tmp[0]/256*factor;
tmp[1]= tmp[1]/256*factor;
tmp[2]= tmp[2]/256*factor;
return mitk::Color(tmp);
}
void QmitkDeformableClippingPlaneView::OnTranslationMode(bool check)
{
if(check)
{ //uncheck all other buttons
m_Controls.rotationPushButton->setChecked(false);
m_Controls.deformationPushButton->setChecked(false);
- mitk::AffineDataInteractor3D::Pointer affineDataInteractor = mitk::AffineDataInteractor3D::New();
- affineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
- affineDataInteractor->SetEventConfig("AffineTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ mitk::ClippingPlaneInteractor3D::Pointer affineDataInteractor = mitk::ClippingPlaneInteractor3D::New();
+ affineDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ affineDataInteractor->SetEventConfig("ClippingPlaneTranslationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
affineDataInteractor->SetDataNode(m_WorkingNode);
}
else
m_WorkingNode->SetDataInteractor(NULL);
}
void QmitkDeformableClippingPlaneView::OnRotationMode(bool check)
{
if(check)
{ //uncheck all other buttons
m_Controls.translationPushButton->setChecked(false);
m_Controls.deformationPushButton->setChecked(false);
- mitk::AffineDataInteractor3D::Pointer affineDataInteractor = mitk::AffineDataInteractor3D::New();
- affineDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
- affineDataInteractor->SetEventConfig("AffineRotationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ mitk::ClippingPlaneInteractor3D::Pointer affineDataInteractor = mitk::ClippingPlaneInteractor3D::New();
+ affineDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ affineDataInteractor->SetEventConfig("ClippingPlaneRotationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
affineDataInteractor->SetDataNode(m_WorkingNode);
}
else
m_WorkingNode->SetDataInteractor(NULL);
}
void QmitkDeformableClippingPlaneView::OnDeformationMode(bool check)
{
if(check)
{ //uncheck all other buttons
m_Controls.translationPushButton->setChecked(false);
m_Controls.rotationPushButton->setChecked(false);
mitk::SurfaceDeformationDataInteractor3D::Pointer surfaceDataInteractor = mitk::SurfaceDeformationDataInteractor3D::New();
- surfaceDataInteractor->LoadStateMachine("AffineInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
- surfaceDataInteractor->SetEventConfig("AffineDeformationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ surfaceDataInteractor->LoadStateMachine("ClippingPlaneInteraction3D.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
+ surfaceDataInteractor->SetEventConfig("ClippingPlaneDeformationConfig.xml", us::ModuleRegistry::GetModule("MitkDataTypesExt"));
surfaceDataInteractor->SetDataNode(m_WorkingNode);
}
else
m_WorkingNode->SetDataInteractor(NULL);
}
void QmitkDeformableClippingPlaneView::DeactivateInteractionButtons()
{
m_Controls.translationPushButton->setChecked(false);
m_Controls.rotationPushButton->setChecked(false);
m_Controls.deformationPushButton->setChecked(false);
}