Skip to content

Commit

Permalink
ENH: Make Forbild phantom file reader locale insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed Mar 15, 2022
1 parent e6c48eb commit 942fa6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rtkForbildPhantomFileReader.cxx
Expand Up @@ -31,6 +31,9 @@ namespace rtk
void
ForbildPhantomFileReader::GenerateOutputInformation()
{
// Save locale setting
const std::string oldLocale = std::setlocale(LC_NUMERIC, nullptr);
setlocale(LC_NUMERIC, "C");
m_GeometricPhantom = GeometricPhantom::New();

std::ifstream myFile;
Expand Down Expand Up @@ -104,6 +107,7 @@ ForbildPhantomFileReader::GenerateOutputInformation()
for (const auto & m_Union : m_Unions)
m_GeometricPhantom->AddConvexShape(m_Union);
myFile.close();
std::setlocale(LC_NUMERIC, oldLocale.c_str());
}

void
Expand Down

0 comments on commit 942fa6f

Please sign in to comment.