diff --git a/Core/Code/Testing/CMakeLists.txt b/Core/Code/Testing/CMakeLists.txt index a9afe870aa..cedfa5ffa5 100644 --- a/Core/Code/Testing/CMakeLists.txt +++ b/Core/Code/Testing/CMakeLists.txt @@ -1,277 +1,242 @@ # The core tests need relaxed compiler flags... # TODO fix core tests to compile without these additional no-error flags if(MSVC_VERSION) # disable deprecated warnings (they would lead to errors) mitkFunctionCheckCAndCXXCompilerFlags("/wd4996" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) else() mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=deprecated" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=deprecated-declarations" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() MITK_CREATE_MODULE_TESTS(LABELS MITK-Core) mitk_use_modules(TARGET ${TESTDRIVER} PACKAGES ITK|ITKThresholding) mitkAddCustomModuleTest(mitkVolumeCalculatorTest_Png2D-bw mitkVolumeCalculatorTest ${MITK_DATA_DIR}/Png2D-bw.png ${MITK_DATA_DIR}/Pic2DplusT.nrrd ) mitkAddCustomModuleTest(mitkEventMapperTest_Test1And2 mitkEventMapperTest ${MITK_DATA_DIR}/TestStateMachine1.xml ${MITK_DATA_DIR}/TestStateMachine2.xml ) mitkAddCustomModuleTest(mitkEventConfigTest_CreateObjectInDifferentWays mitkEventConfigTest ${MITK_SOURCE_DIR}/Core/Code/Testing/Resources/Interactions/StatemachineConfigTest.xml ) mitkAddCustomModuleTest(mitkNodeDependentPointSetInteractorTest mitkNodeDependentPointSetInteractorTest ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/BallBinary30x30x30.nrrd ) mitkAddCustomModuleTest(mitkDataStorageTest_US4DCyl mitkDataStorageTest ${MITK_DATA_DIR}/US4DCyl.nrrd ) mitkAddCustomModuleTest(mitkStateMachineFactoryTest_TestStateMachine1_2 mitkStateMachineFactoryTest ${MITK_DATA_DIR}/TestStateMachine1.xml ${MITK_DATA_DIR}/TestStateMachine2.xml ) mitkAddCustomModuleTest(mitkDicomSeriesReaderTest_CTImage mitkDicomSeriesReaderTest ${MITK_DATA_DIR}/TinyCTAbdomen ${MITK_DATA_DIR}/DICOMReader/Broken-Series ) mitkAddCustomModuleTest(mitkPointSetReaderTest mitkPointSetReaderTest ${MITK_DATA_DIR}/PointSetReaderTestData.mps ) mitkAddCustomModuleTest(mitkImageTest_4DImageData mitkImageTest ${MITK_DATA_DIR}/US4DCyl.nrrd ) mitkAddCustomModuleTest(mitkImageTest_2D+tImageData mitkImageTest ${MITK_DATA_DIR}/Pic2DplusT.nrrd ) mitkAddCustomModuleTest(mitkImageTest_3DImageData mitkImageTest ${MITK_DATA_DIR}/Pic3D.nrrd ) mitkAddCustomModuleTest(mitkImageEqualTest mitkImageEqualTest) mitkAddCustomModuleTest(mitkImageTest_brainImage mitkImageTest ${MITK_DATA_DIR}/brain.mhd ) mitkAddCustomModuleTest(mitkImageTest_3DImageData mitkImageGeneratorTest ${MITK_DATA_DIR}/Pic3D.nrrd ) mitkAddCustomModuleTest(mitkLevelWindowManagerTest mitkLevelWindowManagerTest ${MITK_DATA_DIR}/Pic3D.nrrd ) mitkAddCustomModuleTest(mitkMultiComponentImageDataComparisonFilterTest mitkMultiComponentImageDataComparisonFilterTest ${MITK_DATA_DIR}/NrrdWritingTestImage.jpg ) mitkAddCustomModuleTest(mitkImageToItkTest mitkImageToItkTest ${MITK_DATA_DIR}/Pic3D.nrrd ) mitkAddCustomModuleTest(mitkImageSliceSelectorTest mitkImageSliceSelectorTest ${MITK_DATA_DIR}/Pic2DplusT.nrrd ) if(MITK_ENABLE_RENDERING_TESTING) ### since the rendering test's do not run in ubuntu, yet, we build them only for other systems or if the user explicitly sets the variable MITK_ENABLE_RENDERING_TESTING mitkAddCustomModuleTest(mitkImageVtkMapper2D_rgbaImage640x480 mitkImageVtkMapper2DTest ${MITK_DATA_DIR}/RenderingTestData/rgbaImage.png #input image to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/rgbaImage640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3d640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3d640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dColorBlue640x480 mitkImageVtkMapper2DColorTest #test for color property (=blue) Pic3D sagittal slice ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dColorBlue640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dLevelWindow640x480 mitkImageVtkMapper2DLevelWindowTest #test for levelwindow property (=blood) #Pic3D sagittal slice ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dLevelWindowBlood640x480REF.png #corresponding reference #screenshot ) #mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dOpacity640x480 mitkImageVtkMapper2DOpacityTest #test for opacity (=0.5) Pic3D coronal slice # ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dOpacity640x480REF.png corresponding reference screenshot #) mitkAddCustomModuleTest(mitkImageVtkMapper2D_pic3dSwivel640x480 mitkImageVtkMapper2DSwivelTest #test for a randomly chosen Pic3D swivelled slice ${MITK_DATA_DIR}/Pic3D.nrrd #input image to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dSwivel640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAlone640x480 mitkPointSetVtkMapper2DTest ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAlone640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_Pic3DPointSetForPic3D640x480 mitkPointSetVtkMapper2DImageTest ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/PointSetForPic3D.mps #input point set and image to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Pic3DPointSetForPic3D640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAloneGlyphType640x480 mitkPointSetVtkMapper2DGlyphTypeTest ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneGlyphType640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkPointSetVtkMapper2D_openMeAloneTransformed640x480 mitkPointSetVtkMapper2DTransformedPointsTest ${MITK_DATA_DIR}/RenderingTestData/openMeAlone.mps #input point set to load in data storage -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/openMeAloneTransformedPoints640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkSurfaceDepthSortingTransparency_StanfordBunnySTL640x480 mitkSurfaceDepthSortingTest ${MITK_DATA_DIR}/RenderingTestData/Stanford_bunny.stl -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Stanford_bunnySTLDepthSorting640x480REF.png ) if(NOT APPLE) mitkAddCustomModuleTest(mitkSurfaceDepthPeelingTransparency_StanfordBunnySTL640x480 mitkSurfaceDepthPeelingTest ${MITK_DATA_DIR}/RenderingTestData/Stanford_bunny.stl -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Stanford_bunnySTLDepthPeeling640x480REF.png #corresponding reference screenshot ) endif() #Test reslice interpolation #note: nearest mode is already tested by swivel test mitkAddCustomModuleTest(ResliceInterpolationIsLinear mitkImageVtkMapper2DResliceInterpolationPropertyTest 1 #linear ${MITK_DATA_DIR}/Pic3D.nrrd -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefLinear.png #corresponding reference screenshot LINEAR ) mitkAddCustomModuleTest(ResliceInterpolationIsCubic mitkImageVtkMapper2DResliceInterpolationPropertyTest 3 #cubic ${MITK_DATA_DIR}/Pic3D.nrrd -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/pic3dRefCubic.png #corresponding reference screenshot CUBIC ) #End test reslice interpolation -#Overlays -mitkAddCustomModuleTest(mitkLabelOverlay3DRendering2DTest mitkLabelOverlay3DRendering2DTest #OverlayTest - -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkLabelOverlay3DRendering2DTest.png #corresponding reference screenshot -) - -mitkAddCustomModuleTest(mitkLabelOverlay3DRendering3DTest mitkLabelOverlay3DRendering3DTest #OverlayTest - -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkLabelOverlay3DRendering3DTest.png #corresponding reference screenshot -) - -mitkAddCustomModuleTest(mitkTextOverlay2DRenderingTest_ball mitkTextOverlay2DRenderingTest #OverlayTest - ${MITK_DATA_DIR}/ball.stl #input image to load in data storage - -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay2DRenderingTest_ball.png #corresponding reference screenshot -) - -#mitkAddCustomModuleTest(mitkTextOverlay2DLayouterRenderingTest_ball mitkTextOverlay2DLayouterRenderingTest #OverlayTest -# ${MITK_DATA_DIR}/ball.stl #input image to load in data storage -# -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay2DLayouterRenderingTest_ball.png #corresponding reference screenshot -#) - -mitkAddCustomModuleTest(mitkTextOverlay3DRendering2DTest_ball mitkTextOverlay3DRendering2DTest #OverlayTest - ${MITK_DATA_DIR}/ball.stl #input image to load in data storage - -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay3DRendering2DTest_ball.png #corresponding reference screenshot -) - -mitkAddCustomModuleTest(mitkTextOverlay3DRendering3DTest_ball mitkTextOverlay3DRendering3DTest #OverlayTest - ${MITK_DATA_DIR}/ball.stl #input image to load in data storage - -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay3DRendering3DTest_ball.png #corresponding reference screenshot -) - -mitkAddCustomModuleTest(mitkTextOverlay3DColorRenderingTest_ball mitkTextOverlay3DColorRenderingTest #OverlayTest - ${MITK_DATA_DIR}/ball.stl #input image to load in data storage - -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay3DColorRenderingTest_ball.png #corresponding reference screenshot -) -#End of overlayTests - # Testing of the rendering of binary images #mitkAddCustomModuleTest(mitkImageVtkMapper2D_binaryTestImage640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice # ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImage640x480REF.png #corresponding reference screenshot #) #mitkAddCustomModuleTest(mitkImageVtkMapper2D_binaryTestImageWithRef640x480 mitkImageVtkMapper2DTest #test for standard Pic3D axial slice # ${MITK_DATA_DIR}/Pic3D.nrrd ${MITK_DATA_DIR}/RenderingTestData/binaryImage.nrrd #input image to load in data storage # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryImageWithRef640x480REF.png #corresponding reference screenshot #) # End of binary image tests mitkAddCustomModuleTest(mitkSurfaceVtkMapper3DTest_TextureProperty mitkSurfaceVtkMapper3DTest ${MITK_DATA_DIR}/ToF-Data/Kinect_LiverPhantom.vtp ${MITK_DATA_DIR}/ToF-Data/Kinect_LiverPhantom_RGBImage.nrrd -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/texturedLiver640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkImageVtkMapper2DTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DTransferFunctionTest ${MITK_DATA_DIR}/Png2D-bw.png -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-TransferFunctionRGBImage640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkImageVtkMapper2DOpacityTransferFunctionTest_Png2D-bw mitkImageVtkMapper2DOpacityTransferFunctionTest ${MITK_DATA_DIR}/Png2D-bw.png -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-OpacityTransferFunctionRGBImage640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkSurfaceGLMapper2DColorTest_RedBall mitkSurfaceGLMapper2DColorTest ${MITK_DATA_DIR}/ball.stl -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/ballColorRed640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkSurfaceGLMapper2DColorTest_DasArmeSchwein mitkSurfaceGLMapper2DColorTest ${MITK_DATA_DIR}/binary.stl -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/binaryColorRed640x480REF.png #corresponding reference screenshot ) mitkAddCustomModuleTest(mitkSurfaceGLMapper2DOpacityTest_BallOpacity mitkSurfaceGLMapper2DOpacityTest #opacity = 50% (0.5) ${MITK_DATA_DIR}/ball.stl -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/ballOpacity640x480REF.png #corresponding reference screenshot ) ############################## DISABLED TESTS #Removed due to high rendering error. #mitkAddCustomModuleTest(mitkSurfaceVtkMapper3DTexturedSphereTest_Football mitkSurfaceVtkMapper3DTexturedSphereTest # ${MITK_DATA_DIR}/RenderingTestData/texture.jpg #input texture # -V # ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/texturedSphere640x480REF.png corresponding reference screenshot #) #mitkAddCustomModuleTest(mitkImageVtkMapper2DLookupTableTest_Png2D-bw mitkImageVtkMapper2DLookupTableTest # ${MITK_DATA_DIR}/Png2D-bw.png # -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/Png2D-bw-LookupTableRGBImage640x480REF.png #corresponding reference screenshot #) #mitkAddCustomModuleTest(mitkImageTest_color2DImage mitkImageTest # ${MITK_DATA_DIR}/NrrdWritingTestImage.jpg #) #mitkAddCustomModuleTest(mitkNodeDependentPointSetInteractorTest mitkNodeDependentPointSetInteractorTest # ${MITK_DATA_DIR}/Pic3D.pic.gz ${MITK_DATA_DIR}/BallBinary30x30x30.pic.gz #) SET_PROPERTY(TEST mitkImageVtkMapper2D_rgbaImage640x480 mitkImageVtkMapper2D_pic3d640x480 mitkImageVtkMapper2D_pic3dColorBlue640x480 mitkImageVtkMapper2D_pic3dLevelWindow640x480 mitkImageVtkMapper2D_pic3dSwivel640x480 mitkImageVtkMapper2DTransferFunctionTest_Png2D-bw # mitkImageVtkMapper2D_pic3dOpacity640x480 mitkSurfaceGLMapper2DOpacityTest_BallOpacity mitkSurfaceGLMapper2DColorTest_DasArmeSchwein mitkSurfaceGLMapper2DColorTest_RedBall mitkSurfaceVtkMapper3DTest_TextureProperty mitkPointSetVtkMapper2D_Pic3DPointSetForPic3D640x480 mitkPointSetVtkMapper2D_openMeAlone640x480 mitkPointSetVtkMapper2D_openMeAloneGlyphType640x480 mitkPointSetVtkMapper2D_openMeAloneTransformed640x480 #mitkSurfaceVtkMapper3DTexturedSphereTest_Football PROPERTY RUN_SERIAL TRUE) endif() add_test(mitkPointSetLocaleTest ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} mitkPointSetLocaleTest ${MITK_DATA_DIR}/pointSet.mps) set_property(TEST mitkPointSetLocaleTest PROPERTY LABELS MITK-Core) add_test(mitkImageWriterTest_nrrdImage ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} mitkImageWriterTest ${MITK_DATA_DIR}/NrrdWritingTestImage.jpg) add_test(mitkImageWriterTest_2DPNGImage ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} mitkImageWriterTest ${MITK_DATA_DIR}/Png2D-bw.png) add_test(mitkImageWriterTest_rgbPNGImage ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} mitkImageWriterTest ${MITK_DATA_DIR}/RenderingTestData/rgbImage.png) add_test(mitkImageWriterTest_rgbaPNGImage ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTDRIVER} mitkImageWriterTest ${MITK_DATA_DIR}/RenderingTestData/rgbaImage.png) set_property(TEST mitkImageWriterTest_nrrdImage PROPERTY LABELS MITK-Core) set_property(TEST mitkImageWriterTest_2DPNGImage PROPERTY LABELS MITK-Core) set_property(TEST mitkImageWriterTest_rgbPNGImage PROPERTY LABELS MITK-Core) set_property(TEST mitkImageWriterTest_rgbaPNGImage PROPERTY LABELS MITK-Core) add_subdirectory(DCMTesting) diff --git a/Core/Code/Testing/files.cmake b/Core/Code/Testing/files.cmake index d5e16f83ed..249f1f2017 100644 --- a/Core/Code/Testing/files.cmake +++ b/Core/Code/Testing/files.cmake @@ -1,210 +1,203 @@ # tests with no extra command line parameter set(MODULE_TESTS # IMPORTANT: If you plan to deactivate / comment out a test please write a bug number to the commented out line of code. # # Example: #mitkMyTest #this test is commented out because of bug 12345 # # It is important that the bug is open and that the test will be activated again before the bug is closed. This assures that # no test is forgotten after it was commented out. If there is no bug for your current problem, please add a new one and # mark it as critical. ################## DISABLED TESTS ################################################# #mitkAbstractTransformGeometryTest.cpp #seems as tested class mitkExternAbstractTransformGeometry doesnt exist any more #mitkStateMachineContainerTest.cpp #rewrite test, indirect since no longer exported Bug 14529 #mitkRegistrationBaseTest.cpp #tested class mitkRegistrationBase doesn't exist any more #mitkSegmentationInterpolationTest.cpp #file doesn't exist! #mitkPipelineSmartPointerCorrectnessTest.cpp #file doesn't exist! #mitkITKThreadingTest.cpp #test outdated because itk::Semaphore was removed from ITK #mitkAbstractTransformPlaneGeometryTest.cpp #mitkVtkAbstractTransformPlaneGeometry doesn't exist any more #mitkTestUtilSharedLibrary.cpp #Linker problem with this test... #mitkTextOverlay2DSymbolsRenderingTest.cpp #Implementation of the tested feature is not finished yet. Ask Christoph or see bug 15104 for details. ################# RUNNING TESTS ################################################### mitkAccessByItkTest.cpp mitkCoreObjectFactoryTest.cpp mitkDataNodeTest.cpp mitkMaterialTest.cpp mitkActionTest.cpp mitkDispatcherTest.cpp mitkEnumerationPropertyTest.cpp mitkEventTest.cpp mitkFocusManagerTest.cpp mitkGenericPropertyTest.cpp mitkGeometry3DTest.cpp mitkGeometry3DEqualTest.cpp mitkGeometryDataToSurfaceFilterTest.cpp mitkGlobalInteractionTest.cpp mitkImageCastTest.cpp mitkImageEqualTest.cpp mitkImageDataItemTest.cpp mitkImageGeneratorTest.cpp mitkIOUtilTest.cpp mitkBaseDataTest.cpp mitkImportItkImageTest.cpp mitkGrabItkImageMemoryTest.cpp mitkInstantiateAccessFunctionTest.cpp mitkInteractorTest.cpp mitkLevelWindowTest.cpp mitkMessageTest.cpp mitkPixelTypeTest.cpp mitkPlaneGeometryTest.cpp mitkPointSetTest.cpp mitkPointSetEqualTest.cpp mitkPointSetFileIOTest.cpp mitkPointSetOnEmptyTest.cpp mitkPointSetWriterTest.cpp mitkPointSetReaderTest.cpp mitkPointSetInteractorTest.cpp mitkPointSetPointOperationsTest.cpp mitkPropertyTest.cpp mitkPropertyListTest.cpp mitkSlicedGeometry3DTest.cpp mitkSliceNavigationControllerTest.cpp mitkStateMachineTest.cpp mitkStateTest.cpp mitkSurfaceTest.cpp mitkSurfaceEqualTest.cpp mitkSurfaceToSurfaceFilterTest.cpp mitkTimeGeometryTest.cpp mitkTransitionTest.cpp mitkUndoControllerTest.cpp mitkVtkWidgetRenderingTest.cpp mitkVerboseLimitedLinearUndoTest.cpp mitkWeakPointerTest.cpp mitkTransferFunctionTest.cpp mitkStepperTest.cpp mitkRenderingManagerTest.cpp vtkMitkThickSlicesFilterTest.cpp mitkNodePredicateSourceTest.cpp mitkVectorTest.cpp mitkClippedSurfaceBoundsCalculatorTest.cpp mitkExceptionTest.cpp mitkExtractSliceFilterTest.cpp mitkLogTest.cpp mitkImageDimensionConverterTest.cpp mitkLoggingAdapterTest.cpp mitkUIDGeneratorTest.cpp mitkShaderRepositoryTest.cpp mitkPlanePositionManagerTest.cpp mitkAffineTransformBaseTest.cpp mitkPropertyAliasesTest.cpp mitkPropertyDescriptionsTest.cpp mitkPropertyExtensionsTest.cpp mitkPropertyFiltersTest.cpp mitkTinyXMLTest.cpp mitkRawImageFileReaderTest.cpp mitkInteractionEventTest.cpp mitkLookupTableTest.cpp mitkSTLFileReaderTest.cpp mitkPointTypeConversionTest.cpp mitkVectorTypeConversionTest.cpp mitkMatrixTypeConversionTest.cpp mitkArrayTypeConversionTest.cpp mitkSurfaceToImageFilterTest.cpp mitkBaseGeometryTest.cpp mitkImageToSurfaceFilterTest.cpp mitkEqualTest.cpp mitkLineTest.cpp ) if(MITK_ENABLE_RENDERING_TESTING) #since mitkInteractionTestHelper is currently creating a vtkRenderWindow set(MODULE_TESTS ${MODULE_TESTS} mitkPointSetDataInteractorTest.cpp ) endif() # test with image filename as an extra command line parameter set(MODULE_IMAGE_TESTS mitkImageTimeSelectorTest.cpp #only runs on images mitkImageAccessorTest.cpp #only runs on images mitkDataNodeFactoryTest.cpp #runs on all types of data ) set(MODULE_SURFACE_TESTS mitkSurfaceVtkWriterTest.cpp #only runs on surfaces mitkDataNodeFactoryTest.cpp #runs on all types of data ) # list of images for which the tests are run set(MODULE_TESTIMAGES US4DCyl.nrrd Pic3D.nrrd Pic2DplusT.nrrd BallBinary30x30x30.nrrd Png2D-bw.png ) set(MODULE_TESTSURFACES binary.stl ball.stl ) set(MODULE_CUSTOM_TESTS mitkDataStorageTest.cpp mitkDicomSeriesReaderTest.cpp mitkDICOMLocaleTest.cpp mitkEventMapperTest.cpp mitkEventConfigTest.cpp mitkNodeDependentPointSetInteractorTest.cpp mitkStateMachineFactoryTest.cpp mitkPointSetLocaleTest.cpp mitkImageTest.cpp mitkImageWriterTest.cpp mitkImageVtkMapper2DTest.cpp mitkImageVtkMapper2DLevelWindowTest.cpp mitkImageVtkMapper2DOpacityTest.cpp mitkImageVtkMapper2DResliceInterpolationPropertyTest.cpp mitkImageVtkMapper2DColorTest.cpp mitkImageVtkMapper2DSwivelTest.cpp mitkImageVtkMapper2DTransferFunctionTest.cpp mitkImageVtkMapper2DOpacityTransferFunctionTest.cpp mitkImageVtkMapper2DLookupTableTest.cpp mitkSurfaceVtkMapper3DTest mitkSurfaceVtkMapper3DTexturedSphereTest.cpp mitkSurfaceGLMapper2DColorTest.cpp mitkSurfaceGLMapper2DOpacityTest.cpp mitkVolumeCalculatorTest.cpp mitkLevelWindowManagerTest.cpp mitkPointSetVtkMapper2DTest.cpp mitkPointSetVtkMapper2DImageTest.cpp mitkPointSetVtkMapper2DGlyphTypeTest.cpp mitkPointSetVtkMapper2DTransformedPointsTest.cpp - mitkLabelOverlay3DRendering2DTest.cpp - mitkLabelOverlay3DRendering3DTest.cpp - mitkTextOverlay2DRenderingTest.cpp - mitkTextOverlay2DLayouterRenderingTest.cpp - mitkTextOverlay3DRendering2DTest.cpp - mitkTextOverlay3DRendering3DTest.cpp - mitkTextOverlay3DColorRenderingTest.cpp mitkVTKRenderWindowSizeTest.cpp mitkMultiComponentImageDataComparisonFilterTest.cpp mitkImageToItkTest.cpp mitkImageSliceSelectorTest.cpp mitkSurfaceDepthPeelingTest.cpp mitkSurfaceDepthSortingTest.cpp ) set(MODULE_RESOURCE_FILES Interactions/AddAndRemovePoints.xml Interactions/globalConfig.xml Interactions/StatemachineTest.xml Interactions/StatemachineConfigTest.xml ) # Create an artificial module initializing class for # the usServiceListenerTest.cpp usFunctionGenerateExecutableInit(testdriver_init_file IDENTIFIER ${MODULE_NAME}TestDriver ) # Embed the resources set(testdriver_resources ) usFunctionEmbedResources(testdriver_resources EXECUTABLE_NAME ${MODULE_NAME}TestDriver ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Resources FILES ${MODULE_RESOURCE_FILES} ) set(TEST_CPP_FILES ${testdriver_init_file} ${testdriver_resources}) diff --git a/Core/Code/files.cmake b/Core/Code/files.cmake index c070cc1304..04887912c3 100644 --- a/Core/Code/files.cmake +++ b/Core/Code/files.cmake @@ -1,418 +1,412 @@ 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 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 Interfaces/mitkIDataNodeReader.h 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/mitkCoreActivator.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/mitkDataNodeFactory.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/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/mitkInteractionEventObserver.cpp Interfaces/mitkIShaderRepository.cpp Interfaces/mitkIPropertyAliases.cpp Interfaces/mitkIPropertyDescriptions.cpp Interfaces/mitkIPropertyExtensions.cpp Interfaces/mitkIPropertyFilters.cpp Interfaces/mitkIPersistenceService.cpp IO/mitkBaseDataIOFactory.cpp IO/mitkCoreDataNodeReader.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/mitkFileSeriesReader.cpp IO/mitkFileWriter.cpp # IO/mitkIpPicGet.c IO/mitkImageGenerator.cpp IO/mitkImageWriter.cpp IO/mitkImageWriterFactory.cpp IO/mitkItkImageFileIOFactory.cpp IO/mitkItkImageFileReader.cpp IO/mitkItkLoggingAdapter.cpp IO/mitkItkPictureWrite.cpp IO/mitkIOUtil.cpp IO/mitkLookupTableProperty.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/mitkPointSetIOFactory.cpp IO/mitkPointSetReader.cpp IO/mitkPointSetWriter.cpp IO/mitkPointSetWriterFactory.cpp IO/mitkRawImageFileReader.cpp IO/mitkStandardFileLocations.cpp IO/mitkSTLFileIOFactory.cpp IO/mitkSTLFileReader.cpp IO/mitkSurfaceVtkWriter.cpp IO/mitkSurfaceVtkWriterFactory.cpp IO/mitkVtkLoggingAdapter.cpp IO/mitkVtiFileIOFactory.cpp IO/mitkVtiFileReader.cpp IO/mitkVtkImageIOFactory.cpp IO/mitkVtkImageReader.cpp IO/mitkVtkSurfaceIOFactory.cpp IO/mitkVtkSurfaceReader.cpp IO/vtkPointSetXMLParser.cpp IO/mitkLog.cpp Rendering/mitkBaseRenderer.cpp Rendering/mitkVtkMapper.cpp Rendering/mitkRenderWindowFrame.cpp Rendering/mitkPlaneGeometryDataMapper2D.cpp Rendering/mitkPlaneGeometryDataVtkMapper3D.cpp Rendering/mitkGLMapper.cpp Rendering/mitkGradientBackground.cpp Rendering/mitkManufacturerLogo.cpp Rendering/mitkMapper.cpp Rendering/mitkPointSetGLMapper2D.cpp Rendering/mitkPointSetVtkMapper2D.cpp Rendering/mitkPointSetVtkMapper3D.cpp Rendering/mitkSurfaceGLMapper2D.cpp 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 - Rendering/mitkTextOverlay2D.cpp - Rendering/mitkTextOverlay3D.cpp - Rendering/mitkLabelOverlay3D.cpp - Rendering/mitkOverlay2DLayouter.cpp - Rendering/mitkScaleLegendOverlay - Common/mitkException.cpp Common/mitkCommon.h Common/mitkCoreObjectFactoryBase.cpp Common/mitkCoreObjectFactory.cpp Common/mitkCoreServices.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/Core/Documentation/Doxygen/Concepts/Overlays.dox b/Core/Documentation/Doxygen/Concepts/Overlays.dox index 0fb9ad3b1f..38e8b8d1e1 100644 --- a/Core/Documentation/Doxygen/Concepts/Overlays.dox +++ b/Core/Documentation/Doxygen/Concepts/Overlays.dox @@ -1,136 +1,123 @@ /** \page OverlaysPage Overlays and Annotations Concepts \tableofcontents \section OverlaysPage_Introduction Overlays and Annotations The overlays in MITK are a simple way to display additional information on the render windows. A class, deriving from mitk::Overlay represents an arbitrary 2D or 3D object that can be rendered as an overlay. This can for example be used for the annotation of 3D points or to overlay despriptions in the window corners. The mitk::OverlayManager is used to add the overlays to the renderwindows, updating them and manage the respective layout managers. The following features are implemented in this framework.
  1. Definition of graphical elements that can be displayed in the render windows.
  2. It is possible to manage multiple elements in each window.
  3. A single Overlay can be rendered on any number of available render windows.
  4. 2D and 3D textelements are already defined in the Overlay module and are using VTK to create custom annotations.
  5. The mitk::BaseLayouter interface enables the implementation of layout managers, to handle the placement of the overlays.
