X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkMergeSequenceGenericFilter.txx;h=7a57030dc9a1f2bd24a23fda079969a406a0776a;hb=5578995d9a82792833333eeb3dd5c8ecac967293;hp=563b18010a5abc62966679b52a1397cc320d3256;hpb=a26cd8a19e1b9ad8344ab501436045f171a73713;p=clitk.git diff --git a/tools/clitkMergeSequenceGenericFilter.txx b/tools/clitkMergeSequenceGenericFilter.txx old mode 100755 new mode 100644 index 563b180..7a57030 --- a/tools/clitkMergeSequenceGenericFilter.txx +++ b/tools/clitkMergeSequenceGenericFilter.txx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.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 @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #ifndef __clitkMergeSequenceGenericFilter_txx #define __clitkMergeSequenceGenericFilter_txx #include "clitkMergeSequenceGenericFilter.h" @@ -28,43 +28,33 @@ namespace clitk 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 >(); + if (Components==1) { + if(PixelType == "short") { + if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and signed short..." << std::endl; + UpdateWithDimAndPixelType(); + } 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(PixelType == "double"){ + if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and double..." << 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 MergeSequenceGenericFilter::UpdateWithDimAndPixelType() { @@ -72,14 +62,14 @@ namespace clitk //Define the input and output image type typedef itk::Image InputImageType; typedef itk::Image OutputImageType; - + //Read the input image series typedef itk::ImageSeriesReader ImageReaderType; typename ImageReaderType::Pointer reader= ImageReaderType::New(); reader->SetFileNames(m_InputNames); reader->Update(); typename OutputImageType::Pointer image =reader->GetOutput(); - + //Set the spacing typename OutputImageType::SpacingType spacing=image->GetSpacing(); spacing[Dimension]=m_Spacing;