X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkImageResample.cxx;fp=tools%2FclitkImageResample.cxx;h=0000000000000000000000000000000000000000;hb=ef771c0cf6eb99f7cf2c6658bd8028eae20481e3;hp=a8545007bb5a91b8a0612e7e05a741ebb94d575d;hpb=6764ab075c799e9cdbf63e246f734c9be391199e;p=clitk.git diff --git a/tools/clitkImageResample.cxx b/tools/clitkImageResample.cxx deleted file mode 100644 index a854500..0000000 --- a/tools/clitkImageResample.cxx +++ /dev/null @@ -1,159 +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 CLITKIMAGERESAMPLE_CXX -#define CLITKIMAGERESAMPLE_CXX -/** - ------------------------------------------------= - * @file clitkImageResample.cxx - * @author David Sarrut - * @date 23 Feb 2008 08:37:53 - ------------------------------------------------=*/ - -// clitk -#include "clitkImageResample_ggo.h" -#include "clitkIO.h" -#include "clitkImageResampleGenericFilter.h" - -//-------------------------------------------------------------------- -int main(int argc, char * argv[]) -{ - - // Init command line - GGO(clitkImageResample, args_info); - CLITK_INIT; - - // Read input image header to check image dimension - itk::ImageIOBase::Pointer header = clitk::readImageHeader(args_info.input_arg); - unsigned int dim = header->GetNumberOfDimensions(); - std::string pixelTypeName = header->GetComponentTypeAsString(header->GetComponentType()); - - // Print image info if verbose - if (args_info.verbose_flag) { - std::cout << "Input image <" << args_info.input_arg << "> is "; - clitk::printImageHeader(header, std::cout); - std::cout << std::endl; - } - - // Get input size/spacing - std::vector inputSize; - std::vector inputSpacing; - inputSize.resize(dim); - inputSpacing.resize(dim); - for(unsigned int i=0; iGetSpacing(i); - inputSize[i] = header->GetDimensions(i); - } - - // Get options - std::vector outputSize; - std::vector outputSpacing; - outputSize.resize(dim); - outputSpacing.resize(dim); - - // Check options - if (!args_info.size_given && !args_info.spacing_given) { - std::cerr << "Please indicate output size or spacing." << std::endl; - exit(0); - } - - // Check options - if (args_info.size_given && args_info.spacing_given) { - std::cerr << "Please indicate only output size or spacing, not both." << std::endl; - exit(0); - } - - // Size is given and not spacing - if (args_info.size_given && !args_info.spacing_given) { - if (args_info.size_given != dim) { - std::cerr << "Input image is " << dim << "D, please give " << dim << " size numbers." << std::endl; - exit(0); - } - for(unsigned int i=0; i sigma; - sigma.resize(args_info.gauss_given); - std::copy(args_info.gauss_arg, args_info.gauss_arg+args_info.gauss_given, sigma.begin()); - if (args_info.gauss_given) { - if (args_info.gauss_given != dim) { - if (args_info.gauss_given == 1) { - sigma.resize(dim); - for(unsigned int i=0; iSetInputFilename(args_info.input_arg); - filter->SetOutputSize(outputSize); - filter->SetOutputSpacing(outputSpacing); - filter->SetInterpolationName(args_info.interp_arg); - filter->SetBSplineOrder(args_info.order_arg); - filter->SetBLUTSampling(args_info.sampling_arg); - if (args_info.gauss_given) - filter->SetGaussianSigma(sigma); - filter->SetOutputFilename(args_info.output_arg); - - // Go ! - filter->Update(); - - // this is the end my friend - return 0; -}// end main -//-------------------------------------------------------------------- - -#endif /* end #define CLITKIMAGERESAMPLE_CXX */