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://oncora1.lyon.fnclcc.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 ======================================================================-====*/
19 ------------------------------------------------=
20 * @file clitkSplitImage.cxx
21 * @author Joël Schaerer
23 ------------------------------------------------=*/
26 #include "clitkSplitImage_ggo.h"
27 #include "clitkSplitImageGenericFilter.h"
30 //--------------------------------------------------------------------
31 int main(int argc, char * argv[])
35 GGO(clitkSplitImage, args_info);
38 // Read image dimension
39 itk::ImageIOBase::Pointer header = clitk::readImageHeader(args_info.input_arg);
40 if (header.IsNull()) {
41 std::cerr << "Unable to read image file " << args_info.input_arg << std::endl;
44 unsigned int dim = header->GetNumberOfDimensions();
47 if (args_info.dimension_given >= dim) {
48 std::cerr << "ERROR : image has " << dim << "dimensions, split dimension should be between 0 and " << dim-1 << "." << std::endl;
52 clitk::SplitImageGenericFilter filter;
53 filter.SetInputFilename(args_info.input_arg);
54 filter.SetOutputFilename(args_info.output_arg);
55 filter.SetSplitDimension(args_info.dimension_arg);
56 filter.SetPng(args_info.png_flag);
57 filter.SetWindowLevel(args_info.window_arg, args_info.level_arg);
58 filter.SetVerbose(args_info.verbose_flag);
61 // this is the end my friend