Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Core/Install/elxBaseComponent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

namespace
{
bool IsElastixLibrary(const bool initialValue = false)
bool IsElastixLibrary(const bool initialValue = true)
{
// By default, assume that this is not the elastix library.
// By default, assume that this is the elastix library (not the elastix executable).

// Note that the initialization of this static variable is thread-safe,
// as supported by C++11 "magic statics".
Expand Down Expand Up @@ -77,9 +77,9 @@ bool BaseComponent::IsElastixLibrary()
return ::IsElastixLibrary();
}

void BaseComponent::InitializeElastixLibrary()
void BaseComponent::InitializeElastixExecutable()
{
::IsElastixLibrary(true);
::IsElastixLibrary(false);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Core/Install/elxBaseComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class BaseComponent

static bool IsElastixLibrary();

static void InitializeElastixLibrary();
static void InitializeElastixExecutable();

/** Convenience function to convert seconds to day, hour, minute, second format. */
std::string ConvertSecondsToDHMS( const double totalSeconds, const unsigned int precision ) const;
Expand Down
2 changes: 2 additions & 0 deletions Core/Main/elastix.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
int
main( int argc, char ** argv )
{
elastix::BaseComponent::InitializeElastixExecutable();
assert( ! elastix::BaseComponent::IsElastixLibrary() );

/** Check if "--help" or "--version" was asked for. */
if( argc == 1 )
Expand Down
1 change: 0 additions & 1 deletion Core/Main/elastixlib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ namespace elastix

ELASTIX::ELASTIX()
{
BaseComponent::InitializeElastixLibrary();
assert(BaseComponent::IsElastixLibrary());
}

Expand Down
3 changes: 3 additions & 0 deletions Core/Main/transformix.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
int
main( int argc, char ** argv )
{
elastix::BaseComponent::InitializeElastixExecutable();
assert(!elastix::BaseComponent::IsElastixLibrary());

/** Check if "-help" or "--version" was asked for.*/
if( argc == 1 )
{
Expand Down