SuperElastix / elastix

Official elastix repository
http://elastix.dev
Apache License 2.0
481 stars 116 forks source link

Reduce behavior differences between elastix library and executable #332

Open N-Dekker opened 4 years ago

N-Dekker commented 4 years ago

Marius (@mstaring) proposed that we should reduce the behavior differences between the elastix library and the elastix executable.

The elastix source tree currently checks "if it is the elastix library" on 22 places:

elastix\Components\Optimizers\AdaGrad\elxAdaGrad.hxx(841):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Components\Optimizers\AdaptiveStochasticGradientDescent\elxAdaptiveStochasticGradientDescent.hxx(910):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Components\Optimizers\AdaptiveStochasticLBFGS\elxAdaptiveStochasticLBFGS.hxx(1403):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Components\Optimizers\AdaptiveStochasticVarianceReducedGradient\elxAdaptiveStochasticVarianceReducedGradient.hxx(1192):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Components\Optimizers\PreconditionedStochasticGradientDescent\elxPreconditionedStochasticGradientDescent.hxx(847):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Core\ComponentBaseClasses\elxResamplerBase.hxx(217):  const auto isElastixLibrary = BaseComponent::IsElastixLibrary();
elastix\Core\ComponentBaseClasses\elxResamplerBase.hxx(331):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Core\ComponentBaseClasses\elxResamplerBase.hxx(473):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Core\ComponentBaseClasses\elxTransformBase.hxx(1449):  if (!BaseComponent::IsElastixLibrary())
elastix\Core\ComponentBaseClasses\elxTransformBase.hxx(1502):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Core\ComponentBaseClasses\elxTransformBase.hxx(1635):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Core\ComponentBaseClasses\elxTransformBase.hxx(1734):  const auto progressObserver = BaseComponent::IsElastixLibrary() ?
elastix\Core\Configuration\elxConfiguration.cxx(76):  if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixBase.cxx(239):  if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixBase.cxx(382):  if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixBase.cxx(426):  if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixMain.cxx(517):      if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixMain.cxx(598):      if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixTemplate.hxx(413):    if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixTemplate.hxx(487):  if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixTemplate.hxx(771):  if (BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxTransformixMain.cxx(102):  if (BaseComponent::IsElastixLibrary())
N-Dekker commented 1 year ago

Update: only 10 places left now:

elastix\Core\ComponentBaseClasses\elxResamplerBase.hxx(200):const auto isElastixLibrary = BaseComponent::IsElastixLibrary();
elastix\Core\Configuration\elxConfiguration.cxx(110):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixBase.cxx(183):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixBase.cxx(316):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixBase.cxx(352):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixMain.cxx(273):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixMain.cxx(347):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixTemplate.hxx(389):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixTemplate.hxx(470):if (!BaseComponent::IsElastixLibrary())
elastix\Core\Kernel\elxElastixTemplate.hxx(744):if (BaseComponent::IsElastixLibrary())