diff --git a/ConnectedComponentSegmentation/otbConnectedComponentSegmentation.cxx b/ConnectedComponentSegmentation/otbConnectedComponentSegmentation.cxx
index f4420cb1df3037a0a5d5c3d58dee80e710bb8aeb..d0fc1b46cbd56f7245625986bcb16318c6145383 100644
--- a/ConnectedComponentSegmentation/otbConnectedComponentSegmentation.cxx
+++ b/ConnectedComponentSegmentation/otbConnectedComponentSegmentation.cxx
@@ -128,10 +128,18 @@ int ConnectedComponentSegmentation::Execute(otb::ApplicationOptionsResult* parse
     vproj->SetInputOrigin(inputImage->GetOrigin());
     vproj->SetInputSpacing(inputImage->GetSpacing());
 
-    if( parseResult->IsOptionPresent("DEMDirectory") )
+    // Configure DEM directory
+    if(parseResult->IsOptionPresent("DEMDirectory"))
       {
       vproj->SetDEMDirectory(parseResult->GetParameterString("DEMDirectory"));
       }
+    else
+      {
+      if ( otb::ConfigurationFile::GetInstance()->IsValid() )
+        {
+        vproj->SetDEMDirectory(otb::ConfigurationFile::GetInstance()->GetDEMDirectory());
+        }
+      }
 
     vproj->Update();