From: schaerer Date: Wed, 3 Feb 2010 12:30:08 +0000 (+0000) Subject: robustify split tools X-Git-Tag: v1.2.0~838 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=765812e759961864395b26386b7845b2ed818898;p=clitk.git robustify split tools --- diff --git a/filters/clitkSplitImageGenericFilter.cxx b/filters/clitkSplitImageGenericFilter.cxx index c74f0e4..9748058 100644 --- a/filters/clitkSplitImageGenericFilter.cxx +++ b/filters/clitkSplitImageGenericFilter.cxx @@ -36,6 +36,7 @@ clitk::SplitImageGenericFilter::SplitImageGenericFilter(): template void clitk::SplitImageGenericFilter::InitializeImageType() { ADD_IMAGE_TYPE(Dim, char); + ADD_IMAGE_TYPE(Dim, unsigned char); ADD_IMAGE_TYPE(Dim, short); ADD_IMAGE_TYPE(Dim, int); ADD_IMAGE_TYPE(Dim, float); diff --git a/tools/clitkSplitImage.cxx b/tools/clitkSplitImage.cxx index 8a935e0..0f9275c 100644 --- a/tools/clitkSplitImage.cxx +++ b/tools/clitkSplitImage.cxx @@ -31,6 +31,11 @@ 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