Skip to content

Commit

Permalink
STYLE: Declare WriteResultMesh filename parameter std::string
Browse files Browse the repository at this point in the history
Avoided using a raw, unmanaged char pointer, and avoided the need to write null-handling code.
  • Loading branch information
N-Dekker committed Jun 12, 2023
1 parent f546201 commit 007dadd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ITK_TEMPLATE_EXPORT MissingStructurePenalty
ReadMesh(const std::string & meshFileName, typename FixedMeshType::Pointer & mesh);

void
WriteResultMesh(const char * filename, MeshIdType meshId);
WriteResultMesh(const std::string & filename, MeshIdType meshId);

unsigned int
ReadTransformixPoints(const std::string & filename, typename MeshType::Pointer & mesh);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ MissingStructurePenalty<TElastix>::AfterEachIteration()

try
{
this->WriteResultMesh(makeFileName.str().c_str(), meshId);
this->WriteResultMesh(makeFileName.str(), meshId);
}
catch (const itk::ExceptionObject & excp)
{
Expand Down Expand Up @@ -261,7 +261,7 @@ MissingStructurePenalty<TElastix>::AfterEachResolution()

try
{
this->WriteResultMesh(makeFileName.str().c_str(), meshId);
this->WriteResultMesh(makeFileName.str(), meshId);
}
catch (const itk::ExceptionObject & excp)
{
Expand Down Expand Up @@ -309,7 +309,7 @@ MissingStructurePenalty<TElastix>::ReadMesh(const std::string & meshFileName, ty

template <class TElastix>
void
MissingStructurePenalty<TElastix>::WriteResultMesh(const char * filename, MeshIdType meshId)
MissingStructurePenalty<TElastix>::WriteResultMesh(const std::string & filename, MeshIdType meshId)
{
/** Setup the pipeline. */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ITK_TEMPLATE_EXPORT PolydataDummyPenalty
ReadMesh(const std::string & meshFileName, typename FixedMeshType::Pointer & mesh);

void
WriteResultMesh(const char * filename, MeshIdType meshId);
WriteResultMesh(const std::string & filename, MeshIdType meshId);

unsigned int
ReadTransformixPoints(const std::string & filename, typename MeshType::Pointer & mesh);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ PolydataDummyPenalty<TElastix>::AfterEachIteration()

try
{
this->WriteResultMesh(makeFileName.str().c_str(), meshId);
this->WriteResultMesh(makeFileName.str(), meshId);
}
catch (const itk::ExceptionObject & excp)
{
Expand Down Expand Up @@ -250,7 +250,7 @@ PolydataDummyPenalty<TElastix>::AfterEachResolution()

try
{
this->WriteResultMesh(makeFileName.str().c_str(), meshId);
this->WriteResultMesh(makeFileName.str(), meshId);
}
catch (const itk::ExceptionObject & excp)
{
Expand Down Expand Up @@ -300,7 +300,7 @@ PolydataDummyPenalty<TElastix>::ReadMesh(const std::string & meshFileName, typen

template <class TElastix>
void
PolydataDummyPenalty<TElastix>::WriteResultMesh(const char * filename, MeshIdType meshId)
PolydataDummyPenalty<TElastix>::WriteResultMesh(const std::string & filename, MeshIdType meshId)
{
/** Set the points of the latest transformation. */
const MappedMeshContainerPointer mappedMeshContainer = this->GetModifiableMappedMeshContainer();
Expand Down

0 comments on commit 007dadd

Please sign in to comment.