]> Creatis software - clitk.git/commitdiff
robustify split tools
authorschaerer <schaerer>
Wed, 3 Feb 2010 12:30:08 +0000 (12:30 +0000)
committerschaerer <schaerer>
Wed, 3 Feb 2010 12:30:08 +0000 (12:30 +0000)
filters/clitkSplitImageGenericFilter.cxx
tools/clitkSplitImage.cxx

index c74f0e4cb45317dcff98e29d01d98c80d6ebfd7e..97480583d0b10283c98208481c4cf1a2024fe3fe 100644 (file)
@@ -36,6 +36,7 @@ clitk::SplitImageGenericFilter::SplitImageGenericFilter():
 template<unsigned int Dim>
 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);
index 8a935e072f78a9c2278ac6260b15b60c5bf68282..0f9275cdd6390e0aee7169c8b21c43951e979661 100644 (file)
@@ -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