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

BUG: ParameterObject::WriteParameterFiles should write all maps #967

Merged
merged 2 commits into from
Sep 28, 2023

Conversation

N-Dekker
Copy link
Member

With this commit ParameterObject::WriteParameterFiles writes each maps to a file, including the first one. Aims to address issue #904 "ParameterObject::WriteParameterFiles does not write the first map!"

A GoogleTest unit test is added, testing that each of the files specified by the parameterFileNameVector parameter is indeed written to disk.

// Check that each of the specified files is written to disk.
for (const auto & fileName : fileNames)
{
EXPECT_TRUE(itksys::SystemTools::FileExists(fileName.c_str(), true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did elastix switch to C++17 yet? If so, std::filesystem::exists could be used here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for asking! The elastix main branch has switched to C++17, but I'm still reluctant to use std::filesystem, because ITK does not yet use std::filesystem either. As we discussed at https://discourse.itk.org/t/shall-we-start-using-c-17-at-the-master-branch/5828, March 2023. (std::filesystem would require at least GCC version 8). Of course I'm glad to hear if it's OK by now for ITK to require at least GCC 8. 😃

Aims to fix macos-11/clang errors saying "error: use of undeclared identifier 'elx'".
With this commit `ParameterObject::WriteParameterFiles` writes _each_ maps to a file, including the first one. Aims to address issue #904 "ParameterObject::WriteParameterFiles does not write the first map!"

A GoogleTest unit test is added, testing that each of the files specified by the `parameterFileNameVector` parameter is indeed written to disk.
@N-Dekker N-Dekker force-pushed the ParameterObject-WriteParameterFiles-write-all-maps branch from 2ee1c33 to d315d64 Compare September 28, 2023 14:19
@N-Dekker N-Dekker merged commit a57470b into main Sep 28, 2023
@N-Dekker N-Dekker deleted the ParameterObject-WriteParameterFiles-write-all-maps branch September 28, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ParameterObject::WriteParameterFiles does not write the first map!
2 participants