From 7d070bafd01a22dfef1c422097ac1a0e6935749b Mon Sep 17 00:00:00 2001 From: dsarrut Date: Wed, 15 Dec 2010 08:54:23 +0000 Subject: [PATCH] add test --- segmentation/CMakeLists.txt | 16 ++++++++++++++-- segmentation/clitkTestFilter.cxx | 21 +++++++++++++++++++-- segmentation/clitkTestFilter.ggo | 4 ++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/segmentation/CMakeLists.txt b/segmentation/CMakeLists.txt index 4b6b2dc..0018e1f 100644 --- a/segmentation/CMakeLists.txt +++ b/segmentation/CMakeLists.txt @@ -38,11 +38,11 @@ IF(CLITK_BUILD_SEGMENTATION) WRAP_GGO(clitkExtractMediastinum_GGO_C clitkExtractMediastinum.ggo) ADD_EXECUTABLE(clitkExtractMediastinum clitkExtractMediastinum.cxx ${clitkExtractMediastinum_GGO_C}) - TARGET_LINK_LIBRARIES(clitkExtractMediastinum clitkCommon clitkSegmentationGgoLib ITKIO) + TARGET_LINK_LIBRARIES(clitkExtractMediastinum clitkCommon clitkSegmentationGgoLib ITKStatistics ITKIO) WRAP_GGO(clitkExtractLymphStations_GGO_C clitkExtractLymphStations.ggo) ADD_EXECUTABLE(clitkExtractLymphStations clitkExtractLymphStations.cxx clitkFilterWithAnatomicalFeatureDatabaseManagement.cxx ${clitkExtractLymphStations_GGO_C}) - TARGET_LINK_LIBRARIES(clitkExtractLymphStations clitkSegmentationGgoLib clitkCommon ITKIO ) + TARGET_LINK_LIBRARIES(clitkExtractLymphStations clitkSegmentationGgoLib clitkCommon ITKIO ITKStatistics) WRAP_GGO(clitkMorphoMath_GGO_C clitkMorphoMath.ggo) ADD_EXECUTABLE(clitkMorphoMath clitkMorphoMath.cxx clitkMorphoMathGenericFilter.cxx ${clitkMorphoMath_GGO_C}) @@ -79,4 +79,16 @@ IF(CLITK_BUILD_SEGMENTATION) WRAP_GGO(clitkFillImageRegion_GGO_C clitkFillImageRegion.ggo) ADD_EXECUTABLE(clitkFillImageRegion clitkFillImageRegion.cxx clitkFillImageRegionGenericFilter.cxx ${clitkFillImageRegion_GGO_C}) TARGET_LINK_LIBRARIES(clitkFillImageRegion clitkCommon ITKIO) + + WRAP_GGO(clitkTestFilter_GGO_C clitkTestFilter.ggo) + ADD_EXECUTABLE(clitkTestFilter clitkTestFilter.cxx ${clitkTestFilter_GGO_C}) + TARGET_LINK_LIBRARIES(clitkTestFilter clitkSegmentationGgoLib clitkCommon ITKIO) + ENDIF(CLITK_BUILD_SEGMENTATION) + +# ADD_EXECUTABLE(ScalarImageMarkovRandomField1 ScalarImageMarkovRandomField1.cxx) +# TARGET_LINK_LIBRARIES(ScalarImageMarkovRandomField1 clitkCommon ITKIO ITKStatistics) +# ADD_EXECUTABLE(ScalarImageKmeansClassifier ScalarImageKmeansClassifier.cxx) +# TARGET_LINK_LIBRARIES(ScalarImageKmeansClassifier clitkCommon ITKIO ITKStatistics) + + diff --git a/segmentation/clitkTestFilter.cxx b/segmentation/clitkTestFilter.cxx index a0b386d..37c6d91 100644 --- a/segmentation/clitkTestFilter.cxx +++ b/segmentation/clitkTestFilter.cxx @@ -30,6 +30,8 @@ #include "clitkExtractPatientFilter.h" #include "clitkExtractMediastinumFilter.h" +#include "clitkTestStation7.h" + // ITK ENST #include "RelativePositionPropImageFilter.h" @@ -49,7 +51,7 @@ int main(int argc, char * argv[]) { InputImageType::Pointer input1; InputImageType::Pointer input2; InputImageType::Pointer input3; - input1 = clitk::readImage(args_info.input1_arg, true); + if (args_info.input1_given) input1 = clitk::readImage(args_info.input1_arg, true); if (args_info.input2_given) input2 = clitk::readImage(args_info.input2_arg, true); if (args_info.input3_given) input3 = clitk::readImage(args_info.input3_arg, true); @@ -74,7 +76,7 @@ int main(int argc, char * argv[]) { //-------------------------------------------------------------------- // Filter test AutoCropLabelImageFilter - if (1) { + if (0) { typedef clitk::AutoCropFilter FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInput(input1); @@ -155,6 +157,7 @@ int main(int argc, char * argv[]) { //-------------------------------------------------------------------- // Filter test ExtractPatientFilter if (0) { + /* typedef itk::Image OutputImageType; typedef clitk::ExtractPatientFilter FilterType; FilterType::Pointer filter = FilterType::New(); @@ -167,11 +170,13 @@ int main(int argc, char * argv[]) { filter->Update(); OutputImageType::Pointer output = filter->GetOutput(); clitk::writeImage(output, args_info.output_arg); + */ } //-------------------------------------------------------------------- // Filter test ExtractLungsFilter if (0) { + /* typedef itk::Image OutputImageType; // to change into char typedef clitk::ExtractLungFilter FilterType; FilterType::Pointer filter = FilterType::New(); @@ -188,11 +193,13 @@ int main(int argc, char * argv[]) { filter->Update(); OutputImageType::Pointer output = filter->GetOutput(); clitk::writeImage(output, args_info.output_arg); + */ } //-------------------------------------------------------------------- // Filter test ExtractMediastinumFilter if (0) { + /* typedef clitk::ExtractMediastinumFilter FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInputPatientLabelImage(input1); @@ -203,6 +210,16 @@ int main(int argc, char * argv[]) { filter->Update(); output = filter->GetOutput(); clitk::writeImage(output, args_info.output_arg); + */ + } + + //-------------------------------------------------------------------- + // Test for auto register sub-task in a segmentation process + if (1) { + ExtractLymphStation_7 * s7 = new ExtractLymphStation_7; + // s7->SetArgsInfo(args_info); + // GetParent->SetArgsInfo<> + s7->StartSegmentation(); } // This is the end my friend diff --git a/segmentation/clitkTestFilter.ggo b/segmentation/clitkTestFilter.ggo index d9778e7..6ab0ebb 100644 --- a/segmentation/clitkTestFilter.ggo +++ b/segmentation/clitkTestFilter.ggo @@ -6,10 +6,10 @@ purpose "Test a filter" option "config" - "Config file" string no option "verbose" v "Verbose" flag off -option "input1" i "Input 1 image filename" string yes +option "input1" i "Input 1 image filename" string no option "input2" j "Input 2 image filename" string no option "input3" k "Input 3 image filename" string no -option "output" o "Output image filename" string yes +option "output" o "Output image filename" string no option "angle1" a "First angle (degree)" float default = "0" no option "angle2" b "Second angle (degree)" float default = "0" no -- 2.47.1