diff --git a/Code/BasicFilters/otbMNFImageFilter.txx b/Code/BasicFilters/otbMNFImageFilter.txx
index 13a0b0cd49b69af9e84e0dcdcd92c894b38c298a..0151485c5a8609ef4889020fbf0a32c67a488bb8 100644
--- a/Code/BasicFilters/otbMNFImageFilter.txx
+++ b/Code/BasicFilters/otbMNFImageFilter.txx
@@ -121,7 +121,7 @@ void
 MNFImageFilter< TInputImage, TOutputImage, TNoiseImageFilter, TDirectionOfTransformation >
 ::GenerateData ()
 {
-  switch ( DirectionOfTransformation )
+  switch ( static_cast<int>(DirectionOfTransformation) )
   {
   case static_cast<int>(Transform::FORWARD):
     return ForwardGenerateData();