\section OverlaysPage_ArchitectureSection General Architecture \dot digraph linker_deps { node [shape=record, fontname=Helvetica, fontsize=10]; BR [ label="BaseRenderer" ]; BL [ label="{BaseLayouter|+ArrangeOverlays()}" ]; O [ label="{Overlay|-PropertyList|+RemoveOverlay(BaseRenderer*)\n+UpdateOverlay(BaseRenderer*)\n+RemoveOverlay(BaseRenderer*)}" ]; OM [ label="{OverlayManager|+AddOverlay(Overlay*)\n+RemoveOverlay(Overlay*)}" ]; TO [ label="TextOverlay" ]; VTKO [ label="{vtkOverlay|#GetVtkActor()}" ]; TO -> VTKO; VTKO -> O; OM -> O [style="dashed",label="manages"]; OM -> BL [style="dashed"]; OM -> BR [style="dashed"]; BR -> OM [style="dashed"]; } \enddot The mitk::Overlay can be implemented using a custom rendering framework like VTK. In this diagram, the vtkOverlay is shown as the superclass for all Overlays which use the vtk framework for rendering. The OverlayManager can be registered to several BaseRenderer instances in order to call the update method of each Overlay during the rendering phase of the renderer. It also manages the respective Layouters which are used to manage the placement of a group of Overlays. \subsection OverlaysPage_OverlaySubsection Overlay The mitk::Overlay is an abstract class that can manage property lists like the mitk::DataNode and provides the interfaces to thr three methods mitk::Overlay::AddOverlay, mitk::Overlay::UpdateOverlay and mitk::Overlay::RemoveOverlay. The subclasses of the mitk::Overlay have to implement these methods in order to provide the functionallity of an overlay. There are already a few implementations of mitk::Overlay which are using VTK as a rendering framework to display the Overlays. However the mitk::Overlay can also be implemented using OpenGL to draw the Overlay on the renderwindows. \subsection OverlaysPage_OverlayManagerSubsection OverlayManager The mitk::OverlayManager is the manager for a set of Overlays and the respective Layouters. Before the manager can be used, all mitk::BaseRenderer have to be registered to the mitk::OverlayManager instance like this: \snippet OverlayExample.cpp CreateOverlayManager The mitk::OverlayManager can then be used anywhere in the program by fetching it as follows: \snippet OverlayExample.cpp GetOverlayManagerInstance All mitk::Overlay instances can now be added to the OverlayManager by calling mitk::OverlayManager::AddOverlay. \subsection OverlaysPage_LayouterSubsection Layouter In order to use Layouters for the positioning of the Overlays, each Layouter object that has been created has to be added to an internal list in the OverlayManager: \snippet OverlayExample.cpp AddLayouter The mitk::OverlayManager::SetLayouter method can then be used to configure an Overlay to be positioned by a certain Layouter: \snippet OverlayExample.cpp SetLayouterToOverlay -\section OverlaysPage_UsageSection Usage of Predefined Overlays - -\subsection OverlaysPage_TextWidget2DUsageSubsection mitkTextOverlay2D -This exemplary overlay can render UTF-8 encoded text as a 2D Overlay. The Overlay2DLayouter can be used to automatically place a group of overlays to a -specific corner. -\snippet OverlayExample.cpp TextOverlay2D -\snippet OverlayExample.cpp SetLayouterToOverlay - -\subsection OverlaysPage_TextWidget3DUsageSubsection mitkTextOverlay3D -This overlay displays labels in 3D coordinates. The labels always face the camera. - -\snippet OverlayExample.cpp TextOverlay3D - \subsection OverlaysPage_NotManagedSubsection Manually Managed Overlays In order to integrate an Overlay into an mitk::Mapper, it is advised not to use the OverlayManager but to manually manage the Overlay. To do so, the update methods of the overlays have to be called manually before the start of each rendering procedure. It must only be called if the Properties have changed or if your custom overlay implements its own rendering mechanism. \section OverlaysPage_CustomOverlaySection Implement a Custom Overlay A new custom Overlay should derive from mitkOverlay or one of the later mentioned subclasses VtkOverlay2D oder VtkOverlay3D. There should always be an implementation for the methods AddOverlay, RemoveOverlay and Update Overlay. UpdateOverlay is the procedure that is called in each rendering step. If the Overlay is rendered by VTK, this method only applies the properties to the representation. If the custom Overlay requires additional properties, they should be made accessible by getters and setters for a better usability: \code void mitk::VtkOverlay3D::SetPosition3D(Point3D position3D, mitk::BaseRenderer *renderer) { mitk::Point3dProperty::Pointer position3dProperty = mitk::Point3dProperty::New(position3D); SetProperty("Position3D", position3dProperty,renderer); } mitk::Point3D mitk::VtkOverlay3D::GetPosition3D(mitk::BaseRenderer *renderer) { mitk::Point3D position3D; GetPropertyValue("Position3D", position3D, renderer); return position3D; } \endcode \subsection OverlaysPage_CustomVTK2DOverlaySubsection VTK 2D Overlay VTK based overlays which are meant to be displayed in 2D over the render window should derive from the mitk::VtkOverlay2D. The mitk::VtkOverlay2D is a subclass of Vtk::Overlay, that uses VTK to render the overlay. This class creates the Overlay representation as a vtkActor2D, and is very easy to implement because only UpdateVtkOverlay2D and GetVtkActor2D have to be implemented. The add, update and remove methods are implemented in the superclasses. UpdateVtkOverlay2D only needs to apply the specific properties and GetVtkActor2D simply returns the created vtkActor. \subsection OverlaysPage_CustomVTK3DOverlaySubsection VTK 3D Overlay The mitkVtkOverlay3D works just like mitkVtkOverlay2D, but it is designed for arbitrary 3D objects which derive from vtkProp, \section OverlaysPage_CustomLayouterSection Implement a Custom Layouter A Layouter is used for an automatic positioning of a group of Overlays and is derived from mitkBaseLayouter. Every Layouter that manages a group of Layouts should have a unique identifier which is used to register the Layouter in the OverlayManager. A Layouter is always uniquely defined by the identifier and one BaseRenderer. Before a Layouter can be used by the OverlayManager it has to be added, using the AddLayouter Method. An Overlay can then be added to a Layout as follows: \code overlayManager->SetLayouter(textOverlay.GetPointer(),mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT,axialRenderer); \endcode A new Layouter has to implement PrepareLayout which should parse the internal Overlay list and set their position as required. */ diff --git a/Documentation/Doxygen/DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox b/Documentation/Doxygen/DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox index 6e43c61bb7..978c30e49a 100644 --- a/Documentation/Doxygen/DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox +++ b/Documentation/Doxygen/DeveloperManual/Toolkit/ModuleManuals/MITKModuleManualsList.dox @@ -1,26 +1,27 @@ /** \page MITKModuleManualsListPage MITK Module Manuals \section MITKModuleManualsListPageOverview Overview The modules are shared libraries that provide functionality that can be used by developers. \section MITKModuleManualsListPageModuleManualList List of Module Manuals \li \subpage IGTGeneralModulePage \li \subpage MitkOpenCL_Overview \li \subpage GeneratingDeviceModulesPage \li \subpage mitkPython_Overview \li \subpage USModulePage + \li \subpage OverlaysModulePage \section MITKModuleManualsListPageAdditionalInformation Additional Information on Certain Modules \li \ref PlanarPropertiesPage \li \subpage DiffusionImagingPropertiesPage \li \subpage ConnectomicsRenderingPropertiesPage \section MITKMigrationGuides Migration Guides \li \subpage InteractionMigration \li \subpage GeometryMigration */ diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index 325c893441..d99efaf7d7 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -1,78 +1,79 @@ # Modules must be listed according to their dependencies set(module_dirs DataTypesExt AlgorithmsExt MapperExt IOExt DICOMReader DICOMTesting Qt4Qt5TestModule SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction ImageStatistics LegacyAdaptors IpPicSupport SceneSerialization GraphAlgorithms ContourModel SurfaceInterpolation Segmentation PlanarFigureSegmentation OpenViewCore QmlItems + Overlays QtWidgets QtWidgetsExt SegmentationUI DiffusionImaging GPGPU IGTBase IGT CameraCalibration RigidRegistration RigidRegistrationUI DeformableRegistration DeformableRegistrationUI OpenCL OpenCVVideoSupport - Overlays + QtOverlays InputDevices ToFHardware ToFProcessing ToFUI US USUI DicomUI Simulation Remeshing Python Persistence IGTUI VtkShaders ) if(MITK_ENABLE_PIC_READER) list(APPEND module_dirs IpPicSupportIO) endif() 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/Overlays/CMakeLists.txt b/Modules/Overlays/CMakeLists.txt index 8e485ba7e4..9e84619f32 100644 --- a/Modules/Overlays/CMakeLists.txt +++ b/Modules/Overlays/CMakeLists.txt @@ -1,21 +1,8 @@ -# unused variable found in qt src related to bug-16780 on osx using the compiler: Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) Target: x86_64-apple-darwin12.4.0 - -# In file included from /Users/Cordes/developing/src/MITK-Master/Modules/Overlays/QmitkScalarBar.cpp:20: -# In file included from /Users/Cordes/dartclients/toolkits/qt-4.8.4-Build/include/QtGui/QPaintEvent:1: -# In file included from /Users/Cordes/dartclients/toolkits/qt-4.8.4-Build/include/QtGui/qevent.h:52: -# /Users/Cordes/dartclients/toolkits/qt-4.8.4-Build/include/QtGui/qmime.h:119:10: error: private field 'type' is not used [-Werror,-Wunused-private-field] -# char type; -# ^ -# 1 error generated. - -# start fix for the module Overlays - -if(APPLE) - mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=unused-private-field" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) -endif() - -# end fix - -MITK_CREATE_MODULE(DEPENDS MitkQtWidgets +MITK_CREATE_MODULE(DEPENDS MitkCore WARNINGS_AS_ERRORS ) + +# build tests? +if(BUILD_TESTING) + add_subdirectory(Testing) +ENDIF() diff --git a/Core/Documentation/Doxygen/Concepts/Overlays.dox b/Modules/Overlays/Documentation/doxygen/OverlaysModule.dox similarity index 54% copy from Core/Documentation/Doxygen/Concepts/Overlays.dox copy to Modules/Overlays/Documentation/doxygen/OverlaysModule.dox index 0fb9ad3b1f..282f67eed5 100644 --- a/Core/Documentation/Doxygen/Concepts/Overlays.dox +++ b/Modules/Overlays/Documentation/doxygen/OverlaysModule.dox @@ -1,136 +1,82 @@ /** -\page OverlaysPage Overlays and Annotations Concepts +\page OverlaysModulePage Overlays and Annotations Module \tableofcontents -\section OverlaysPage_Introduction Overlays and Annotations +\section OverlaysModulePage_Introduction Overlays and Annotations The overlays in MITK are a simple way to display additional information on the render windows. A class, deriving from mitk::Overlay represents an arbitrary 2D or 3D object that can be rendered as an overlay. This can for example be used for the annotation of 3D points or to overlay despriptions in the window corners. The mitk::OverlayManager is used to add the overlays to the renderwindows, updating them and manage the respective layout managers. The following features are implemented in this framework.
  1. Definition of graphical elements that can be displayed in the render windows.
  2. It is possible to manage multiple elements in each window.
  3. A single Overlay can be rendered on any number of available render windows.
  4. 2D and 3D textelements are already defined in the Overlay module and are using VTK to create custom annotations.
  5. The mitk::BaseLayouter interface enables the implementation of layout managers, to handle the placement of the overlays.
