From 3d633569af18aa6c08dbbba748a833f8f029024d Mon Sep 17 00:00:00 2001 From: pierre33 Date: Fri, 24 Aug 2018 16:22:22 +0200 Subject: [PATCH] Update itkNaryFunctorImageFilter In the context of my work, I need a itk::NaryFunctorImageFilter because I can have a different number of input images depending on the context. Specifically, I can have 1 to 3 input images. I realized that the filter itk::NaryFunctorImageFilter has a required number of inputs equal to 2 and I do not understand why. Above all, when I check the method DynamicThreadedGenerateData I see the following check: numberOfValidInputImages == 0 and I am wondering why it is not numberOfValidInputImages < 1. Therefore I suggest the following change by setting the number of required inputs to 1. Kind regards, Pierre Lassalle --- .../ImageIntensity/include/itkNaryFunctorImageFilter.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Filtering/ImageIntensity/include/itkNaryFunctorImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkNaryFunctorImageFilter.hxx index e917de5107d..82b0faea7cb 100644 --- a/Modules/Filtering/ImageIntensity/include/itkNaryFunctorImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkNaryFunctorImageFilter.hxx @@ -30,7 +30,7 @@ NaryFunctorImageFilter< TInputImage, TOutputImage, TFunction > { // This number will be incremented each time an image // is added over the two minimum required - this->SetNumberOfRequiredInputs(2); + this->SetNumberOfRequiredInputs(1); this->InPlaceOff(); this->DynamicMultiThreadingOn(); }