diff --git a/Modules/DiffusionImaging/Testing/CMakeLists.txt b/Modules/DiffusionImaging/Testing/CMakeLists.txt index b08720a69b..eaccd7ac0c 100644 --- a/Modules/DiffusionImaging/Testing/CMakeLists.txt +++ b/Modules/DiffusionImaging/Testing/CMakeLists.txt @@ -1,10 +1,12 @@ MITK_CREATE_MODULE_TESTS() mitkAddCustomModuleTest(mitkFiberBundleXReaderWriterTest mitkFiberBundleXReaderWriterTest ${MITK_DATA_DIR}/DiffusionImaging/fiberBundleX.fib) +mitkAddCustomModuleTest(mitkGibbsTrackingTest mitkGibbsTrackingTest ${MITK_DATA_DIR}/DiffusionImaging/qBallImage.qbi ${MITK_DATA_DIR}/DiffusionImaging/diffusionImageMask.nrrd ${MITK_DATA_DIR}/DiffusionImaging/gibbsTrackingParameters.gtp ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ ${MITK_DATA_DIR}/DiffusionImaging/fiberBundleX.fib) +mitkAddCustomModuleTest(mitkFiberBundleXTest mitkFiberBundleXTest ${MITK_DATA_DIR}/DiffusionImaging/fiberBundleX.fib) mitkAddCustomModuleTest(mitkTbssNrrdImageReaderTest mitkTbssNrrdImageReaderTest ${MITK_DATA_DIR}/DiffusionImaging/tbss.tbss) #mitkAddCustomModuleTest(mitkTbssRoiNrrdImageReaderTest mitkTbssRoiNrrdImageReaderTest ${MITK_DATA_DIR}/DiffusionImaging/bodyfornix.roi) mitkAddCustomModuleTest(mitkTbssNrrdImageWriterTest mitkTbssNrrdImageWriterTest ${MITK_DATA_DIR}/DiffusionImaging/tbss.tbss ${MITK_DATA_DIR}/DiffusionImaging/tbss2.tbss) diff --git a/Modules/DiffusionImaging/Testing/files.cmake b/Modules/DiffusionImaging/Testing/files.cmake index 5e2911f640..7d6f605ab5 100644 --- a/Modules/DiffusionImaging/Testing/files.cmake +++ b/Modules/DiffusionImaging/Testing/files.cmake @@ -1,15 +1,15 @@ SET(MODULE_CUSTOM_TESTS mitkFiberBundleXReaderWriterTest.cpp - # mitkFiberBundleXTest.cpp ## deactivated, see bug 12017 - # mitkGibbsTrackingTest.cpp # deactivated until new tarball is available + mitkFiberBundleXTest.cpp + mitkGibbsTrackingTest.cpp mitkTbssNrrdImageReaderTest.cpp #mitkTbssRoiNrrdImageReaderTest.cpp mitkTbssNrrdImageWriterTest.cpp ) -set(MODULE_TESTS - mitkFactoryRegistrationTest.cpp +set(MODULE_TESTS + mitkFactoryRegistrationTest.cpp ) diff --git a/Modules/DiffusionImaging/Testing/mitkGibbsTrackingTest.cpp b/Modules/DiffusionImaging/Testing/mitkGibbsTrackingTest.cpp index cf057f06a1..98a470b701 100644 --- a/Modules/DiffusionImaging/Testing/mitkGibbsTrackingTest.cpp +++ b/Modules/DiffusionImaging/Testing/mitkGibbsTrackingTest.cpp @@ -1,92 +1,99 @@ /*=================================================================== 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 #include #include #include #include #include #include using namespace mitk; /**Documentation * Test for gibbs tracking filter */ int mitkGibbsTrackingTest(int argc, char* argv[]) { MITK_TEST_BEGIN("mitkGibbsTrackingTest"); MITK_TEST_CONDITION_REQUIRED(argc>5,"check for input data") QBallImage::Pointer mitkQballImage; Image::Pointer mitkMaskImage; mitk::FiberBundleX::Pointer fib1; try{ + + MITK_INFO << "Q-Ball image: " << argv[1]; + MITK_INFO << "Mask image: " << argv[2]; + MITK_INFO << "Parameter file: " << argv[3]; + MITK_INFO << "Lut path: " << argv[4]; + MITK_INFO << "Reference bundle: " << argv[5]; + RegisterDiffusionImagingObjectFactory(); // test if fib1 can be read const std::string s1="", s2=""; std::vector infile = mitk::BaseDataIO::LoadBaseDataFromFile( argv[1], s1, s2, false ); mitkQballImage = dynamic_cast(infile.at(0).GetPointer()); MITK_TEST_CONDITION_REQUIRED(mitkQballImage.IsNotNull(),"check qball image") infile = mitk::BaseDataIO::LoadBaseDataFromFile( argv[2], s1, s2, false ); mitkMaskImage = dynamic_cast(infile.at(0).GetPointer()); - MITK_TEST_CONDITION_REQUIRED(mitkMaskImage.IsNotNull(),"check qball image") + MITK_TEST_CONDITION_REQUIRED(mitkMaskImage.IsNotNull(),"check mask image") infile = mitk::BaseDataIO::LoadBaseDataFromFile( argv[5], s1, s2, false ); fib1 = dynamic_cast(infile.at(0).GetPointer()); MITK_TEST_CONDITION_REQUIRED(fib1.IsNotNull(),"check fiber bundle") typedef itk::Vector OdfVectorType; typedef itk::Image OdfVectorImgType; typedef itk::Image MaskImgType; typedef itk::GibbsTrackingFilter GibbsTrackingFilterType; OdfVectorImgType::Pointer itk_qbi = OdfVectorImgType::New(); mitk::CastToItkImage(mitkQballImage, itk_qbi); MaskImgType::Pointer itk_mask = MaskImgType::New(); mitk::CastToItkImage(mitkMaskImage, itk_mask); GibbsTrackingFilterType::Pointer gibbsTracker = GibbsTrackingFilterType::New(); gibbsTracker->SetQBallImage(itk_qbi.GetPointer()); gibbsTracker->SetMaskImage(itk_mask); gibbsTracker->SetDuplicateImage(false); gibbsTracker->SetRandomSeed(1); gibbsTracker->SetParameterFile(argv[3]); gibbsTracker->SetLutPath(argv[4]); gibbsTracker->Update(); mitk::FiberBundleX::Pointer fib2 = mitk::FiberBundleX::New(gibbsTracker->GetFiberBundle()); MITK_TEST_CONDITION_REQUIRED(fib1->Equals(fib2), "check if gibbs tracking has changed"); gibbsTracker->SetRandomSeed(0); gibbsTracker->Update(); fib2 = mitk::FiberBundleX::New(gibbsTracker->GetFiberBundle()); MITK_TEST_CONDITION_REQUIRED(!fib1->Equals(fib2), "check if gibbs tracking has changed after wrong seed"); } catch(...) { return EXIT_FAILURE; } // always end with this! MITK_TEST_END(); }