diff --git a/CMakeExternals/MITKData.cmake b/CMakeExternals/MITKData.cmake index 987bca9739..078bbe37ed 100644 --- a/CMakeExternals/MITKData.cmake +++ b/CMakeExternals/MITKData.cmake @@ -1,35 +1,35 @@ #----------------------------------------------------------------------------- # MITK Data #----------------------------------------------------------------------------- # Sanity checks if(DEFINED MITK_DATA_DIR AND NOT EXISTS ${MITK_DATA_DIR}) message(FATAL_ERROR "MITK_DATA_DIR variable is defined but corresponds to non-existing directory") endif() set(proj MITK-Data) set(proj_DEPENDENCIES) set(MITK-Data_DEPENDS ${proj}) if(BUILD_TESTING) - set(revision_tag 5e202c70) + set(revision_tag af8a3ea5) # ^^^^^^^^ these are just to check correct length of hash part ExternalProject_Add(${proj} URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MITK-Data_${revision_tag}.tar.gz UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" DEPENDS ${proj_DEPENDENCIES} ) set(MITK_DATA_DIR ${ep_source_dir}/${proj}) else() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") endif(BUILD_TESTING) diff --git a/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake b/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake index 1636461432..b9094d4f2a 100644 --- a/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake +++ b/Modules/DiffusionImaging/DiffusionCore/Testing/files.cmake @@ -1,12 +1,12 @@ set(MODULE_TESTS mitkFactoryRegistrationTest.cpp mitkDiffusionImageEqualTest.cpp ) set(MODULE_CUSTOM_TESTS mitkPyramidImageRegistrationMethodTest.cpp mitkDWHeadMotionCorrectionTest.cpp mitkImageReconstructionTest.cpp - itkNonLocalMeansDenoisingTest.cpp + mitkNonLocalMeansDenoisingTest.cpp ) diff --git a/Modules/DiffusionImaging/DiffusionCore/Testing/itkNonLocalMeansDenoisingTest.cpp b/Modules/DiffusionImaging/DiffusionCore/Testing/mitkNonLocalMeansDenoisingTest.cpp similarity index 95% rename from Modules/DiffusionImaging/DiffusionCore/Testing/itkNonLocalMeansDenoisingTest.cpp rename to Modules/DiffusionImaging/DiffusionCore/Testing/mitkNonLocalMeansDenoisingTest.cpp index 71694b4f44..e3c70f3b87 100644 --- a/Modules/DiffusionImaging/DiffusionCore/Testing/itkNonLocalMeansDenoisingTest.cpp +++ b/Modules/DiffusionImaging/DiffusionCore/Testing/mitkNonLocalMeansDenoisingTest.cpp @@ -1,124 +1,124 @@ /*=================================================================== 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 "mitkDiffusionImage.h" #include "mitkIOUtil.h" #include "mitkTestingMacros.h" #include "mitkTestFixture.h" #include "itkNonLocalMeansDenoisingFilter.h" -class itkNonLocalMeansDenoisingTestSuite : public mitk::TestFixture +class mitkNonLocalMeansDenoisingTestSuite : public mitk::TestFixture { - CPPUNIT_TEST_SUITE(itkNonLocalMeansDenoisingTestSuite); + CPPUNIT_TEST_SUITE(mitkNonLocalMeansDenoisingTestSuite); MITK_TEST(Denoise_NLMr_1_1_shouldReturnTrue); MITK_TEST(Denoise_NLMv_1_1_1_shouldReturnTrue); CPPUNIT_TEST_SUITE_END(); private: /** Members used inside the different (sub-)tests. All members are initialized via setUp().*/ mitk::DiffusionImage::Pointer m_Image; mitk::DiffusionImage::Pointer m_ReferenceImage; mitk::DiffusionImage::Pointer m_DenoisedImage; itk::Image::Pointer m_ImageMask; itk::NonLocalMeansDenoisingFilter::Pointer m_DenoisingFilter; public: /** * @brief Setup Always call this method before each Test-case to ensure correct and new intialization of the used members for a new test case. (If the members are not used in a test, the method does not need to be called). */ void setUp() { //generate test images std::string imagePath = GetTestDataFilePath("DiffusionImaging/Denoising/test_multi.dwi"); std::string maskPath = GetTestDataFilePath("DiffusionImaging/Denoising/denoising_mask.nrrd"); m_Image = static_cast*>( mitk::IOUtil::LoadImage(imagePath).GetPointer()); mitk::Image::Pointer imageMask = static_cast( mitk::IOUtil::LoadImage(maskPath).GetPointer()); mitk::CastToItkImage(imageMask, m_ImageMask); m_ReferenceImage = NULL; m_DenoisedImage = mitk::DiffusionImage::New(); //initialise Filter m_DenoisingFilter = itk::NonLocalMeansDenoisingFilter::New(); m_DenoisingFilter->SetInputImage(m_Image->GetVectorImage()); m_DenoisingFilter->SetInputMask(m_ImageMask); m_DenoisingFilter->SetNumberOfThreads(1); m_DenoisingFilter->SetComparisonRadius(1); m_DenoisingFilter->SetSearchRadius(1); } void tearDown() { m_Image = NULL; m_ImageMask = NULL; m_ReferenceImage = NULL; m_DenoisingFilter = NULL; m_DenoisedImage = NULL; } void Denoise_NLMr_1_1_shouldReturnTrue() { std::string referenceImagePath = GetTestDataFilePath("DiffusionImaging/Denoising/test_multi_NLMr_1-1.dwi"); m_ReferenceImage = static_cast*>( mitk::IOUtil::LoadImage(referenceImagePath).GetPointer()); m_DenoisingFilter->SetUseJointInformation(false); try { m_DenoisingFilter->Update(); } catch(std::exception& e) { MITK_ERROR << e.what(); } m_DenoisedImage->SetVectorImage(m_DenoisingFilter->GetOutput()); m_DenoisedImage->SetReferenceBValue(m_Image->GetReferenceBValue()); m_DenoisedImage->SetDirections(m_Image->GetDirections()); m_DenoisedImage->InitializeFromVectorImage(); MITK_ASSERT_EQUAL( m_DenoisedImage, m_ReferenceImage, "NLMr should always return the same result."); } void Denoise_NLMv_1_1_1_shouldReturnTrue() { std::string referenceImagePath = GetTestDataFilePath("DiffusionImaging/Denoising/test_multi_NLMv_1-1-1.dwi"); m_ReferenceImage = static_cast*>( mitk::IOUtil::LoadImage(referenceImagePath).GetPointer()); m_DenoisingFilter->SetChannelRadius(1); m_DenoisingFilter->SetUseJointInformation(true); try { m_DenoisingFilter->Update(); } catch(std::exception& e) { MITK_ERROR << e.what(); } m_DenoisedImage->SetVectorImage(m_DenoisingFilter->GetOutput()); m_DenoisedImage->SetReferenceBValue(m_Image->GetReferenceBValue()); m_DenoisedImage->SetDirections(m_Image->GetDirections()); m_DenoisedImage->InitializeFromVectorImage(); MITK_ASSERT_EQUAL( m_DenoisedImage, m_ReferenceImage, "NLMv should always return the same result."); } }; -MITK_TEST_SUITE_REGISTRATION(itkNonLocalMeansDenoising) +MITK_TEST_SUITE_REGISTRATION(mitkNonLocalMeansDenoising)