diff --git a/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.cpp b/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.cpp index 7041340a70..57f9789205 100644 --- a/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.cpp +++ b/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.cpp @@ -1,136 +1,166 @@ /*=================================================================== 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 "mitkDisplayVectorInteractorLevelWindow.h" #include "mitkOperation.h" #include "mitkDisplayCoordinateOperation.h" #include "mitkStateEvent.h" #include "mitkInteractionConst.h" #include "mitkAction.h" #include "mitkStandaloneDataStorage.h" #include "mitkNodePredicateDataType.h" #include "mitkLevelWindowProperty.h" #include "mitkLevelWindow.h" void mitk::DisplayVectorInteractorLevelWindow::ExecuteOperation(Operation* itkNotUsed( operation ) ) { } bool mitk::DisplayVectorInteractorLevelWindow::ExecuteAction(Action* action, mitk::StateEvent const* stateEvent) { bool ok=false; const DisplayPositionEvent* posEvent=dynamic_cast(stateEvent->GetEvent()); if(posEvent==NULL) return false; int actionId = action->GetActionId(); switch(actionId) { case AcINITMOVE: // MITK_INFO << "AcINITMOVE"; { m_Sender=posEvent->GetSender(); m_StartDisplayCoordinate=posEvent->GetDisplayPosition(); m_LastDisplayCoordinate=posEvent->GetDisplayPosition(); m_CurrentDisplayCoordinate=posEvent->GetDisplayPosition(); ok = true; break; } case AcLEVELWINDOW: { this->InvokeEvent( StartInteractionEvent() ); m_LastDisplayCoordinate=m_CurrentDisplayCoordinate; m_CurrentDisplayCoordinate=posEvent->GetDisplayPosition(); mitk::DataStorage::Pointer storage = m_Sender->GetDataStorage(); mitk::DataNode::Pointer node = NULL; mitk::DataStorage::SetOfObjects::ConstPointer allImageNodes = storage->GetSubset(mitk::NodePredicateDataType::New( "Image") ); for ( unsigned int i = 0; i < allImageNodes->size() ; i++ ) { bool isActiveImage = false; bool propFound = allImageNodes->at( i )->GetBoolProperty( "imageForLevelWindow", isActiveImage ); if ( propFound && isActiveImage ) { node = allImageNodes->at( i ); continue; } } if ( node.IsNull() ) { node = storage->GetNode( mitk::NodePredicateDataType::New( "Image" ) ); } if ( node.IsNull() ) { return false; } - mitk::LevelWindow lv = mitk::LevelWindow(); node->GetLevelWindow(lv); ScalarType level = lv.GetLevel(); ScalarType window = lv.GetWindow(); - level += ( m_CurrentDisplayCoordinate[0] - m_LastDisplayCoordinate[0] )*static_cast(2); - window += ( m_CurrentDisplayCoordinate[1] - m_LastDisplayCoordinate[1] )*static_cast(2); + // determine which index shall be used for level and which one for window + int levelIndex = m_HorizontalLevelling ? 0 : 1; + int windowIndex = m_HorizontalLevelling ? 1 : 0; + + // determine if one these is supposed to be inverted + Point2D invertModifier; + invertModifier[levelIndex] = m_InvertLevel ? -1 : 1; + invertModifier[windowIndex] = m_InvertWindow ? -1 : 1; + + // difference of the two positions + // *2 to make interaction faster + // *inverModifier to handle inverted interactionscheme + level += ( m_CurrentDisplayCoordinate[levelIndex] - m_LastDisplayCoordinate[levelIndex] )* static_cast(2) * invertModifier[levelIndex]; + window += ( m_CurrentDisplayCoordinate[windowIndex] - m_LastDisplayCoordinate[windowIndex] )* static_cast(2) * invertModifier[windowIndex]; lv.SetLevelWindow( level, window ); dynamic_cast(node->GetProperty("levelwindow"))->SetLevelWindow( lv ); m_Sender->GetRenderingManager()->RequestUpdateAll(); ok = true; break; } case AcFINISHMOVE: // MITK_INFO << "AcFINISHMOVE"; { ok = true; this->InvokeEvent( EndInteractionEvent() ); break; } default: ok = false; break; } return ok; } mitk::DisplayVectorInteractorLevelWindow::DisplayVectorInteractorLevelWindow(const char * type) - : mitk::StateMachine(type), m_Sender(NULL) + : mitk::StateMachine(type) + , m_Sender(NULL) + , m_HorizontalLevelling( false ) + , m_InvertLevel( false ) + , m_InvertWindow( false ) { m_StartDisplayCoordinate.Fill(0); m_LastDisplayCoordinate.Fill(0); m_CurrentDisplayCoordinate.Fill(0); m_UndoEnabled = false; } mitk::DisplayVectorInteractorLevelWindow::~DisplayVectorInteractorLevelWindow() { } +void mitk::DisplayVectorInteractorLevelWindow::SetHorizontalLevelling( bool enabled ) +{ + m_HorizontalLevelling = enabled; +} + +void mitk::DisplayVectorInteractorLevelWindow::SetInvertLevel( bool inverted ) +{ + m_InvertLevel = inverted; +} + +void mitk::DisplayVectorInteractorLevelWindow::SetInvertWindow( bool inverted ) +{ + m_InvertWindow = inverted; +} + diff --git a/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.h b/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.h index e4af4a3076..b4821e0a16 100644 --- a/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.h +++ b/Core/Code/Interactions/mitkDisplayVectorInteractorLevelWindow.h @@ -1,97 +1,116 @@ /*=================================================================== 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 MITKDisplayVectorInteractorLevelWindow_H_HEADER_INCLUDED_C10DC4EB #define MITKDisplayVectorInteractorLevelWindow_H_HEADER_INCLUDED_C10DC4EB #include #include "mitkBaseRenderer.h" #include "mitkStateMachine.h" namespace mitk { class Operation; class OperationActor; /** * @brief Interactor for adjusting both level- and window-values for an image * * This class implements an Interactor for adjusting the LevelWindow. It is defined by the 'LevelWindow'-statemachine which maps 'initmove' to right mousebutton pressed, * 'levelwindow' to right mousebutton and move and 'finishmove' to right mousebutton released. * * Using this tool, it is possible to increase the 'level'-value of the selected image * ( if no image has the 'selected'-property == true, the first image in the DataStorage is used ) * by moving the mouse right and decreasing the level by moving the mouse to the left. * * The 'window'-value and also be adjusted by moving the mouse-curser up (increase) and down (decrease). * * @ingroup MITK_CORE_EXPORT **/ class MITK_CORE_EXPORT DisplayVectorInteractorLevelWindow : public StateMachine { public: mitkClassMacro(DisplayVectorInteractorLevelWindow, StateMachine); mitkNewMacro1Param(Self, const char*); itkEventMacro( InteractionEvent, itk::AnyEvent ); itkEventMacro( StartInteractionEvent, InteractionEvent ); itkEventMacro( EndInteractionEvent, InteractionEvent ); //static Pointer New(const char* type) //{ // Pointer smartPtr = new DisplayVectorInteractorLevelWindow ( type ); // smartPtr->UnRegister(); // return smartPtr; //} /** * @brief Method derived from OperationActor to recieve and execute operations **/ virtual void ExecuteOperation(Operation* operation); + /** + * \brief If set, horizontal movement modifies the level instead of the window. + */ + void SetHorizontalLevelling( bool enabled ); + + /** + * \brief If set, the interaction for modifying the level are inverted. + */ + void SetInvertLevel( bool inverted ); + + /** + * \brief If set, the interaction for modifying the window are inverted. + */ + void SetInvertWindow( bool inverted ); + protected: /** * @brief Default Constructor **/ DisplayVectorInteractorLevelWindow(const char * type); /** * @brief Default Destructor **/ virtual ~DisplayVectorInteractorLevelWindow(); /** * @brief Method derived from StateMachine to implement the own actions **/ virtual bool ExecuteAction(Action* action, mitk::StateEvent const* stateEvent); private: BaseRenderer::Pointer m_Sender; mitk::Point2D m_StartDisplayCoordinate; mitk::Point2D m_LastDisplayCoordinate; mitk::Point2D m_CurrentDisplayCoordinate; + + bool m_HorizontalLevelling; + bool m_InvertLevel; + bool m_InvertWindow; }; } // namespace mitk #endif /* MITKDISPLAYVECTORINTERACTOR_H_HEADER_INCLUDED_C10DC4EB */ diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index 5055934cf3..3943c52f02 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -1,64 +1,65 @@ set(LIBPOSTFIX "Ext") # Modules must be listed according to their dependencies set(module_dirs + SeedsImage SceneSerializationBase PlanarFigure ImageExtraction ImageStatistics LegacyAdaptors IpPicSupport MitkExt SceneSerialization GraphAlgorithms SurfaceInterpolation Segmentation PlanarFigureSegmentation Qmitk QmitkExt SegmentationUI Properties DiffusionImaging GPGPU IGT CameraCalibration IGTUI RigidRegistration RigidRegistrationUI DeformableRegistration DeformableRegistrationUI OpenCL OpenCVVideoSupport Overlays InputDevices ToFHardware ToFProcessing ToFUI US ClippingTools USUI DicomUI Simulation Remeshing Python ) set(MITK_DEFAULT_SUBPROJECTS MITK-Modules) foreach(module_dir ${module_dirs}) add_subdirectory(${module_dir}) endforeach() if(MITK_PRIVATE_MODULES) file(GLOB all_subdirs RELATIVE ${MITK_PRIVATE_MODULES} ${MITK_PRIVATE_MODULES}/*) foreach(subdir ${all_subdirs}) string(FIND ${subdir} "." _result) if(_result EQUAL -1) if(EXISTS ${MITK_PRIVATE_MODULES}/${subdir}/CMakeLists.txt) message(STATUS "Found private module ${subdir}") add_subdirectory(${MITK_PRIVATE_MODULES}/${subdir} private_modules/${subdir}) endif() endif() endforeach() endif(MITK_PRIVATE_MODULES) diff --git a/Modules/MitkExt/CMakeLists.txt b/Modules/MitkExt/CMakeLists.txt index 6a6a06c49d..0fe2c8e78a 100644 --- a/Modules/MitkExt/CMakeLists.txt +++ b/Modules/MitkExt/CMakeLists.txt @@ -1,28 +1,28 @@ #if(WIN32) # option(MITK_USE_TD_MOUSE "Enable support for 3D Connexion SpaceNavigator" OFF) #endif(WIN32) configure_file(${PROJECT_SOURCE_DIR}/CMake/ToolExtensionITKFactory.cpp.in ${PROJECT_BINARY_DIR}/ToolExtensionITKFactory.cpp.in COPYONLY) configure_file(${PROJECT_SOURCE_DIR}/CMake/ToolExtensionITKFactoryLoader.cpp.in ${PROJECT_BINARY_DIR}/ToolExtensionITKFactoryLoader.cpp.in COPYONLY) configure_file(${PROJECT_SOURCE_DIR}/CMake/ToolGUIExtensionITKFactory.cpp.in ${PROJECT_BINARY_DIR}/ToolGUIExtensionITKFactory.cpp.in COPYONLY) MITK_CREATE_MODULE( MitkExt INCLUDE_DIRS Algorithms Controllers DataManagement Interactions IO Rendering - DEPENDS Mitk LegacyAdaptors IpPicSupport ipSegmentation mitkIpFunc PlanarFigure ImageStatistics + DEPENDS Mitk LegacyAdaptors IpPicSupport ipSegmentation mitkIpFunc PlanarFigure ImageStatistics SeedsImage DEPENDS_INTERNAL pic2vtk ) # this is needed for libraries which link to mitkCoreExt and need # symbols from explicitly instantiated templates like # mitk::UnstructuredGridVtkWriter which is referenced in # mitk::UnstructuredGridVtkWriterTest in the MitkExtTestDriver executable. if(MINGW) get_target_property(_mitkCoreExt_MINGW_linkflags mitkCoreExt LINK_FLAGS) if(NOT _mitkCoreExt_MINGW_linkflags) set(_mitkCoreExt_MINGW_linkflags "") endif(NOT _mitkCoreExt_MINGW_linkflags) set_target_properties(mitkCoreExt PROPERTIES LINK_FLAGS "${_mitkCoreExt_MINGW_linkflags} -Wl,--export-all-symbols") endif(MINGW) add_subdirectory(Testing) diff --git a/Modules/MitkExt/files.cmake b/Modules/MitkExt/files.cmake index d72a6de823..393772dced 100644 --- a/Modules/MitkExt/files.cmake +++ b/Modules/MitkExt/files.cmake @@ -1,142 +1,136 @@ set(CPP_FILES Algorithms/mitkMaskAndCutRoiImageFilter.cpp Algorithms/mitkBoundingObjectToSegmentationFilter.cpp Algorithms/vtkPointSetSlicer.cxx Algorithms/mitkCoreExtObjectFactory.cpp Algorithms/mitkAngleCorrectByPointFilter.cpp Algorithms/mitkBoundingObjectCutter.cpp Algorithms/mitkCylindricToCartesianFilter.cpp Algorithms/mitkDopplerToStrainRateFilter.cpp Algorithms/mitkGeometryClipImageFilter.cpp Algorithms/mitkGeometryDataSource.cpp Algorithms/mitkHeightFieldSurfaceClipImageFilter.cpp Algorithms/mitkImageToLookupTableFilter.cpp Algorithms/mitkInterpolateLinesFilter.cpp Algorithms/mitkLabeledImageToSurfaceFilter.cpp Algorithms/mitkLabeledImageVolumeCalculator.cpp - Algorithms/mitkLookupTableSource.cpp Algorithms/mitkMaskImageFilter.cpp Algorithms/mitkMeshSource.cpp Algorithms/mitkNonBlockingAlgorithm.cpp Algorithms/mitkPadImageFilter.cpp Algorithms/mitkPlaneCutFilter.cpp Algorithms/mitkPlaneFit.cpp Algorithms/mitkPlanesPerpendicularToLinesFilter.cpp Algorithms/mitkPointLocator.cpp Algorithms/mitkPointSetToCurvedGeometryFilter.cpp Algorithms/mitkPointSetToGeometryDataFilter.cpp Algorithms/mitkPointSetIndexToWorldTransformFilter.cpp Algorithms/mitkSurfaceIndexToWorldTransformFilter.cpp Algorithms/mitkPolygonToRingFilter.cpp Algorithms/mitkProbeFilter.cpp Algorithms/mitkSimpleHistogram.cpp Algorithms/mitkSimpleUnstructuredGridHistogram.cpp Algorithms/mitkUnstructuredGridHistogram.cpp Algorithms/mitkUnstructuredGridSource.cpp Algorithms/mitkVolumeVisualizationImagePreprocessor.cpp Controllers/mitkIPythonService.cpp Controllers/mitkMovieGenerator.cpp Controllers/mitkMultiStepper.cpp DataManagement/mitkAffineTransformationOperation.cpp DataManagement/mitkApplyDiffImageOperation.cpp DataManagement/mitkBoundingObject.cpp DataManagement/mitkBoundingObjectGroup.cpp DataManagement/mitkCellOperation.cpp DataManagement/mitkColorConversions.cpp DataManagement/mitkColorSequence.cpp DataManagement/mitkColorSequenceCycleH.cpp DataManagement/mitkColorSequenceHalfTones.cpp DataManagement/mitkColorSequenceRainbow.cpp DataManagement/mitkCompressedImageContainer.cpp DataManagement/mitkCone.cpp DataManagement/mitkCuboid.cpp DataManagement/mitkCylinder.cpp DataManagement/mitkDataStorageSelection.cpp DataManagement/mitkDelegateManager.cpp - DataManagement/mitkDrawOperation.cpp DataManagement/mitkEllipsoid.cpp DataManagement/mitkExternAbstractTransformGeometry.cpp DataManagement/mitkFrameOfReferenceUIDManager.cpp DataManagement/mitkGridRepresentationProperty.cpp DataManagement/mitkGridVolumeMapperProperty.cpp DataManagement/mitkItkBaseDataAdapter.cpp - DataManagement/mitkLabeledImageLookupTable.cpp DataManagement/mitkLineOperation.cpp DataManagement/mitkMesh.cpp DataManagement/mitkObjectSet.cpp DataManagement/mitkOrganTypeProperty.cpp DataManagement/mitkPlaneLandmarkProjector.cpp DataManagement/mitkPlane.cpp DataManagement/mitkPropertyManager.cpp DataManagement/mitkPropertyObserver.cpp - DataManagement/mitkSeedsImage.cpp - DataManagement/mitkSeedsImageLookupTableSource.cpp DataManagement/mitkSphereLandmarkProjector.cpp # DataManagement/mitkUSLookupTableSource.cpp DataManagement/mitkUnstructuredGrid.cpp DataManagement/mitkVideoSource.cpp DataManagement/vtkObjectSet.cpp IO/mitkObjFileIOFactory.cpp IO/mitkObjFileReader.cpp IO/mitkPACSPlugin.cpp IO/mitkParRecFileIOFactory.cpp IO/mitkParRecFileReader.cpp IO/mitkPropertyListExportToXmlFile.cpp IO/mitkPropertyListImportFromXmlFile.cpp IO/mitkStlVolumeTimeSeriesIOFactory.cpp IO/mitkStlVolumeTimeSeriesReader.cpp IO/mitkUnstructuredGridVtkWriter.cpp IO/mitkUnstructuredGridVtkWriterFactory.cpp IO/mitkVtkUnstructuredGridIOFactory.cpp IO/mitkVtkUnstructuredGridReader.cpp IO/mitkVtkVolumeTimeSeriesIOFactory.cpp IO/mitkVtkVolumeTimeSeriesReader.cpp Interactions/mitkConferenceEventMapper.cpp Interactions/mitkConnectPointsInteractor.cpp #Interactions/mitkCoordinateSupplier.cpp #Interactions/mitkDisplayCoordinateOperation.cpp #Interactions/mitkDisplayInteractor.cpp Interactions/mitkAffineInteractor3D.cpp Interactions/mitkDisplayPointSetInteractor.cpp #Interactions/mitkDisplayVectorInteractor.cpp Interactions/mitkInteractionDebug.cpp Interactions/mitkInteractionDebugger.cpp Interactions/mitkPointInteractor.cpp Interactions/mitkPointSelectorInteractor.cpp #Interactions/mitkPositionTracker.cpp - Interactions/mitkSeedsInteractor.cpp Interactions/mitkSocketClient.cpp Interactions/mitkSurfaceDeformationInteractor3D.cpp Interactions/mitkSurfaceInteractor.cpp # Interactions/mitkCreateSurfaceTool.cpp Rendering/mitkEnhancedPointSetVtkMapper3D.cpp Rendering/mitkImageBackground2D.cpp Rendering/mitkLineMapper2D.cpp # Rendering/mitkLineVtkMapper3D.cpp Rendering/mitkMeshMapper2D.cpp Rendering/mitkMeshVtkMapper3D.cpp Rendering/mitkNativeRenderWindowInteractor.cpp Rendering/mitkSplineMapper2D.cpp Rendering/mitkSplineVtkMapper3D.cpp Rendering/mitkUnstructuredGridMapper2D.cpp Rendering/mitkUnstructuredGridVtkMapper3D.cpp Rendering/mitkVectorImageMapper2D.cpp Rendering/vtkUnstructuredGridMapper.cpp Rendering/vtkMaskedGlyph2D.cpp Rendering/vtkMaskedGlyph3D.cpp Rendering/vtkMitkVolumeTextureMapper3D.cpp Rendering/vtkMitkOpenGLVolumeTextureMapper3D.cpp Rendering/mitkGPUVolumeMapper3D.cpp Rendering/vtkMitkGPUVolumeRayCastMapper.cpp ) if(WIN32 AND NOT MINGW) set(CPP_FILES Controllers/mitkMovieGeneratorWin32.cpp ${CPP_FILES} ) endif(WIN32 AND NOT MINGW) diff --git a/Modules/SeedsImage/CMakeLists.txt b/Modules/SeedsImage/CMakeLists.txt new file mode 100644 index 0000000000..c9e37e17d4 --- /dev/null +++ b/Modules/SeedsImage/CMakeLists.txt @@ -0,0 +1,3 @@ +MITK_CREATE_MODULE( SeedsImage + DEPENDS Mitk +) diff --git a/Modules/SeedsImage/Resources/Interactions/SeedsConfig.xml b/Modules/SeedsImage/Resources/Interactions/SeedsConfig.xml new file mode 100644 index 0000000000..dc6f663163 --- /dev/null +++ b/Modules/SeedsImage/Resources/Interactions/SeedsConfig.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/SeedsImage/Resources/Interactions/SeedsInteraction.xml b/Modules/SeedsImage/Resources/Interactions/SeedsInteraction.xml new file mode 100644 index 0000000000..d16600dd77 --- /dev/null +++ b/Modules/SeedsImage/Resources/Interactions/SeedsInteraction.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/SeedsImage/files.cmake b/Modules/SeedsImage/files.cmake new file mode 100644 index 0000000000..b31ec92a3e --- /dev/null +++ b/Modules/SeedsImage/files.cmake @@ -0,0 +1,13 @@ +set(CPP_FILES + mitkDrawOperation.cpp + mitkLabeledImageLookupTable.cpp + mitkLookupTableSource.cpp + mitkSeedsImage.cpp + mitkSeedsImageLookupTableSource.cpp + mitkSeedsInteractor.cpp +) + +set(RESOURCE_FILES + Interactions/SeedsConfig.xml + Interactions/SeedsInteraction.xml +) diff --git a/Modules/MitkExt/DataManagement/mitkDrawOperation.cpp b/Modules/SeedsImage/mitkDrawOperation.cpp old mode 100755 new mode 100644 similarity index 100% rename from Modules/MitkExt/DataManagement/mitkDrawOperation.cpp rename to Modules/SeedsImage/mitkDrawOperation.cpp diff --git a/Modules/MitkExt/DataManagement/mitkDrawOperation.h b/Modules/SeedsImage/mitkDrawOperation.h old mode 100755 new mode 100644 similarity index 95% rename from Modules/MitkExt/DataManagement/mitkDrawOperation.h rename to Modules/SeedsImage/mitkDrawOperation.h index 4eb8729be2..72680c4cfa --- a/Modules/MitkExt/DataManagement/mitkDrawOperation.h +++ b/Modules/SeedsImage/mitkDrawOperation.h @@ -1,76 +1,76 @@ /*=================================================================== 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 MITKDRAWOPERATION_H #define MITKDRAWOPERATION_H #include -#include "MitkExtExports.h" +#include "SeedsImageExports.h" #include #include #include #include namespace mitk { //##Documentation //## @brief DrawOperation, that handles all actions on seeds. //## //## Stores everything for adding and deleting seeds. //## @ingroup Undo -class MitkExt_EXPORT DrawOperation : public Operation +class SeedsImage_EXPORT DrawOperation : public Operation { public: //##Documentation //##@brief DrawOperation, that handles all actions on seeds. //## //## @param operationType is the type of that operation (see mitkOperation.h; e.g. move or add; Information for StateMachine::ExecuteOperation()); //## @param point is the information of the seedpoint to add to the seedsimage //## @param last_point is the information of the point added before //## @param draw_state represents the seeds type e.g foreground or background seeds //## @param radius is the radius of seeds DrawOperation(OperationType operationType, Point3D point, Point3D last_point, int draw_state, int radius); virtual ~DrawOperation(); Point3D GetPoint(); Point3D GetLastPoint(); int GetDrawState(); int GetRadius(); SeedsImage::Pointer GetSeedsImage(); SeedsImage::Pointer GetLastSeedsImage(); private: Point3D m_Point; Point3D m_LastPoint; int m_DrawState; int m_Radius; SeedsImage::Pointer m_SeedsImage; SeedsImage::Pointer m_LastSeedsImage; }; }//namespace mitk #endif /* MITKDRAWOPERATION_H*/ diff --git a/Modules/MitkExt/DataManagement/mitkLabeledImageLookupTable.cpp b/Modules/SeedsImage/mitkLabeledImageLookupTable.cpp similarity index 100% rename from Modules/MitkExt/DataManagement/mitkLabeledImageLookupTable.cpp rename to Modules/SeedsImage/mitkLabeledImageLookupTable.cpp diff --git a/Modules/MitkExt/DataManagement/mitkLabeledImageLookupTable.h b/Modules/SeedsImage/mitkLabeledImageLookupTable.h similarity index 97% rename from Modules/MitkExt/DataManagement/mitkLabeledImageLookupTable.h rename to Modules/SeedsImage/mitkLabeledImageLookupTable.h index 439edf79cd..d0550ef38b 100644 --- a/Modules/MitkExt/DataManagement/mitkLabeledImageLookupTable.h +++ b/Modules/SeedsImage/mitkLabeledImageLookupTable.h @@ -1,117 +1,117 @@ /*=================================================================== 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 MITKMITKLABELEDIMAGELOOKUPTABLE_H #define MITKMITKLABELEDIMAGELOOKUPTABLE_H #include "mitkLookupTable.h" -#include "MitkExtExports.h" +#include "SeedsImageExports.h" #include "mitkLevelWindow.h" #include #include namespace mitk { /** * A lookup table for 2D mapping of labeled images. The lookup table supports * images with up to 256 unsigned labels. Negative labels are not supported. * Please use the level/window settings as given by the GetLevelWindow() method * to make sure, that the colors are rendered correctly. * The colors are initialized with random colors as default. As background * the label 0 is assumed. The color for the background is set to fully transparent * as default. */ -class MitkExt_EXPORT LabeledImageLookupTable : public LookupTable +class SeedsImage_EXPORT LabeledImageLookupTable : public LookupTable { public: /** * Standard mitk typedefs are generated by the mitkClassMacro */ mitkClassMacro(LabeledImageLookupTable, LookupTable); /** * Make this object constructable by the ::New() Method. */ itkNewMacro(Self); /** * The data type for a label. Currently only images with labels * in the range [0,255] are supported. */ typedef unsigned char LabelType; /** * Sets the color for a given label * @param label The pixel value used as a label in the image * @param r The red component of the rgba color value. Values sould be given in the range [0,1] * @param g The green component of the rgba color value. Values sould be given in the range [0,1] * @param b The blue component of the rgba color value. Values sould be given in the range [0,1] * @param a The alpha component of the rgba color value. Values sould be given in the range [0,1]. Default is 1. */ virtual void SetColorForLabel( const LabelType& label, const vtkFloatingPointType& r, const vtkFloatingPointType& g, const vtkFloatingPointType& b, const vtkFloatingPointType a = 1.0 ); /** * Determines the color which will be used for coloring a given label. * @param label the label for which the color should be returned * @returns an rgba array containing the color information for the given label. * Color components are expressed as [0,1] double values. */ virtual vtkFloatingPointType* GetColorForLabel(const LabelType& label); /** * Provides access to level window settings, which should be used * in combination with the LUTs generated by this filter (at lease for * 2D visualization. If you use other level/window settings, it is not * guaranteed, that scalar values are mapped to the correct colors. */ mitk::LevelWindow GetLevelWindow(){return m_LevelWindow;} protected: /** * Default constructor. Protected to prevent "normal" creation */ LabeledImageLookupTable(); LabeledImageLookupTable(const LabeledImageLookupTable& other); /** * Virtual destructor */ virtual ~LabeledImageLookupTable(); /** * Generates a random rgb color value. Values for rgb are in the range * [0,1] */ virtual void GenerateRandomColor( vtkFloatingPointType& r, vtkFloatingPointType& g, vtkFloatingPointType& b); /** * Generates a radnom number drawn from a uniform * distribution in the range [0,1]. */ virtual vtkFloatingPointType GenerateRandomNumber(); mitk::LevelWindow m_LevelWindow; private: itk::LightObject::Pointer InternalClone() const; }; } #endif diff --git a/Modules/MitkExt/Algorithms/mitkLookupTableSource.cpp b/Modules/SeedsImage/mitkLookupTableSource.cpp similarity index 100% rename from Modules/MitkExt/Algorithms/mitkLookupTableSource.cpp rename to Modules/SeedsImage/mitkLookupTableSource.cpp diff --git a/Modules/MitkExt/Algorithms/mitkLookupTableSource.h b/Modules/SeedsImage/mitkLookupTableSource.h similarity index 96% rename from Modules/MitkExt/Algorithms/mitkLookupTableSource.h rename to Modules/SeedsImage/mitkLookupTableSource.h index f351d27ea6..41a844b8c7 100644 --- a/Modules/MitkExt/Algorithms/mitkLookupTableSource.h +++ b/Modules/SeedsImage/mitkLookupTableSource.h @@ -1,98 +1,98 @@ /*=================================================================== 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 MITKLOOKUPTABLESOURCE_H_HEADER_INCLUDED #define MITKLOOKUPTABLESOURCE_H_HEADER_INCLUDED #include "mitkLookupTable.h" -#include "MitkExtExports.h" +#include "SeedsImageExports.h" #include "mitkCommon.h" #include "itkProcessObject.h" namespace mitk { /** * @brief Base class for all objects which have an object of type * mitkLookupTable as output * * Base class for all objects which have an object of type mitkLookupTable * as output. It is assumed, that mitkLookupTableSources do not provide support * for streaming, that is, that the requested region is always the largest * possible region. * @ingroup Process */ -class MitkExt_EXPORT LookupTableSource : public itk::ProcessObject +class SeedsImage_EXPORT LookupTableSource : public itk::ProcessObject { public: mitkClassMacro( LookupTableSource, itk::ProcessObject ) itkNewMacro( Self ) typedef mitk::LookupTable OutputType; typedef OutputType::Pointer OutputTypePointer; typedef itk::DataObject::Pointer DataObjectPointer; /** * Allocates a new output object and returns it. Currently the * index idx is not evaluated. * @param idx the index of the output for which an object should be created * @returns the new object */ virtual itk::DataObject::Pointer MakeOutput ( DataObjectPointerArraySizeType idx ); /** * This is a default implementation to make sure we have something. * Once all the subclasses of ProcessObject provide an appopriate * MakeOutput(), then ProcessObject::MakeOutput() can be made pure * virtual. */ virtual itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name); /** * Generates the input requested region simply by calling the equivalent * method of the superclass. */ void GenerateInputRequestedRegion(); /** * Replacement of the SetOutput method. I think it is not yet correcly * implemented, so you should better not use it. * @todo provide a more usefule implementation * @param output the intended output of the lookup table source. */ virtual void GraftOutput( OutputType* output ); virtual OutputType* GetOutput(); virtual const OutputType* GetOutput() const; virtual OutputType* GetOutput(DataObjectPointerArraySizeType idx); virtual const OutputType* GetOutput(DataObjectPointerArraySizeType idx) const; protected: LookupTableSource(); virtual ~LookupTableSource(); }; } // namespace mitk #endif diff --git a/Modules/MitkExt/DataManagement/mitkSeedsImage.cpp b/Modules/SeedsImage/mitkSeedsImage.cpp similarity index 100% rename from Modules/MitkExt/DataManagement/mitkSeedsImage.cpp rename to Modules/SeedsImage/mitkSeedsImage.cpp diff --git a/Modules/MitkExt/DataManagement/mitkSeedsImage.h b/Modules/SeedsImage/mitkSeedsImage.h similarity index 97% rename from Modules/MitkExt/DataManagement/mitkSeedsImage.h rename to Modules/SeedsImage/mitkSeedsImage.h index d20738d707..d82514eda3 100644 --- a/Modules/MitkExt/DataManagement/mitkSeedsImage.h +++ b/Modules/SeedsImage/mitkSeedsImage.h @@ -1,102 +1,102 @@ /*=================================================================== 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 MITKSEEDSIMAGE_H_HEADER_INCLUDED_C1C2FCD2 #define MITKSEEDSIMAGE_H_HEADER_INCLUDED_C1C2FCD2 #include "mitkImage.h" -#include "MitkExtExports.h" +#include "SeedsImageExports.h" #include #include #include #include #include namespace mitk { //##Documentation //## @brief SeedsImage class for storing seeds-images //## //## Handles operations for drawing seeds. //## @ingroup Data -class MitkExt_EXPORT SeedsImage : public Image +class SeedsImage_EXPORT SeedsImage : public Image { public: mitkClassMacro(SeedsImage, Image); itkNewMacro(Self); itkGetMacro(LastPoint, mitk::Point3D); void Initialize(); /// handles operations virtual void ExecuteOperation(Operation* operation); void ClearBuffer(); protected: SeedsImage(); virtual ~SeedsImage(); template< typename SeedsImageType > itk::NeighborhoodIterator< SeedsImageType >& GetNit( SeedsImageType* image ); /// sets a sphere of seeds around the point template < typename SeedsImageType > void AddSeedPoint(SeedsImageType * itkImage); /// interpolates a tube of seeds between two points template < typename SeedsImageType > void PointInterpolation(SeedsImageType * itkImage); /// interpolates a tube of seeds between two points template < typename SeedsImageType > void ClearBuffer(SeedsImageType * itkImage); protected: mitk::Point3D m_Point; mitk::Point3D m_LastPoint; mitk::Vector3D m_Spacing; int orig_size[3]; int m_DrawState; int m_Radius; float delta_x, delta_y, delta_z; float sphere_distance; typedef itk::Image MaskImageType; typedef itk::GaussianSpatialFunction< int, 3 > GaussianFunction3DType; GaussianFunction3DType::Pointer m_GaussianFunction3D; typedef itk::GaussianSpatialFunction< int, 2 > GaussianFunction2DType; GaussianFunction2DType::Pointer m_GaussianFunction2D; typedef itk::BinaryBallStructuringElement< short, 3 > BallStructuringElement3DType; BallStructuringElement3DType m_StructuringElement3D; typedef itk::BinaryBallStructuringElement< short, 2 > BallStructuringElement2DType; BallStructuringElement2DType m_StructuringElement2D; }; } // namespace mitk #endif /* MITKSEEDSIMAGE_H_HEADER_INCLUDED_C1C2FCD2 */ diff --git a/Modules/MitkExt/DataManagement/mitkSeedsImageLookupTableSource.cpp b/Modules/SeedsImage/mitkSeedsImageLookupTableSource.cpp similarity index 100% rename from Modules/MitkExt/DataManagement/mitkSeedsImageLookupTableSource.cpp rename to Modules/SeedsImage/mitkSeedsImageLookupTableSource.cpp diff --git a/Modules/MitkExt/DataManagement/mitkSeedsImageLookupTableSource.h b/Modules/SeedsImage/mitkSeedsImageLookupTableSource.h similarity index 94% rename from Modules/MitkExt/DataManagement/mitkSeedsImageLookupTableSource.h rename to Modules/SeedsImage/mitkSeedsImageLookupTableSource.h index 1224cd34e4..500431d1b1 100644 --- a/Modules/MitkExt/DataManagement/mitkSeedsImageLookupTableSource.h +++ b/Modules/SeedsImage/mitkSeedsImageLookupTableSource.h @@ -1,85 +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 MITKSEEDSIMAGELOOKUPTABLESOURCE_H_HEADER_INCLUDED #define MITKSEEDSIMAGELOOKUPTABLESOURCE_H_HEADER_INCLUDED #include "mitkCommon.h" -#include "MitkExtExports.h" +#include "SeedsImageExports.h" #include "mitkLookupTableSource.h" namespace mitk { -class MitkExt_EXPORT SeedsImageLookupTableSource : public LookupTableSource +class SeedsImage_EXPORT SeedsImageLookupTableSource : public LookupTableSource { public: typedef enum {Seeds, DefaultLUT, Force} LookupTableMode; mitkClassMacro( SeedsImageLookupTableSource, LookupTableSource ); itkNewMacro( Self ); /** @brief Some convenient typedefs. */ typedef mitk::LookupTable OutputType; void SetUseSeedsLookupTable() {m_Mode = Seeds; this->Modified();}; void SetUseForceLookupTable() {m_Mode = Force; this->Modified();}; protected: SeedsImageLookupTableSource(); virtual ~SeedsImageLookupTableSource(); /** * Generates a LookupTable depended on the given mode and stores * it in an output object */ virtual void GenerateData(); /** * Generates a lookup table, dependend on the given mode * @returns a vtkLookupTable */ vtkLookupTable* BuildVtkLookupTable( ); /** * Generates a Seeds lookup table * @returns a vtkLookupTable */ vtkLookupTable* BuildSeedsLookupTable(); /** * Generates a force lookup table * @returns a vtkLookupTable */ vtkLookupTable* BuildForceLookupTable(); /** * Generates a default lookup table * @returns a vtkLookupTable */ vtkLookupTable* BuildDefaultLookupTable(); private: LookupTableMode m_Mode; OutputTypePointer m_LookupTable; }; } // namespace mitk #endif /* MITKSEEDSIMAGELOOKUPSOURCE_H_HEADER_INCLUDED */ diff --git a/Modules/MitkExt/Interactions/mitkSeedsInteractor.cpp b/Modules/SeedsImage/mitkSeedsInteractor.cpp similarity index 100% rename from Modules/MitkExt/Interactions/mitkSeedsInteractor.cpp rename to Modules/SeedsImage/mitkSeedsInteractor.cpp diff --git a/Modules/MitkExt/Interactions/mitkSeedsInteractor.h b/Modules/SeedsImage/mitkSeedsInteractor.h similarity index 95% rename from Modules/MitkExt/Interactions/mitkSeedsInteractor.h rename to Modules/SeedsImage/mitkSeedsInteractor.h index dccec14cfe..e8779b3e96 100644 --- a/Modules/MitkExt/Interactions/mitkSeedsInteractor.h +++ b/Modules/SeedsImage/mitkSeedsInteractor.h @@ -1,72 +1,72 @@ /*=================================================================== 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 __SeedsInteractor_H #define __SeedsInteractor_H #include -#include "MitkExtExports.h" +#include "SeedsImageExports.h" #include #include #include //needed by QmitkSimplexMeshes (SMDeformation.cpp and LungSegmentation.cpp) #include #include namespace mitk { //##Documentation //## @brief SeedsInteractor handles all actions on the seedsimage //## @ingroup Interaction - class MitkExt_EXPORT SeedsInteractor : public Interactor + class SeedsImage_EXPORT SeedsInteractor : public Interactor { public: mitkClassMacro(SeedsInteractor, Interactor); mitkNewMacro2Param(Self, const char*, DataNode*); /// sets the radius of the seeds. void SetRadius(int val){m_Radius=val;}; void SetCurrentDrawState(int val){m_CurrentDrawState = val;}; itkSetMacro(Config, unsigned int); itkGetMacro(Config, unsigned int); protected: /** * @brief Default Constructor **/ SeedsInteractor(const char * type, DataNode* dataNode); /** * @brief Default Destructor **/ virtual ~SeedsInteractor(); virtual bool ExecuteAction(Action* action, StateEvent const* stateEvent); protected: SeedsImage::Pointer m_SeedsImage; SeedsImage::Pointer m_LastSeedsImage; Point3D event_point; Point3D last_point; int m_Radius; int m_DrawState; int m_CurrentDrawState; unsigned int m_Config; // determine whether 254,255 or smoothed float values are used. }; } #endif //__SeedsInteractor_H