1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef CLITKVFRESAMPLE_CXX
19 #define CLITKVFRESAMPLE_CXX
22 #include "clitkVFInterpolate_ggo.h"
24 #include "clitkVFInterpolateGenericFilter.h"
26 //--------------------------------------------------------------------
27 int main(int argc, char * argv[])
31 GGO(clitkVFInterpolate, args_info);
34 // Read input image header to check image dimension
35 itk::ImageIOBase::Pointer header = clitk::readImageHeader(args_info.input1_arg);
36 unsigned int dim = header->GetNumberOfDimensions();
37 std::string pixelTypeName = header->GetComponentTypeAsString(header->GetComponentType());
39 // Print image info if verbose
40 if (args_info.verbose_flag) {
41 std::cout << "Input image <" << args_info.input1_arg << "> is ";
42 clitk::printImageHeader(header, std::cout);
43 std::cout << std::endl;
46 // Get input size/spacing
47 std::vector<int> inputSize;
48 std::vector<double> inputSpacing;
49 inputSize.resize(dim);
50 inputSpacing.resize(dim);
51 for (unsigned int i=0; i<dim; i++) {
52 inputSpacing[i] = header->GetSpacing(i);
53 inputSize[i] = header->GetDimensions(i);
56 if (args_info.verbose_flag) {
57 std::cout << "Output image will be : " << std::endl;
61 clitk::VFInterpolateGenericFilter::Pointer filter = clitk::VFInterpolateGenericFilter::New();
62 filter->SetInputFilename(args_info.input1_arg);
63 filter->SetInputFilename2(args_info.input2_arg);
64 filter->SetInterpolationName(args_info.interp_arg);
65 filter->SetDistance(args_info.distance_arg);
66 // filter->SetBSplineOrder(args_info.order_arg);
67 // filter->SetBLUTSampling(args_info.sampling_arg);
68 filter->SetOutputFilename(args_info.output_arg);
73 // this is the end my friend
76 //--------------------------------------------------------------------
78 #endif /* end #define CLITKVFRESAMPLE_CXX */