X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkMergeSequenceGenericFilter.txx;h=7a57030dc9a1f2bd24a23fda079969a406a0776a;hb=e6929caa9906837ade57b84706fe0a38529dc93a;hp=9eac7011ae2c944eb52940533085d509d810d9fa;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/tools/clitkMergeSequenceGenericFilter.txx b/tools/clitkMergeSequenceGenericFilter.txx old mode 100755 new mode 100644 index 9eac701..7a57030 --- a/tools/clitkMergeSequenceGenericFilter.txx +++ b/tools/clitkMergeSequenceGenericFilter.txx @@ -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;