X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkSplitImage.cxx;h=260e220a2ec126564fa14ffe87832dac154c4d65;hb=ba7eb37f66c14a90fe67ac035ecf9d8bc70fef1a;hp=8a935e072f78a9c2278ac6260b15b60c5bf68282;hpb=931a42358442f4ee4f314613c991c838d4b4e3b7;p=clitk.git diff --git a/tools/clitkSplitImage.cxx b/tools/clitkSplitImage.cxx index 8a935e0..260e220 100644 --- a/tools/clitkSplitImage.cxx +++ b/tools/clitkSplitImage.cxx @@ -1,15 +1,20 @@ -/*------------------------------------------------------------------------= - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. - +/*========================================================================= + 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://www.centreleonberard.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 above copyright notices for more information. - - ------------------------------------------------------------------------=*/ + 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 +===========================================================================**/ /** ------------------------------------------------= * @file clitkSplitImage.cxx @@ -23,7 +28,8 @@ #include "clitkIO.h" //-------------------------------------------------------------------- -int main(int argc, char * argv[]) { +int main(int argc, char * argv[]) +{ // Init command line GGO(clitkSplitImage, args_info); @@ -31,8 +37,12 @@ int main(int argc, char * argv[]) { // Read image dimension itk::ImageIOBase::Pointer header = clitk::readImageHeader(args_info.input_arg); + if (header.IsNull()) { + std::cerr << "Unable to read image file " << args_info.input_arg << std::endl; + std::exit(1); + } unsigned int dim = header->GetNumberOfDimensions(); - + // Check parameters if (args_info.dimension_given >= dim) { std::cerr << "ERROR : image has " << dim << "dimensions, split dimension should be between 0 and " << dim-1 << "." << std::endl; @@ -43,9 +53,11 @@ int main(int argc, char * argv[]) { filter.SetInputFilename(args_info.input_arg); filter.SetOutputFilename(args_info.output_arg); filter.SetSplitDimension(args_info.dimension_arg); + filter.SetPng(args_info.png_flag); + filter.SetWindowLevel(args_info.window_arg, args_info.level_arg); filter.SetVerbose(args_info.verbose_flag); filter.Update(); - // this is the end my friend + // this is the end my friend return 0; } // end main