-\section OverlaysPage_ArchitectureSection General Architecture - -\dot -digraph linker_deps { - node [shape=record, fontname=Helvetica, fontsize=10]; - BR [ label="BaseRenderer" ]; - BL [ label="{BaseLayouter|+ArrangeOverlays()}" ]; - O [ label="{Overlay|-PropertyList|+RemoveOverlay(BaseRenderer*)\n+UpdateOverlay(BaseRenderer*)\n+RemoveOverlay(BaseRenderer*)}" ]; - OM [ label="{OverlayManager|+AddOverlay(Overlay*)\n+RemoveOverlay(Overlay*)}" ]; - TO [ label="TextOverlay" ]; - VTKO [ label="{vtkOverlay|#GetVtkActor()}" ]; - TO -> VTKO; - VTKO -> O; - OM -> O [style="dashed",label="manages"]; - OM -> BL [style="dashed"]; - OM -> BR [style="dashed"]; - BR -> OM [style="dashed"]; -} -\enddot - -The mitk::Overlay can be implemented using a custom rendering framework like VTK. In this diagram, the vtkOverlay is shown as the superclass for all Overlays which use the vtk framework for rendering. -The OverlayManager can be registered to several BaseRenderer instances in order to call the update method of each Overlay during the rendering phase of the renderer. -It also manages the respective Layouters which are used to manage the placement of a group of Overlays. - -\subsection OverlaysPage_OverlaySubsection Overlay - -The mitk::Overlay is an abstract class that can manage property lists like the mitk::DataNode and provides the interfaces to thr three methods -mitk::Overlay::AddOverlay, mitk::Overlay::UpdateOverlay and mitk::Overlay::RemoveOverlay. The subclasses of the mitk::Overlay have to implement these methods -in order to provide the functionallity of an overlay. There are already a few implementations of mitk::Overlay which are using VTK as a rendering -framework to display the Overlays. However the mitk::Overlay can also be implemented using OpenGL to draw the Overlay on the renderwindows. - -\subsection OverlaysPage_OverlayManagerSubsection OverlayManager - -The mitk::OverlayManager is the manager for a set of Overlays and the respective Layouters. -Before the manager can be used, all mitk::BaseRenderer have to be registered to the mitk::OverlayManager instance like this: - -\snippet OverlayExample.cpp CreateOverlayManager - -The mitk::OverlayManager can then be used anywhere in the program by fetching it as follows: - -\snippet OverlayExample.cpp GetOverlayManagerInstance - -All mitk::Overlay instances can now be added to the OverlayManager by calling mitk::OverlayManager::AddOverlay. - -\subsection OverlaysPage_LayouterSubsection Layouter - -In order to use Layouters for the positioning -of the Overlays, each Layouter object that has been created has to be added to an internal list in the OverlayManager: - -\snippet OverlayExample.cpp AddLayouter - -The mitk::OverlayManager::SetLayouter method can then be used to configure an Overlay to be positioned by a certain Layouter: - -\snippet OverlayExample.cpp SetLayouterToOverlay - -\section OverlaysPage_UsageSection Usage of Predefined Overlays +\section OverlaysModulePage_ArchitectureSection General Architecture +\section OverlaysModulePage_UsageSection Usage of Predefined Overlays -\subsection OverlaysPage_TextWidget2DUsageSubsection mitkTextOverlay2D +\subsection OverlaysModulePage_TextWidget2DUsageSubsection mitkTextOverlay2D This exemplary overlay can render UTF-8 encoded text as a 2D Overlay. The Overlay2DLayouter can be used to automatically place a group of overlays to a specific corner. \snippet OverlayExample.cpp TextOverlay2D \snippet OverlayExample.cpp SetLayouterToOverlay -\subsection OverlaysPage_TextWidget3DUsageSubsection mitkTextOverlay3D +\subsection OverlaysModulePage_TextWidget3DUsageSubsection mitkTextOverlay3D This overlay displays labels in 3D coordinates. The labels always face the camera. \snippet OverlayExample.cpp TextOverlay3D -\subsection OverlaysPage_NotManagedSubsection Manually Managed Overlays +\subsection OverlaysModulePage_NotManagedSubsection Manually Managed Overlays In order to integrate an Overlay into an mitk::Mapper, it is advised not to use the OverlayManager but to manually manage the Overlay. To do so, the update methods of the overlays have to be called manually before the start of each rendering procedure. It must only be called if the Properties have changed or if your custom overlay implements its own rendering mechanism. -\section OverlaysPage_CustomOverlaySection Implement a Custom Overlay +\section OverlaysModulePage_CustomOverlaySection Implement a Custom Overlay A new custom Overlay should derive from mitkOverlay or one of the later mentioned subclasses VtkOverlay2D oder VtkOverlay3D. There should always be an implementation for the methods AddOverlay, RemoveOverlay and Update Overlay. UpdateOverlay is the procedure that is called in each rendering step. If the Overlay is rendered by VTK, this method only applies the properties to the representation. If the custom Overlay requires additional properties, they should be made accessible by getters and setters for a better usability: \code void mitk::VtkOverlay3D::SetPosition3D(Point3D position3D, mitk::BaseRenderer *renderer) { mitk::Point3dProperty::Pointer position3dProperty = mitk::Point3dProperty::New(position3D); SetProperty("Position3D", position3dProperty,renderer); } mitk::Point3D mitk::VtkOverlay3D::GetPosition3D(mitk::BaseRenderer *renderer) { mitk::Point3D position3D; GetPropertyValue("Position3D", position3D, renderer); return position3D; } \endcode -\subsection OverlaysPage_CustomVTK2DOverlaySubsection VTK 2D Overlay +\subsection OverlaysModulePage_CustomVTK2DOverlaySubsection VTK 2D Overlay VTK based overlays which are meant to be displayed in 2D over the render window should derive from the mitk::VtkOverlay2D. The mitk::VtkOverlay2D is a subclass of Vtk::Overlay, that uses VTK to render the overlay. This class creates the Overlay representation as a vtkActor2D, and is very easy to implement because only UpdateVtkOverlay2D and GetVtkActor2D have to be implemented. The add, update and remove methods are implemented in the superclasses. UpdateVtkOverlay2D only needs to apply the specific properties and GetVtkActor2D simply returns the created vtkActor. -\subsection OverlaysPage_CustomVTK3DOverlaySubsection VTK 3D Overlay +\subsection OverlaysModulePage_CustomVTK3DOverlaySubsection VTK 3D Overlay The mitkVtkOverlay3D works just like mitkVtkOverlay2D, but it is designed for arbitrary 3D objects which derive from vtkProp, -\section OverlaysPage_CustomLayouterSection Implement a Custom Layouter +\section OverlaysModulePage_CustomLayouterSection Implement a Custom Layouter A Layouter is used for an automatic positioning of a group of Overlays and is derived from mitkBaseLayouter. Every Layouter that manages a group of Layouts should have a unique identifier which is used to register the Layouter in the OverlayManager. A Layouter is always uniquely defined by the identifier and one BaseRenderer. Before a Layouter can be used by the OverlayManager it has to be added, using the AddLayouter Method. An Overlay can then be added to a Layout as follows: \code overlayManager->SetLayouter(textOverlay.GetPointer(),mitk::Overlay2DLayouter::STANDARD_2D_TOPLEFT,axialRenderer); \endcode A new Layouter has to implement PrepareLayout which should parse the internal Overlay list and set their position as required. */ diff --git a/Modules/Overlays/Testing/CMakeLists.txt b/Modules/Overlays/Testing/CMakeLists.txt new file mode 100644 index 0000000000..30f873f17c --- /dev/null +++ b/Modules/Overlays/Testing/CMakeLists.txt @@ -0,0 +1,36 @@ +MITK_CREATE_MODULE_TESTS() + +if(MITK_ENABLE_RENDERING_TESTING) ### since the rendering test's do not run in ubuntu, yet, we build them only for other systems or if the user explicitly sets the variable MITK_ENABLE_RENDERING_TESTING +mitkAddCustomModuleTest(mitkLabelOverlay3DRendering2DTest mitkLabelOverlay3DRendering2DTest #OverlayTest + -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkLabelOverlay3DRendering2DTest.png #corresponding reference screenshot +) + +mitkAddCustomModuleTest(mitkLabelOverlay3DRendering3DTest mitkLabelOverlay3DRendering3DTest #OverlayTest + -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkLabelOverlay3DRendering3DTest.png #corresponding reference screenshot +) + +mitkAddCustomModuleTest(mitkTextOverlay2DRenderingTest_ball mitkTextOverlay2DRenderingTest #OverlayTest + ${MITK_DATA_DIR}/ball.stl #input image to load in data storage + -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay2DRenderingTest_ball.png #corresponding reference screenshot +) + +#mitkAddCustomModuleTest(mitkTextOverlay2DLayouterRenderingTest_ball mitkTextOverlay2DLayouterRenderingTest #OverlayTest +# ${MITK_DATA_DIR}/ball.stl #input image to load in data storage +# -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay2DLayouterRenderingTest_ball.png #corresponding reference screenshot +#) + +mitkAddCustomModuleTest(mitkTextOverlay3DRendering2DTest_ball mitkTextOverlay3DRendering2DTest #OverlayTest + ${MITK_DATA_DIR}/ball.stl #input image to load in data storage + -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay3DRendering2DTest_ball.png #corresponding reference screenshot +) + +mitkAddCustomModuleTest(mitkTextOverlay3DRendering3DTest_ball mitkTextOverlay3DRendering3DTest #OverlayTest + ${MITK_DATA_DIR}/ball.stl #input image to load in data storage + -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay3DRendering3DTest_ball.png #corresponding reference screenshot +) + +mitkAddCustomModuleTest(mitkTextOverlay3DColorRenderingTest_ball mitkTextOverlay3DColorRenderingTest #OverlayTest + ${MITK_DATA_DIR}/ball.stl #input image to load in data storage + -V ${MITK_DATA_DIR}/RenderingTestData/ReferenceScreenshots/mitkTextOverlay3DColorRenderingTest_ball.png #corresponding reference screenshot +) +endif() diff --git a/Modules/Overlays/Testing/files.cmake b/Modules/Overlays/Testing/files.cmake new file mode 100644 index 0000000000..1ed23e2999 --- /dev/null +++ b/Modules/Overlays/Testing/files.cmake @@ -0,0 +1,9 @@ +set(MODULE_CUSTOM_TESTS + mitkLabelOverlay3DRendering2DTest.cpp + mitkLabelOverlay3DRendering3DTest.cpp + mitkTextOverlay2DRenderingTest.cpp + mitkTextOverlay2DLayouterRenderingTest.cpp + mitkTextOverlay3DRendering2DTest.cpp + mitkTextOverlay3DRendering3DTest.cpp + mitkTextOverlay3DColorRenderingTest.cpp +) diff --git a/Core/Code/Testing/mitkLabelOverlay3DRendering2DTest.cpp b/Modules/Overlays/Testing/mitkLabelOverlay3DRendering2DTest.cpp similarity index 100% rename from Core/Code/Testing/mitkLabelOverlay3DRendering2DTest.cpp rename to Modules/Overlays/Testing/mitkLabelOverlay3DRendering2DTest.cpp diff --git a/Core/Code/Testing/mitkLabelOverlay3DRendering3DTest.cpp b/Modules/Overlays/Testing/mitkLabelOverlay3DRendering3DTest.cpp similarity index 100% rename from Core/Code/Testing/mitkLabelOverlay3DRendering3DTest.cpp rename to Modules/Overlays/Testing/mitkLabelOverlay3DRendering3DTest.cpp diff --git a/Core/Code/Testing/mitkTextOverlay2DLayouterRenderingTest.cpp b/Modules/Overlays/Testing/mitkTextOverlay2DLayouterRenderingTest.cpp similarity index 100% rename from Core/Code/Testing/mitkTextOverlay2DLayouterRenderingTest.cpp rename to Modules/Overlays/Testing/mitkTextOverlay2DLayouterRenderingTest.cpp diff --git a/Core/Code/Testing/mitkTextOverlay2DRenderingTest.cpp b/Modules/Overlays/Testing/mitkTextOverlay2DRenderingTest.cpp similarity index 100% rename from Core/Code/Testing/mitkTextOverlay2DRenderingTest.cpp rename to Modules/Overlays/Testing/mitkTextOverlay2DRenderingTest.cpp diff --git a/Core/Code/Testing/mitkTextOverlay2DSymbolsRenderingTest.cpp b/Modules/Overlays/Testing/mitkTextOverlay2DSymbolsRenderingTest.cpp similarity index 100% rename from Core/Code/Testing/mitkTextOverlay2DSymbolsRenderingTest.cpp rename to Modules/Overlays/Testing/mitkTextOverlay2DSymbolsRenderingTest.cpp diff --git a/Core/Code/Testing/mitkTextOverlay3DColorRenderingTest.cpp b/Modules/Overlays/Testing/mitkTextOverlay3DColorRenderingTest.cpp similarity index 100% rename from Core/Code/Testing/mitkTextOverlay3DColorRenderingTest.cpp rename to Modules/Overlays/Testing/mitkTextOverlay3DColorRenderingTest.cpp diff --git a/Core/Code/Testing/mitkTextOverlay3DRendering2DTest.cpp b/Modules/Overlays/Testing/mitkTextOverlay3DRendering2DTest.cpp similarity index 100% rename from Core/Code/Testing/mitkTextOverlay3DRendering2DTest.cpp rename to Modules/Overlays/Testing/mitkTextOverlay3DRendering2DTest.cpp diff --git a/Core/Code/Testing/mitkTextOverlay3DRendering3DTest.cpp b/Modules/Overlays/Testing/mitkTextOverlay3DRendering3DTest.cpp similarity index 100% rename from Core/Code/Testing/mitkTextOverlay3DRendering3DTest.cpp rename to Modules/Overlays/Testing/mitkTextOverlay3DRendering3DTest.cpp diff --git a/Modules/Overlays/files.cmake b/Modules/Overlays/files.cmake index 920488e50e..992123387c 100644 --- a/Modules/Overlays/files.cmake +++ b/Modules/Overlays/files.cmake @@ -1,16 +1,11 @@ -SET(CPP_FILES - QmitkCustomWidgetOverlay.cpp - QmitkOverlay.cpp - QmitkOverlayController.cpp - QmitkScalarBar.cpp - QmitkScalarBarOverlay.cpp - QmitkTextOverlay.cpp +set(H_FILES ) - -SET(MOC_H_FILES - QmitkOverlay.h - QmitkOverlayController.h - QmitkScalarBar.h - QmitkScalarBarOverlay.h +set(CPP_FILES + mitkTextOverlay2D.cpp + mitkTextOverlay3D.cpp + mitkLabelOverlay3D.cpp + mitkOverlay2DLayouter.cpp + mitkScaleLegendOverlay.cpp ) + diff --git a/Core/Code/Rendering/mitkLabelOverlay3D.cpp b/Modules/Overlays/mitkLabelOverlay3D.cpp similarity index 100% rename from Core/Code/Rendering/mitkLabelOverlay3D.cpp rename to Modules/Overlays/mitkLabelOverlay3D.cpp diff --git a/Core/Code/Rendering/mitkLabelOverlay3D.h b/Modules/Overlays/mitkLabelOverlay3D.h similarity index 97% rename from Core/Code/Rendering/mitkLabelOverlay3D.h rename to Modules/Overlays/mitkLabelOverlay3D.h index 3cc10ce496..585a76a15f 100644 --- a/Core/Code/Rendering/mitkLabelOverlay3D.h +++ b/Modules/Overlays/mitkLabelOverlay3D.h @@ -1,116 +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 LabelOverlay3D_H #define LabelOverlay3D_H #include #include -#include "MitkCoreExports.h" +#include "MitkOverlaysExports.h" #include class vtkStringArray; class vtkPolyDataMapper; class vtkPolyData; class vtkActor2D; class vtkProperty2D; class vtkPointSetToLabelHierarchy; class vtkLabelPlacementMapper; class vtkIntArray; namespace mitk { class PointSet; /** \brief Can display a high amount of 3D labels to a PointSet */ -class MITK_CORE_EXPORT LabelOverlay3D : public mitk::VtkOverlay3D { +class MitkOverlays_EXPORT LabelOverlay3D : public mitk::VtkOverlay3D { public: /** \brief Internal class holding the vtkActor, etc. for each of the render windows */ class LocalStorage : public mitk::Overlay::BaseLocalStorage { public: vtkSmartPointer m_Points; vtkSmartPointer m_LabelsActor; vtkSmartPointer m_Sizes; vtkSmartPointer m_Labels; vtkSmartPointer m_LabelMapper; vtkSmartPointer m_PointSetToLabelHierarchyFilter; /** \brief Timestamp of last update of stored data. */ itk::TimeStamp m_LastUpdateTime; /** \brief Default constructor of the local storage. */ LocalStorage(); /** \brief Default deconstructor of the local storage. */ ~LocalStorage(); }; mitkClassMacro(LabelOverlay3D, mitk::VtkOverlay3D); itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** \brief Set the vector of labels that are shown to each corresponding point3D. The size has to be equal to the provided LabelCoordinates. */ void SetLabelVector(const std::vector& LabelVector); /** \brief Optional: Provide a vector of priorities. The labels with higher priorities will be visible in lower LOD */ void SetPriorityVector(const std::vector& PriorityVector); /** \brief Coordinates of the labels */ void SetLabelCoordinates(itk::SmartPointer LabelCoordinates); void PointSetModified(const itk::Object *, const itk::EventObject &); protected: /** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */ mutable mitk::LocalStorageHandler m_LSH; virtual vtkProp *GetVtkProp(BaseRenderer *renderer) const; void UpdateVtkOverlay(mitk::BaseRenderer *renderer); /** \brief explicit constructor which disallows implicit conversions */ explicit LabelOverlay3D(); /** \brief virtual destructor in order to derive from this class */ virtual ~LabelOverlay3D(); private: /** \brief The char arrays in this vector are displayed at the corresponding coordinates.*/ std::vector m_LabelVector; /** \brief values in this array set a priority to each label. Higher priority labels are not covert by labels with lower priority.*/ std::vector m_PriorityVector; /** \brief The coordinates of the labels. Indices must match the labelVector and the priorityVector.*/ itk::SmartPointer m_LabelCoordinates; unsigned long m_PointSetModifiedObserverTag; /** \brief copy constructor */ LabelOverlay3D( const LabelOverlay3D &); /** \brief assignment operator */ LabelOverlay3D &operator=(const LabelOverlay3D &); }; } // namespace mitk #endif // LabelOverlay3D_H diff --git a/Core/Code/Rendering/mitkOverlay2DLayouter.cpp b/Modules/Overlays/mitkOverlay2DLayouter.cpp similarity index 100% rename from Core/Code/Rendering/mitkOverlay2DLayouter.cpp rename to Modules/Overlays/mitkOverlay2DLayouter.cpp diff --git a/Core/Code/Rendering/mitkOverlay2DLayouter.h b/Modules/Overlays/mitkOverlay2DLayouter.h similarity index 95% rename from Core/Code/Rendering/mitkOverlay2DLayouter.h rename to Modules/Overlays/mitkOverlay2DLayouter.h index 81856eee5d..bbbfcab04a 100644 --- a/Core/Code/Rendering/mitkOverlay2DLayouter.h +++ b/Modules/Overlays/mitkOverlay2DLayouter.h @@ -1,74 +1,74 @@ /*=================================================================== 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 MITKOVERLAY2DLAYOUTER_H #define MITKOVERLAY2DLAYOUTER_H -#include +#include #include namespace mitk { /** @brief A simple implementation of a layouter for 2D Overlays */ -class MITK_CORE_EXPORT Overlay2DLayouter : public mitk::AbstractOverlayLayouter { +class MitkOverlays_EXPORT Overlay2DLayouter : public mitk::AbstractOverlayLayouter { public: enum Alignment{TopLeft, Top, TopRight, BottomLeft, Bottom, BottomRight}; mitkClassMacro(Overlay2DLayouter, mitk::AbstractOverlayLayouter); itkFactorylessNewMacro(Self) itkCloneMacro(Self) static std::string STANDARD_2D_TOPLEFT(); static std::string STANDARD_2D_TOP(); static std::string STANDARD_2D_TOPRIGHT(); static std::string STANDARD_2D_BOTTOMLEFT(); static std::string STANDARD_2D_BOTTOM(); static std::string STANDARD_2D_BOTTOMRIGHT(); /** \brief Factory method for the different kinds of Layouters */ /** Create a Layouter that, depending on the identifier sorts the Overlays in one corner of the Renderwindow*/ static Overlay2DLayouter::Pointer CreateLayouter(Alignment alignment, BaseRenderer* renderer); /** \brief Factory method for the different kinds of Layouters */ /** Create a Layouter that, depending on the identifier sorts the Overlays in one corner of the Renderwindow*/ static Overlay2DLayouter::Pointer CreateLayouter(const std::string& identifier, BaseRenderer* renderer); void PrepareLayout(); protected: /** \brief explicit constructor which disallows implicit conversions */ explicit Overlay2DLayouter(); /** \brief virtual destructor in order to derive from this class */ virtual ~Overlay2DLayouter(); Alignment m_Alignment; double m_Margin; private: /** \brief copy constructor */ Overlay2DLayouter( const Overlay2DLayouter &); /** \brief assignment operator */ Overlay2DLayouter &operator=(const Overlay2DLayouter &); }; } // namespace mitk #endif // MITKOVERLAY2DLAYOUTER_H diff --git a/Core/Code/Rendering/mitkScaleLegendOverlay.cpp b/Modules/Overlays/mitkScaleLegendOverlay.cpp similarity index 100% rename from Core/Code/Rendering/mitkScaleLegendOverlay.cpp rename to Modules/Overlays/mitkScaleLegendOverlay.cpp diff --git a/Core/Code/Rendering/mitkScaleLegendOverlay.h b/Modules/Overlays/mitkScaleLegendOverlay.h similarity index 96% rename from Core/Code/Rendering/mitkScaleLegendOverlay.h rename to Modules/Overlays/mitkScaleLegendOverlay.h index 68f3619f51..22207afaf4 100644 --- a/Core/Code/Rendering/mitkScaleLegendOverlay.h +++ b/Modules/Overlays/mitkScaleLegendOverlay.h @@ -1,100 +1,100 @@ /*=================================================================== 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 SCALELEGENDOVERLAY_H #define SCALELEGENDOVERLAY_H #include #include #include -#include "MitkCoreExports.h" +#include "MitkOverlaysExports.h" class vtkLegendScaleActor; namespace mitk { /** \brief Displays configurable scales on the renderwindow. The scale is determined by the image spacing. */ -class MITK_CORE_EXPORT ScaleLegendOverlay : public mitk::VtkOverlay { +class MitkOverlays_EXPORT ScaleLegendOverlay : public mitk::VtkOverlay { public: class LocalStorage : public mitk::Overlay::BaseLocalStorage { public: /** \brief Actor of a 2D render window. */ vtkSmartPointer m_legendScaleActor; /** \brief Timestamp of last update of stored data. */ itk::TimeStamp m_LastUpdateTime; /** \brief Default constructor of the local storage. */ LocalStorage(); /** \brief Default deconstructor of the local storage. */ ~LocalStorage(); }; mitkClassMacro(ScaleLegendOverlay, mitk::VtkOverlay); itkFactorylessNewMacro(Self) itkCloneMacro(Self) void SetRightAxisVisibility(bool visibility); bool GetRightAxisVisibility() const; void SetLeftAxisVisibility(bool visibility); bool GetLeftAxisVisibility() const; void SetTopAxisVisibility(bool visibility); bool GetTopAxisVisibility() const; void SetBottomAxisVisibility(bool visibility); bool GetBottomAxisVisibility() const; void SetLegendVisibility(bool visibility); bool GetLegendVisibility() const; void SetRightBorderOffset(int offset); int GetRightBorderOffset() const; void SetCornerOffsetFactor(float offsetFactor); float GetCornerOffsetFactor() const; protected: /** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */ mutable mitk::LocalStorageHandler m_LSH; virtual vtkProp* GetVtkProp(BaseRenderer *renderer) const; virtual void UpdateVtkOverlay(BaseRenderer *renderer); /** \brief explicit constructor which disallows implicit conversions */ explicit ScaleLegendOverlay(); /** \brief virtual destructor in order to derive from this class */ virtual ~ScaleLegendOverlay(); private: /** \brief copy constructor */ ScaleLegendOverlay( const ScaleLegendOverlay &); /** \brief assignment operator */ ScaleLegendOverlay &operator=(const ScaleLegendOverlay &); }; } // namespace mitk #endif // SCALELEGENDOVERLAY_H diff --git a/Core/Code/Rendering/mitkTextOverlay2D.cpp b/Modules/Overlays/mitkTextOverlay2D.cpp similarity index 100% rename from Core/Code/Rendering/mitkTextOverlay2D.cpp rename to Modules/Overlays/mitkTextOverlay2D.cpp diff --git a/Core/Code/Rendering/mitkTextOverlay2D.h b/Modules/Overlays/mitkTextOverlay2D.h similarity index 95% rename from Core/Code/Rendering/mitkTextOverlay2D.h rename to Modules/Overlays/mitkTextOverlay2D.h index a1e23233b9..7902853043 100644 --- a/Core/Code/Rendering/mitkTextOverlay2D.h +++ b/Modules/Overlays/mitkTextOverlay2D.h @@ -1,86 +1,86 @@ /*=================================================================== 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 TEXTOVERLAY2D_H #define TEXTOVERLAY2D_H #include #include #include -#include "MitkCoreExports.h" +#include "MitkOverlaysExports.h" class vtkTextActor; class vtkImageMapper; class vtkImageData; namespace mitk { /** \brief Displays text on the renderwindow */ -class MITK_CORE_EXPORT TextOverlay2D : public mitk::VtkOverlay2D { +class MitkOverlays_EXPORT TextOverlay2D : public mitk::VtkOverlay2D { public: class LocalStorage : public mitk::Overlay::BaseLocalStorage { public: /** \brief Actor of a 2D render window. */ vtkSmartPointer m_textActor; vtkSmartPointer m_textImage; vtkSmartPointer m_imageMapper; /** \brief Timestamp of last update of stored data. */ itk::TimeStamp m_LastUpdateTime; /** \brief Default constructor of the local storage. */ LocalStorage(); /** \brief Default deconstructor of the local storage. */ ~LocalStorage(); }; mitkClassMacro(TextOverlay2D, mitk::VtkOverlay2D); itkFactorylessNewMacro(Self) itkCloneMacro(Self) virtual Overlay::Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const; virtual void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds& bounds); protected: /** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */ mutable mitk::LocalStorageHandler m_LSH; virtual vtkActor2D* GetVtkActor2D(BaseRenderer *renderer) const; void UpdateVtkOverlay2D(mitk::BaseRenderer *renderer); /** \brief explicit constructor which disallows implicit conversions */ explicit TextOverlay2D(); /** \brief virtual destructor in order to derive from this class */ virtual ~TextOverlay2D(); private: /** \brief copy constructor */ TextOverlay2D( const TextOverlay2D &); /** \brief assignment operator */ TextOverlay2D &operator=(const TextOverlay2D &); }; } // namespace mitk #endif // TEXTOVERLAY2D_H diff --git a/Core/Code/Rendering/mitkTextOverlay3D.cpp b/Modules/Overlays/mitkTextOverlay3D.cpp similarity index 100% rename from Core/Code/Rendering/mitkTextOverlay3D.cpp rename to Modules/Overlays/mitkTextOverlay3D.cpp diff --git a/Core/Code/Rendering/mitkTextOverlay3D.h b/Modules/Overlays/mitkTextOverlay3D.h similarity index 96% rename from Core/Code/Rendering/mitkTextOverlay3D.h rename to Modules/Overlays/mitkTextOverlay3D.h index 065d00b073..78b47ec0e1 100644 --- a/Core/Code/Rendering/mitkTextOverlay3D.h +++ b/Modules/Overlays/mitkTextOverlay3D.h @@ -1,90 +1,90 @@ /*=================================================================== 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 TextOverlay3D_H #define TextOverlay3D_H #include #include -#include "MitkCoreExports.h" +#include "MitkOverlaysExports.h" class vtkFollower; class vtkVectorText; class vtkTextActor3D; namespace mitk { /** \brief Displays at 3D position, always facing the camera */ -class MITK_CORE_EXPORT TextOverlay3D : public mitk::VtkOverlay3D { +class MitkOverlays_EXPORT TextOverlay3D : public mitk::VtkOverlay3D { public: /** \brief Internal class holding the mapper, actor, etc. for each of the render windows */ /** * To render the Overlay on transveral, coronal, and sagittal, the update method * is called for each renderwindow. For performance reasons, the corresponding data * for each view is saved in the internal helper class LocalStorage. * This allows rendering n views with just 1 mitkOverlay using n vtkMapper. * */ class LocalStorage : public mitk::Overlay::BaseLocalStorage { public: /** \brief Actor of a 2D render window. */ vtkSmartPointer m_follower; vtkSmartPointer m_textSource; /** \brief Timestamp of last update of stored data. */ itk::TimeStamp m_LastUpdateTime; /** \brief Default constructor of the local storage. */ LocalStorage(); /** \brief Default deconstructor of the local storage. */ ~LocalStorage(); }; mitkClassMacro(TextOverlay3D, mitk::VtkOverlay3D); itkFactorylessNewMacro(Self) itkCloneMacro(Self) protected: /** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */ mutable mitk::LocalStorageHandler m_LSH; virtual vtkProp* GetVtkProp(BaseRenderer *renderer) const; void UpdateVtkOverlay(mitk::BaseRenderer *renderer); /** \brief explicit constructor which disallows implicit conversions */ explicit TextOverlay3D(); /** \brief virtual destructor in order to derive from this class */ virtual ~TextOverlay3D(); private: /** \brief copy constructor */ TextOverlay3D( const TextOverlay3D &); /** \brief assignment operator */ TextOverlay3D &operator=(const TextOverlay3D &); }; } // namespace mitk #endif // TextOverlay3D_H diff --git a/Modules/Overlays/CMakeLists.txt b/Modules/QtOverlays/CMakeLists.txt similarity index 100% copy from Modules/Overlays/CMakeLists.txt copy to Modules/QtOverlays/CMakeLists.txt diff --git a/Modules/Overlays/QmitkCustomWidgetOverlay.cpp b/Modules/QtOverlays/QmitkCustomWidgetOverlay.cpp similarity index 100% rename from Modules/Overlays/QmitkCustomWidgetOverlay.cpp rename to Modules/QtOverlays/QmitkCustomWidgetOverlay.cpp diff --git a/Modules/Overlays/QmitkCustomWidgetOverlay.h b/Modules/QtOverlays/QmitkCustomWidgetOverlay.h similarity index 100% rename from Modules/Overlays/QmitkCustomWidgetOverlay.h rename to Modules/QtOverlays/QmitkCustomWidgetOverlay.h diff --git a/Modules/Overlays/QmitkOverlay.cpp b/Modules/QtOverlays/QmitkOverlay.cpp similarity index 100% rename from Modules/Overlays/QmitkOverlay.cpp rename to Modules/QtOverlays/QmitkOverlay.cpp diff --git a/Modules/Overlays/QmitkOverlay.h b/Modules/QtOverlays/QmitkOverlay.h similarity index 100% rename from Modules/Overlays/QmitkOverlay.h rename to Modules/QtOverlays/QmitkOverlay.h diff --git a/Modules/Overlays/QmitkOverlayController.cpp b/Modules/QtOverlays/QmitkOverlayController.cpp similarity index 100% rename from Modules/Overlays/QmitkOverlayController.cpp rename to Modules/QtOverlays/QmitkOverlayController.cpp diff --git a/Modules/Overlays/QmitkOverlayController.h b/Modules/QtOverlays/QmitkOverlayController.h similarity index 100% rename from Modules/Overlays/QmitkOverlayController.h rename to Modules/QtOverlays/QmitkOverlayController.h diff --git a/Modules/Overlays/QmitkScalarBar.cpp b/Modules/QtOverlays/QmitkScalarBar.cpp similarity index 100% rename from Modules/Overlays/QmitkScalarBar.cpp rename to Modules/QtOverlays/QmitkScalarBar.cpp diff --git a/Modules/Overlays/QmitkScalarBar.h b/Modules/QtOverlays/QmitkScalarBar.h similarity index 100% rename from Modules/Overlays/QmitkScalarBar.h rename to Modules/QtOverlays/QmitkScalarBar.h diff --git a/Modules/Overlays/QmitkScalarBarOverlay.cpp b/Modules/QtOverlays/QmitkScalarBarOverlay.cpp similarity index 100% rename from Modules/Overlays/QmitkScalarBarOverlay.cpp rename to Modules/QtOverlays/QmitkScalarBarOverlay.cpp diff --git a/Modules/Overlays/QmitkScalarBarOverlay.h b/Modules/QtOverlays/QmitkScalarBarOverlay.h similarity index 100% rename from Modules/Overlays/QmitkScalarBarOverlay.h rename to Modules/QtOverlays/QmitkScalarBarOverlay.h diff --git a/Modules/Overlays/QmitkTextOverlay.cpp b/Modules/QtOverlays/QmitkTextOverlay.cpp similarity index 100% rename from Modules/Overlays/QmitkTextOverlay.cpp rename to Modules/QtOverlays/QmitkTextOverlay.cpp diff --git a/Modules/Overlays/QmitkTextOverlay.h b/Modules/QtOverlays/QmitkTextOverlay.h similarity index 100% rename from Modules/Overlays/QmitkTextOverlay.h rename to Modules/QtOverlays/QmitkTextOverlay.h diff --git a/Modules/Overlays/files.cmake b/Modules/QtOverlays/files.cmake similarity index 100% copy from Modules/Overlays/files.cmake copy to Modules/QtOverlays/files.cmake diff --git a/Modules/QtWidgets/CMakeLists.txt b/Modules/QtWidgets/CMakeLists.txt index 36db107362..c55beb2393 100644 --- a/Modules/QtWidgets/CMakeLists.txt +++ b/Modules/QtWidgets/CMakeLists.txt @@ -1,8 +1,8 @@ MITK_CREATE_MODULE( - DEPENDS MitkPlanarFigure + DEPENDS MitkPlanarFigure MitkOverlays PACKAGE_DEPENDS VTK|vtkGUISupportQt Qt4|QtGui SUBPROJECTS MITK-CoreUI EXPORT_DEFINE QMITK_EXPORT ) add_subdirectory(Testing) diff --git a/Modules/ToFUI/CMakeLists.txt b/Modules/ToFUI/CMakeLists.txt index 30a3150377..c42c0e2e76 100644 --- a/Modules/ToFUI/CMakeLists.txt +++ b/Modules/ToFUI/CMakeLists.txt @@ -1,7 +1,7 @@ MITK_CREATE_MODULE( SUBPROJECTS MITK-ToF INCLUDE_DIRS Qmitk - DEPENDS MitkToFHardware MitkToFProcessing MitkQtWidgetsExt MitkOverlays + DEPENDS MitkToFHardware MitkToFProcessing MitkQtWidgetsExt GENERATED_CPP ${TOOL_GUI_CPPS} ${TOOL_CPPS} ) diff --git a/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.cpp b/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.cpp index 87a199a91f..4055497ed9 100644 --- a/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.cpp +++ b/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.cpp @@ -1,437 +1,435 @@ /*=================================================================== 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 "QmitkToFPointSetWidget.h" -#include - #include #include #include const std::string QmitkToFPointSetWidget::VIEW_ID = "org.mitk.views.qmitktofpointsetwidget"; QmitkToFPointSetWidget::QmitkToFPointSetWidget(QWidget* parent, Qt::WindowFlags f): QWidget(parent, f) , m_DataStorage(NULL) , m_DistanceImage(NULL) , m_CameraIntrinsics(NULL) , m_VtkTextActor(NULL) , m_ForegroundRenderer1(NULL) , m_ForegroundRenderer2(NULL) , m_ForegroundRenderer3(NULL) , m_RenderWindow1(NULL) , m_RenderWindow2(NULL) , m_RenderWindow3(NULL) , m_MeasurementPointSet2D(NULL) , m_MeasurementPointSet3DNode(NULL) , m_PointSet2D(NULL) , m_PointSet3DNode(NULL) , m_PointSetInteractor(NULL) , m_MeasurementPointSetInteractor(NULL) , m_MeasurementPointSetChangedObserverTag(0) , m_PointSetChangedObserverTag(0) , m_WindowHeight(0) { m_Controls = NULL; CreateQtPartControl(this); } QmitkToFPointSetWidget::~QmitkToFPointSetWidget() { this->CleanUpWidget(); } void QmitkToFPointSetWidget::CreateQtPartControl(QWidget *parent) { if (!m_Controls) { // create GUI widgets m_Controls = new Ui::QmitkToFPointSetWidgetControls; m_Controls->setupUi(parent); this->CreateConnections(); } } void QmitkToFPointSetWidget::CreateConnections() { if ( m_Controls ) { connect( (QObject*)(m_Controls->measureButton), SIGNAL(clicked()),(QObject*) this, SLOT(OnMeasurement()) ); connect( (QObject*)(m_Controls->pointSetButton), SIGNAL(clicked()),(QObject*) this, SLOT(OnPointSet()) ); } } void QmitkToFPointSetWidget::InitializeWidget(QHash renderWindowHashMap, mitk::DataStorage::Pointer dataStorage, mitk::CameraIntrinsics::Pointer cameraIntrinsics) { // initialize members m_CameraIntrinsics = cameraIntrinsics; m_DataStorage = dataStorage; // m_RenderWindowPart = renderWindowPart; m_RenderWindow1 = renderWindowHashMap.value("axial")->GetRenderWindow(); m_RenderWindow2 = renderWindowHashMap.value("sagittal")->GetRenderWindow(); m_RenderWindow3 = renderWindowHashMap.value("coronal")->GetRenderWindow(); m_RenderWindow4 = renderWindowHashMap.value("3d")->GetRenderWindow(); if ((m_RenderWindow1 != NULL) && (m_RenderWindow2 != NULL) && (m_RenderWindow3 != NULL) && (m_RenderWindow4 != NULL) && (dataStorage.IsNotNull())) { // enable buttons m_Controls->pointSetButton->setEnabled(true); m_Controls->measureButton->setEnabled(true); // initialize overlays this->m_VtkTextActor = vtkSmartPointer::New(); this->m_VtkTextActor->SetInput("Choose measurement points with SHIFT+Click"); m_WindowHeight = renderWindowHashMap.value("axial")->GetRenderer()->GetSizeY(); this->m_VtkTextActor->SetDisplayPosition(10,m_WindowHeight-30); this->m_VtkTextActor->GetTextProperty()->SetFontSize(16); // this->m_VtkTextActor->GetTextProperty()->SetColor(1,0,0); this->m_VtkTextActor->GetTextProperty()->BoldOn(); this->m_VtkTextActor->SetVisibility(0); if (m_ForegroundRenderer1==NULL) { this->m_ForegroundRenderer1 = vtkSmartPointer::New(); this->m_ForegroundRenderer1->AddActor(m_VtkTextActor); mitk::VtkLayerController::GetInstance(m_RenderWindow1)->InsertForegroundRenderer(m_ForegroundRenderer1,true); } if (m_ForegroundRenderer2==NULL) { this->m_ForegroundRenderer2 = vtkSmartPointer::New(); this->m_ForegroundRenderer2->AddActor(m_VtkTextActor); mitk::VtkLayerController::GetInstance(m_RenderWindow2)->InsertForegroundRenderer(m_ForegroundRenderer2,true); } if (m_ForegroundRenderer3==NULL) { this->m_ForegroundRenderer3 =vtkSmartPointer::New(); this->m_ForegroundRenderer3->AddActor(m_VtkTextActor); mitk::VtkLayerController::GetInstance(m_RenderWindow3)->InsertForegroundRenderer(m_ForegroundRenderer3,true); } mitk::DataNode::Pointer measurementPointSet2DNode = dataStorage->GetNamedNode("Measurement PointSet 2D") ; if(dataStorage->Exists(measurementPointSet2DNode)) { dataStorage->Remove(measurementPointSet2DNode); } // initialize 2D measurement point set m_MeasurementPointSet2D = mitk::PointSet::New(); measurementPointSet2DNode = mitk::DataNode::New(); measurementPointSet2DNode->SetName("Measurement PointSet 2D"); measurementPointSet2DNode->SetBoolProperty("helper object",true); measurementPointSet2DNode->SetBoolProperty("show contour",true); measurementPointSet2DNode->SetVisibility(false, renderWindowHashMap.value("3d")->GetRenderer()); measurementPointSet2DNode->SetData(m_MeasurementPointSet2D); dataStorage->Add(measurementPointSet2DNode); m_MeasurementPointSetInteractor = mitk::PointSetInteractor::New("pointsetinteractor",measurementPointSet2DNode,2); // create observer for m_MeasurementPointSet2D itk::SimpleMemberCommand::Pointer measurementPointSetChangedCommand; measurementPointSetChangedCommand = itk::SimpleMemberCommand::New(); measurementPointSetChangedCommand->SetCallbackFunction(this, &QmitkToFPointSetWidget::MeasurementPointSetChanged); m_MeasurementPointSetChangedObserverTag = m_MeasurementPointSet2D->AddObserver(itk::ModifiedEvent(), measurementPointSetChangedCommand); // initialize 3D measurement PointSet m_MeasurementPointSet3DNode = dataStorage->GetNamedNode("Measurement PointSet 3D"); if(dataStorage->Exists(m_MeasurementPointSet3DNode)) { dataStorage->Remove(m_MeasurementPointSet3DNode); } m_MeasurementPointSet3DNode = mitk::DataNode::New(); m_MeasurementPointSet3DNode->SetName("Measurement PointSet 3D"); m_MeasurementPointSet3DNode->SetBoolProperty("helper object",true); m_MeasurementPointSet3DNode->SetBoolProperty("show contour",true); m_MeasurementPointSet3DNode->SetFloatProperty("pointsize",5.0f); mitk::PointSet::Pointer measurementPointSet3D = mitk::PointSet::New(); m_MeasurementPointSet3DNode->SetData(measurementPointSet3D); dataStorage->Add(m_MeasurementPointSet3DNode); // initialize PointSets mitk::DataNode::Pointer pointSet2DNode = dataStorage->GetNamedNode("ToF PointSet 2D") ; if(dataStorage->Exists(pointSet2DNode)) { dataStorage->Remove(pointSet2DNode); } m_PointSet2D = mitk::PointSet::New(); pointSet2DNode = mitk::DataNode::New(); pointSet2DNode->SetName("ToF PointSet 2D"); pointSet2DNode->SetVisibility(false, renderWindowHashMap.value("3d")->GetRenderer()); pointSet2DNode->SetData(m_PointSet2D); dataStorage->Add(pointSet2DNode); m_PointSetInteractor = mitk::PointSetInteractor::New("pointsetinteractor",pointSet2DNode); // create observer for m_MeasurementPointSet2D itk::SimpleMemberCommand::Pointer pointSetChangedCommand; pointSetChangedCommand = itk::SimpleMemberCommand::New(); pointSetChangedCommand->SetCallbackFunction(this, &QmitkToFPointSetWidget::PointSetChanged); m_PointSetChangedObserverTag = m_PointSet2D->AddObserver(itk::ModifiedEvent(), pointSetChangedCommand); // initialize 3D point set mitk::DataNode::Pointer pointSet3DNode = dataStorage->GetNamedNode("ToF PointSet 3D"); if(dataStorage->Exists(pointSet3DNode)) { dataStorage->Remove(pointSet3DNode); } m_PointSet3DNode = mitk::DataNode::New(); m_PointSet3DNode->SetName("ToF PointSet 3D"); m_PointSet3DNode->SetFloatProperty("pointsize",5.0f); mitk::PointSet::Pointer pointSet3D = mitk::PointSet::New(); m_PointSet3DNode->SetData(pointSet3D); dataStorage->Add(m_PointSet3DNode); } } void QmitkToFPointSetWidget::CleanUpWidget() { // toggle button state if (m_Controls->measureButton->isChecked()) { m_Controls->measureButton->setChecked(false); this->OnMeasurement(); } if (m_Controls->pointSetButton->isChecked()) { m_Controls->pointSetButton->setChecked(false); this->OnPointSet(); } // remove observer if (m_MeasurementPointSet2D.IsNotNull()) { m_MeasurementPointSet2D->RemoveObserver(m_MeasurementPointSetChangedObserverTag); } if (m_PointSet2D.IsNotNull()) { m_PointSet2D->RemoveObserver(m_PointSetChangedObserverTag); } // if (m_DistanceImage.IsNotNull()) // { // m_DistanceImage->RemoveObserver(m_DistanceImageChangedObserverTag); // } // remove foreground renderer if (m_ForegroundRenderer1&&m_RenderWindow1) { if (mitk::VtkLayerController::GetInstance(m_RenderWindow1)) { mitk::VtkLayerController::GetInstance(m_RenderWindow1)->RemoveRenderer(m_ForegroundRenderer1); } m_ForegroundRenderer1 = NULL; } if (m_ForegroundRenderer2&&m_RenderWindow2) { if (mitk::VtkLayerController::GetInstance(m_RenderWindow2)) { mitk::VtkLayerController::GetInstance(m_RenderWindow2)->RemoveRenderer(m_ForegroundRenderer2); } m_ForegroundRenderer2 = NULL; } if (m_ForegroundRenderer3&&m_RenderWindow3) { if (mitk::VtkLayerController::GetInstance(m_RenderWindow3)) { mitk::VtkLayerController::GetInstance(m_RenderWindow3)->RemoveRenderer(m_ForegroundRenderer3); } m_ForegroundRenderer3 = NULL; } if (mitk::RenderingManager::GetInstance()) { mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } } void QmitkToFPointSetWidget::SetDistanceImage(mitk::Image::Pointer distanceImage) { // // remove existing observer // if (m_DistanceImage.IsNotNull()) // { // m_DistanceImage->RemoveObserver(m_DistanceImageChangedObserverTag); // } m_DistanceImage = distanceImage; // // create observer for m_DistanceImage // itk::SimpleMemberCommand::Pointer distanceImageChangedCommand; // distanceImageChangedCommand = itk::SimpleMemberCommand::New(); // distanceImageChangedCommand->SetCallbackFunction(this, &QmitkToFPointSetWidget::MeasurementPointSetChanged); // m_DistanceImageChangedObserverTag = m_DistanceImage->AddObserver(itk::ModifiedEvent(), distanceImageChangedCommand); } void QmitkToFPointSetWidget::SetCameraIntrinsics(mitk::CameraIntrinsics::Pointer cameraIntrinsics) { m_CameraIntrinsics = cameraIntrinsics; } void QmitkToFPointSetWidget::OnMeasurement() { // always show 2D PointSet in foreground mitk::DataNode::Pointer pointSetNode = m_DataStorage->GetNamedNode("Measurement PointSet 2D"); if (pointSetNode.IsNotNull()) { pointSetNode->SetIntProperty("layer",100); } if (m_Controls->measureButton->isChecked()) { // disable point set interaction if (m_Controls->pointSetButton->isChecked()) { m_Controls->pointSetButton->setChecked(false); // remove interactor mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_PointSetInteractor); } // show overlays m_VtkTextActor->SetVisibility(1); this->m_VtkTextActor->SetInput("Choose measurement points with SHIFT+Click"); // enable interactor mitk::GlobalInteraction::GetInstance()->AddInteractor(m_MeasurementPointSetInteractor); // initial update of measurement this->MeasurementPointSetChanged(); } else { // hide overlays m_VtkTextActor->SetVisibility(0); // disable interactor mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_MeasurementPointSetInteractor); } } void QmitkToFPointSetWidget::OnPointSet() { // always show 2D PointSet in foreground mitk::DataNode::Pointer pointSetNode = m_DataStorage->GetNamedNode("ToF PointSet 2D"); if (pointSetNode.IsNotNull()) { pointSetNode->SetIntProperty("layer",100); } if (m_Controls->pointSetButton->isChecked()) { // disable measurement if (m_Controls->measureButton->isChecked()) { m_Controls->measureButton->setChecked(false); // remove interactor mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_MeasurementPointSetInteractor); } // show overlays m_VtkTextActor->SetVisibility(1); this->m_VtkTextActor->SetInput("Choose points with SHIFT+Click"); // enable interactor mitk::GlobalInteraction::GetInstance()->AddInteractor(m_PointSetInteractor); // initial update of PointSet this->PointSetChanged(); } else { // hide overlays m_VtkTextActor->SetVisibility(0); // disable interactor mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_PointSetInteractor); } } void QmitkToFPointSetWidget::MeasurementPointSetChanged() { // replace text actor this->m_VtkTextActor->SetDisplayPosition(10,m_WindowHeight-30); if (m_MeasurementPointSet2D->GetSize()==2) { // check if points are inside the image range int imageSizeX = m_DistanceImage->GetDimensions()[0]; int imageSizeY = m_DistanceImage->GetDimensions()[1]; mitk::Point3D point1 = m_MeasurementPointSet2D->GetPoint(0); mitk::Point3D point2 = m_MeasurementPointSet2D->GetPoint(1); if ((point1[0]>=0.0f)&&(point1[0]=0)&&(point1[1]=0.0f)&&(point2[0]=0)&&(point2[1]SetCameraIntrinsics(m_CameraIntrinsics); } toFDistanceImageToPointSetFilter->SetInput(m_DistanceImage); toFDistanceImageToPointSetFilter->SetSubset(m_MeasurementPointSet2D); toFDistanceImageToPointSetFilter->Update(); mitk::PointSet::Pointer measurementPointSet3D = toFDistanceImageToPointSetFilter->GetOutput(); m_MeasurementPointSet3DNode->SetData(measurementPointSet3D); // calculate distance between points if (measurementPointSet3D->GetSize()==2) { mitk::Point3D point1 = measurementPointSet3D->GetPoint(0); mitk::Point3D point2 = measurementPointSet3D->GetPoint(1); float distance = point1.EuclideanDistanceTo(point2); std::stringstream stream; stream<m_VtkTextActor->SetInput(stream.str().c_str()); } else { this->m_VtkTextActor->SetInput("Choose measurement points with SHIFT+Click"); } } else { this->m_VtkTextActor->SetInput("Measurement outside image range."); } } else { // initialize 3D pointset empty mitk::PointSet::Pointer pointSet3D = mitk::PointSet::New(); m_MeasurementPointSet3DNode->SetData(pointSet3D); } } void QmitkToFPointSetWidget::PointSetChanged() { if (m_DistanceImage.IsNotNull()) { int imageSizeX = m_DistanceImage->GetDimensions()[0]; int imageSizeY = m_DistanceImage->GetDimensions()[1]; int pointSetValid = 1; for (int i=0; iGetSize(); i++) { mitk::Point3D currentPoint = m_PointSet2D->GetPoint(i); if ((currentPoint[0]>=0.0f)&&(currentPoint[0]=0)&&(currentPoint[1]GetSize()>0) { if (pointSetValid) { // create PointSet filter mitk::ToFDistanceImageToPointSetFilter::Pointer toFDistanceImageToPointSetFilter = mitk::ToFDistanceImageToPointSetFilter::New(); if (m_CameraIntrinsics.IsNotNull()) { toFDistanceImageToPointSetFilter->SetCameraIntrinsics(m_CameraIntrinsics); } toFDistanceImageToPointSetFilter->SetInput(m_DistanceImage); toFDistanceImageToPointSetFilter->SetSubset(m_PointSet2D); toFDistanceImageToPointSetFilter->Update(); mitk::PointSet::Pointer pointSet3D = toFDistanceImageToPointSetFilter->GetOutput(); m_PointSet3DNode->SetData(pointSet3D); this->m_VtkTextActor->SetInput("Choose points with SHIFT+Click"); } else { this->m_VtkTextActor->SetInput("Point set outside image range."); } } else { // initialize 3D pointset empty mitk::PointSet::Pointer pointSet3D = mitk::PointSet::New(); m_PointSet3DNode->SetData(pointSet3D); } } }