X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=tools%2FclitkSetSpacingGenericFilter.txx;fp=tools%2FclitkSetSpacingGenericFilter.txx;h=0000000000000000000000000000000000000000;hb=c44f6f7ea754689035de9e8f781f71a8d933b44e;hp=a6682f4561055e7bc3452e47f095643f60a40ad9;hpb=3463800f2d4684479552e6fc32836eafafcf03b8;p=clitk.git diff --git a/tools/clitkSetSpacingGenericFilter.txx b/tools/clitkSetSpacingGenericFilter.txx deleted file mode 100644 index a6682f4..0000000 --- a/tools/clitkSetSpacingGenericFilter.txx +++ /dev/null @@ -1,136 +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://www.centreleonberard.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 clitkSetSpacingGenericFilter_txx -#define clitkSetSpacingGenericFilter_txx - -/* ================================================= - * @file clitkSetSpacingGenericFilter.txx - * @author - * @date - * - * @brief - * - ===================================================*/ - - -namespace clitk -{ - - //------------------------------------------------------------------- - // Update with the number of dimensions - //------------------------------------------------------------------- - template - void - SetSpacingGenericFilter::UpdateWithDim(std::string PixelType , unsigned int Components) - { - 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(); - } - } - - else if (Components==3) - { - if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and 3D float (DVF)" << std::endl; - UpdateWithDimAndPixelType >(); - } - - else std::cerr<<"Number of components is "< - void - SetSpacingGenericFilter::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); - reader->Update(); - typename InputImageType::Pointer input= reader->GetOutput(); - - // Filter - typename InputImageType::SpacingType spacing; - spacing.Fill(1.0); - - // Like? - if (m_ArgsInfo.like_given) - { - typedef itk::ImageFileReader InputReaderType; - typename InputReaderType::Pointer likeReader = InputReaderType::New(); - likeReader->SetFileName( m_ArgsInfo.like_arg); - likeReader->Update(); - typename InputImageType::Pointer like= likeReader->GetOutput(); - spacing=like->GetSpacing(); - } - else - { - if (m_ArgsInfo.spacing_given==Dimension) - for(unsigned int i=0; iSetSpacing(spacing); - - // Output - typedef itk::ImageFileWriter WriterType; - typename WriterType::Pointer writer = WriterType::New(); - writer->SetFileName(m_ArgsInfo.output_arg); - writer->SetInput(input); - writer->Update(); - - } - - -}//end clitk - -#endif //#define clitkSetSpacingGenericFilter_txx