Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print the parameter map to log, when there is no parameter file #1287

Merged
merged 2 commits into from
Feb 3, 2025
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
7 changes: 7 additions & 0 deletions Common/ParameterFileParser/itkParameterMapInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ class ParameterMapInterface : public Object
void
SetParameterMap(const ParameterMapType & parMap);

/** Returns the parameter map. */
const ParameterMapType &
GetParameterMap() const
{
return m_ParameterMap;
}

/** Option to print error and warning messages to a stream.
* The default is true. If set to false no messages are printed.
*/
Expand Down
20 changes: 19 additions & 1 deletion Core/Configuration/elxConfiguration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,32 @@ Configuration::PrintParameterFile() const
} // end PrintParameterFile()


/**
* ******************** PrintParameterMap ***************************
*/

void
Configuration::PrintParameterMap() const
{
// Separate clearly in log-file, before and after writing the parameter map.
log::info_to_log_file(std::ostringstream{}
<< "\n=============== start of ParameterMap ===============\n"
<< Conversion::ParameterMapToString(m_ParameterMapInterface->GetParameterMap())
<< "\n=============== end of ParameterMap ===============\n");

} // end PrintParameterMap()
/**
* ************************ BeforeAll ***************************
*/

int
Configuration::BeforeAll()
{
if (!BaseComponent::IsElastixLibrary())
if (m_ParameterFileName.empty())
{
this->PrintParameterMap();
}
else
{
this->PrintParameterFile();
}
Expand Down
4 changes: 4 additions & 0 deletions Core/Configuration/elxConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ class Configuration
void
PrintParameterFile() const;

/** Print the parameter map to the log file. */
void
PrintParameterMap() const;

private:
CommandLineArgumentMapType m_CommandLineArgumentMap{};
std::string m_ParameterFileName{};
Expand Down