]> Creatis software - FrontAlgorithms.git/blobdiff - plugins/Plugins/ImageDijkstra.cxx
...
[FrontAlgorithms.git] / plugins / Plugins / ImageDijkstra.cxx
index c5d34a4290453646061f6e28687baeb92eeaf8ee..d00636ef252dce8a73704b493423d117a6dfc790 100644 (file)
@@ -71,9 +71,12 @@ _GD1( _TInputImage* image )
   // Configure filter
   auto filter = this->_CreateITK< _TFilter >( );
   filter->SetInput( image );
-  filter->SetNeighborhoodFunction( neig );
-  filter->SetCostFunction( cost );
-  filter->SetCostConversionFunction( conv );
+  if( neig != NULL )
+    filter->SetNeighborhoodFunction( neig );
+  if( cost != NULL )
+    filter->SetCostFunction( cost );
+  if( conv != NULL )
+    filter->SetCostConversionFunction( conv );
   filter->SetStopAtOneFront( this->m_Parameters.GetBool( "StopAtOneFront" ) );
 
   // Assign seeds