From 9181935185e263a306c1aabb5bbcfb6160d14f6f Mon Sep 17 00:00:00 2001 From: jef Date: Fri, 23 Jul 2010 15:16:13 +0000 Subject: [PATCH] *** empty log message *** --- segmentation/CMakeLists.txt | 4 - segmentation/clitkBinarizeImage.cxx | 51 -------- segmentation/clitkBinarizeImage.ggo | 14 --- .../clitkBinarizeImageGenericFilter.cxx | 72 ----------- .../clitkBinarizeImageGenericFilter.h | 115 ------------------ .../clitkBinarizeImageGenericFilter.txx | 108 ---------------- 6 files changed, 364 deletions(-) delete mode 100755 segmentation/clitkBinarizeImage.cxx delete mode 100755 segmentation/clitkBinarizeImage.ggo delete mode 100755 segmentation/clitkBinarizeImageGenericFilter.cxx delete mode 100755 segmentation/clitkBinarizeImageGenericFilter.h delete mode 100755 segmentation/clitkBinarizeImageGenericFilter.txx diff --git a/segmentation/CMakeLists.txt b/segmentation/CMakeLists.txt index 7e79a5f..feb9906 100644 --- a/segmentation/CMakeLists.txt +++ b/segmentation/CMakeLists.txt @@ -72,10 +72,6 @@ WRAP_GGO(clitkLevelSetSegmentation_GGO_C clitkLevelSetSegmentation.ggo) ADD_EXECUTABLE(clitkLevelSetSegmentation clitkLevelSetSegmentation.cxx clitkLevelSetSegmentationGenericFilter.cxx ${clitkLevelSetSegmentation_GGO_C}) TARGET_LINK_LIBRARIES(clitkLevelSetSegmentation clitkCommon ITKIO) -# WRAP_GGO(clitkBinarizeImage_GGO_C clitkBinarizeImage.ggo) -# ADD_EXECUTABLE(clitkBinarizeImage clitkBinarizeImage.cxx clitkBinarizeImageGenericFilter.cxx ${clitkBinarizeImage_GGO_C}) -# TARGET_LINK_LIBRARIES(clitkBinarizeImage clitkCommon ITKIO) - WRAP_GGO(clitkAnd_GGO_C clitkAnd.ggo) ADD_EXECUTABLE(clitkAnd clitkAnd.cxx clitkAndGenericFilter.cxx ${clitkAnd_GGO_C}) TARGET_LINK_LIBRARIES(clitkAnd clitkCommon ITKIO ) diff --git a/segmentation/clitkBinarizeImage.cxx b/segmentation/clitkBinarizeImage.cxx deleted file mode 100755 index aa68ad7..0000000 --- a/segmentation/clitkBinarizeImage.cxx +++ /dev/null @@ -1,51 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ - -/* ================================================= - * @file clitkBinarizeImageGenericFilter.txx - * @author Jef Vandemeulebroucke - * @date 29 June 2009 - * - * @brief Binarize an image - * - ===================================================*/ - - -// clitk -#include "clitkBinarizeImage_ggo.h" -#include "clitkIO.h" -#include "clitkBinarizeImageGenericFilter.h" - - -//-------------------------------------------------------------------- -int main(int argc, char * argv[]) { - - // Init command line - GGO(clitkBinarizeImage, args_info); - CLITK_INIT; - - // Filter - clitk::BinarizeImageGenericFilter::Pointer genericFilter=clitk::BinarizeImageGenericFilter::New(); - - genericFilter->SetArgsInfo(args_info); - genericFilter->Update(); - - return EXIT_SUCCESS; -}// end main - -//-------------------------------------------------------------------- diff --git a/segmentation/clitkBinarizeImage.ggo b/segmentation/clitkBinarizeImage.ggo deleted file mode 100755 index 851f6f7..0000000 --- a/segmentation/clitkBinarizeImage.ggo +++ /dev/null @@ -1,14 +0,0 @@ -#File clitkBinarizeImage.ggo -Package "clitkBinarizeImage" -version "1.0" -purpose "Binarize an image using a lower and/or upper threshold, and by specifying inside and outside values" - -option "config" - "Config file" string no -option "verbose" v "Verbose" flag off - -option "input" i "Input image filename" string yes -option "output" o "Output image filename" string yes -option "lower" l "Lower intensity (default=min)" double no -option "upper" u "Upper intensity (default=max)" double no -option "inside" - "Inside value" double no default="1" -option "outside" - "Outside value" double no default="0" diff --git a/segmentation/clitkBinarizeImageGenericFilter.cxx b/segmentation/clitkBinarizeImageGenericFilter.cxx deleted file mode 100755 index 4306065..0000000 --- a/segmentation/clitkBinarizeImageGenericFilter.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ -#ifndef clitkBinarizeImageGenericFilter_cxx -#define clitkBinarizeImageGenericFilter_cxx - -/* ================================================= - * @file clitkBinarizeImageGenericFilter.cxx - * @author Jef Vandemeulebroucke - * @date 29 june 2009 - * - * @brief - * - ===================================================*/ - -#include "clitkBinarizeImageGenericFilter.h" - - -namespace clitk -{ - - - //----------------------------------------------------------- - // Constructor - //----------------------------------------------------------- - BinarizeImageGenericFilter::BinarizeImageGenericFilter() - { - m_Verbose=false; - m_InputFileName=""; - } - - - //----------------------------------------------------------- - // Update - //----------------------------------------------------------- - void BinarizeImageGenericFilter::Update() - { - // Read the Dimension and PixelType - int Dimension; - std::string PixelType; - ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType); - - - // Call UpdateWithDim - if(Dimension==2) UpdateWithDim<2>(PixelType); - else if(Dimension==3) UpdateWithDim<3>(PixelType); - // else if (Dimension==4)UpdateWithDim<4>(PixelType); - else - { - std::cout<<"Error, Only for 2 or 3 Dimensions!!!"< - * @date 29 june 2009 - * - * @brief - * - ===================================================*/ - - -// clitk include -#include "clitkIO.h" -#include "clitkCommon.h" -#include "clitkImageCommon.h" -#include "clitkBinarizeImage_ggo.h" - -//itk include -#include "itkLightObject.h" -#include "itkBinaryThresholdImageFilter.h" - -namespace clitk -{ - - - class ITK_EXPORT BinarizeImageGenericFilter : public itk::LightObject - { - public: - //---------------------------------------- - // ITK - //---------------------------------------- - typedef BinarizeImageGenericFilter Self; - typedef itk::LightObject Superclass; - typedef itk::SmartPointer Pointer; - typedef itk::SmartPointer ConstPointer; - - // Method for creation through the object factory - itkNewMacro(Self); - - // Run-time type information (and related methods) - itkTypeMacro( BinarizeImageGenericFilter, LightObject ); - - - //---------------------------------------- - // Typedefs - //---------------------------------------- - - - //---------------------------------------- - // Set & Get - //---------------------------------------- - void SetArgsInfo(const args_info_clitkBinarizeImage & a) - { - m_ArgsInfo=a; - m_Verbose=m_ArgsInfo.verbose_flag; - m_InputFileName=m_ArgsInfo.input_arg; - } - - //---------------------------------------- - // Update - //---------------------------------------- - void Update(); - - protected: - - //---------------------------------------- - // Constructor & Destructor - //---------------------------------------- - BinarizeImageGenericFilter(); - ~BinarizeImageGenericFilter() {}; - - - //---------------------------------------- - // Templated members - //---------------------------------------- - template void UpdateWithDim(std::string PixelType); - template void UpdateWithDimAndPixelType(); - - - //---------------------------------------- - // Data members - //---------------------------------------- - args_info_clitkBinarizeImage m_ArgsInfo; - bool m_Verbose; - std::string m_InputFileName; - - }; - - -} // end namespace clitk - -#ifndef ITK_MANUAL_INSTANTIATION -#include "clitkBinarizeImageGenericFilter.txx" -#endif - -#endif // #define clitkBinarizeImageGenericFilter_h diff --git a/segmentation/clitkBinarizeImageGenericFilter.txx b/segmentation/clitkBinarizeImageGenericFilter.txx deleted file mode 100755 index 92e8786..0000000 --- a/segmentation/clitkBinarizeImageGenericFilter.txx +++ /dev/null @@ -1,108 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ -#ifndef clitkBinarizeImageGenericFilter_txx -#define clitkBinarizeImageGenericFilter_txx - -/* ================================================= - * @file clitkBinarizeImageGenericFilter.txx - * @author Jef Vandemeulebroucke - * @date 29 june 2009 - * - * @brief - * - ===================================================*/ - - -namespace clitk -{ - - //------------------------------------------------------------------- - // Update with the number of dimensions - //------------------------------------------------------------------- - template - void - BinarizeImageGenericFilter::UpdateWithDim(std::string PixelType) - { - if (m_Verbose) std::cout << "Image was detected to be "<(); - } - // else if(PixelType == "unsigned_short"){ - // if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and unsigned_short..." << std::endl; - // UpdateWithDimAndPixelType(); - // } - - else if (PixelType == "unsigned_char"){ - if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and unsigned_char..." << std::endl; - UpdateWithDimAndPixelType(); - } - - // else if (PixelType == "char"){ - // if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and signed_char..." << std::endl; - // UpdateWithDimAndPixelType(); - // } - else { - if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and float..." << std::endl; - UpdateWithDimAndPixelType(); - } - } - - - //------------------------------------------------------------------- - // Update with the number of dimensions and the pixeltype - //------------------------------------------------------------------- - template - void - BinarizeImageGenericFilter::UpdateWithDimAndPixelType() - { - - // ImageTypes - typedef itk::Image InputImageType; - typedef itk::Image OutputImageType; - - // Read the input - typedef itk::ImageFileReader InputReaderType; - typename InputReaderType::Pointer reader = InputReaderType::New(); - reader->SetFileName( m_InputFileName); - typename InputImageType::Pointer input= reader->GetOutput(); - - // Filter - typedef itk::BinaryThresholdImageFilter BinaryThresholdImageFilterType; - typename BinaryThresholdImageFilterType::Pointer thresholdFilter=BinaryThresholdImageFilterType::New(); - thresholdFilter->SetInput(input); - if(m_ArgsInfo.lower_given) thresholdFilter->SetLowerThreshold(static_cast(m_ArgsInfo.lower_arg)); - if(m_ArgsInfo.upper_given) thresholdFilter->SetUpperThreshold(static_cast(m_ArgsInfo.upper_arg)); - thresholdFilter->SetInsideValue(m_ArgsInfo.inside_arg); - thresholdFilter->SetOutsideValue(m_ArgsInfo.outside_arg); - typename OutputImageType::Pointer output=thresholdFilter->GetOutput(); - - // Output - typedef itk::ImageFileWriter WriterType; - typename WriterType::Pointer writer = WriterType::New(); - writer->SetFileName(m_ArgsInfo.output_arg); - writer->SetInput(output); - writer->Update(); - - } - - -}//end clitk - -#endif //#define clitkBinarizeImageGenericFilter_txx -- 2.47.1