File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,11 +118,7 @@ class SITKIO_EXPORT ImportImageFilter : public ImageReaderBase
118118 // components per pixel needs to be set, otherwise the method
119119 // does not exist. This is done with the enable if idiom.
120120 template <class TImageType >
121- typename std::enable_if<!IsVector<TImageType>::Value>::type
122- SetNumberOfComponentsOnImage (TImageType *)
123- {}
124- template <class TImageType >
125- typename std::enable_if<IsVector<TImageType>::Value>::type
121+ void
126122 SetNumberOfComponentsOnImage (TImageType *);
127123
128124private:
Original file line number Diff line number Diff line change @@ -536,22 +536,15 @@ ImportImageFilter::ExecuteInternal()
536536 TheContainerWillTakeCareOfDeletingTheMemoryBuffer);
537537
538538
539- //
540- // Meta-programmed method to set the number of components if a
541- // vector image
542- //
543- this -> SetNumberOfComponentsOnImage (image. GetPointer ());
539+ // set the number of components if a vector image
540+ if constexpr (IsVector<ImageType>::Value)
541+ {
542+ image-> SetNumberOfComponentsPerPixel (m_NumberOfComponentsPerPixel);
543+ }
544544
545545 // This line must be the last line in the function to prevent a deep
546546 // copy caused by a implicit sitk::MakeUnique
547547 return Image (image);
548548}
549549
550- template <class TFilterType >
551- typename std::enable_if<IsVector<TFilterType>::Value>::type
552- ImportImageFilter::SetNumberOfComponentsOnImage (TFilterType * image)
553- {
554- image->SetNumberOfComponentsPerPixel (m_NumberOfComponentsPerPixel);
555- }
556-
557550} // namespace itk::simple
You can’t perform that action at this time.
0 commit comments