1 /*------------------------------------------------------------------------=
3 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
4 l'Image). All rights reserved. See Doc/License.txt or
5 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
7 This software is distributed WITHOUT ANY WARRANTY; without even
8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9 PURPOSE. See the above copyright notices for more information.
11 ------------------------------------------------------------------------=*/
14 ------------------------------------------------=
15 * @file clitkSplitImage.cxx
16 * @author Joël Schaerer
18 ------------------------------------------------=*/
21 #include "clitkSplitImage_ggo.h"
22 #include "clitkSplitImageGenericFilter.h"
25 //--------------------------------------------------------------------
26 int main(int argc, char * argv[]) {
29 GGO(clitkSplitImage, args_info);
32 // Read image dimension
33 itk::ImageIOBase::Pointer header = clitk::readImageHeader(args_info.input_arg);
36 std::cerr << "Unable to read image file " << args_info.input_arg << std::endl;
39 unsigned int dim = header->GetNumberOfDimensions();
42 if (args_info.dimension_given >= dim) {
43 std::cerr << "ERROR : image has " << dim << "dimensions, split dimension should be between 0 and " << dim-1 << "." << std::endl;
47 clitk::SplitImageGenericFilter filter;
48 filter.SetInputFilename(args_info.input_arg);
49 filter.SetOutputFilename(args_info.output_arg);
50 filter.SetSplitDimension(args_info.dimension_arg);
51 filter.SetVerbose(args_info.verbose_flag);
54 // this is the end my friend