]> Creatis software - clitk.git/commitdiff
Add option to variance with only one number
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 1 Aug 2017 13:34:10 +0000 (15:34 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 1 Aug 2017 13:34:10 +0000 (15:34 +0200)
tools/clitkBlurImageGenericFilter.txx

index 307ddb695f97916bc327a3f4cf8dbae2d5863925..ea3054ef4f79274388b9794b99e4330abd0d239d 100644 (file)
@@ -93,10 +93,14 @@ BlurImageGenericFilter<args_info_type>::UpdateWithInputImageType()
   //}
 
   if (mArgsInfo.variance_given && mArgsInfo.variance_given == dim) {
-  for (unsigned int i = 0; i < dim; i++) {
-    //std::cout<<"mArgsInfo.variance_arg[i]"<<mArgsInfo.variance_arg[i]<<std::endl;
-    varianceArray[i] = mArgsInfo.variance_arg[i];
-  }
+    for (unsigned int i = 0; i < dim; i++) {
+      //std::cout<<"mArgsInfo.variance_arg[i]"<<mArgsInfo.variance_arg[i]<<std::endl;
+      varianceArray[i] = mArgsInfo.variance_arg[i];
+    }
+  } else if (mArgsInfo.variance_given && mArgsInfo.variance_given == 1) {
+      for (unsigned int i = 0; i < dim; i++) {
+          varianceArray[i] = mArgsInfo.variance_arg[0];
+      }
   } else {
       for (unsigned int i = 0; i < dim; i++) {
           varianceArray[i] = 1.0;