Skip to content

Commit 33c7d9e

Browse files
jhlegarretadzenanz
authored andcommitted
STYLE: Improve the ivar printing in PrintSelf method
Improve the ivar printing in `PrintSelf` method: - Use the `itkPrintSelfObjectMacro` macro to avoid boilerplate code when printing smart pointers/objects that can be null pointers. - Remove printing ivars of an ivar: printing the ivar will print it the values of its ivars.
1 parent 683097d commit 33c7d9e

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

Modules/Core/Common/include/itkImportImageFilter.hxx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,8 @@ ImportImageFilter<TPixel, VImageDimension>::PrintSelf(std::ostream & os, Indent
5252

5353
Superclass::PrintSelf(os, indent);
5454

55-
if (m_ImportImageContainer)
56-
{
57-
os << indent << "ImportImageContainer pointer: (" << m_ImportImageContainer << ")" << std::endl;
58-
}
59-
else
60-
{
61-
os << indent << "ImportImageContainer pointer: (None)" << std::endl;
62-
}
55+
itkPrintSelfObjectMacro(ImportImageContainer);
6356
os << indent << "Import buffer size: " << m_Size << std::endl;
64-
if (m_ImportImageContainer)
65-
{
66-
os << indent
67-
<< "ImageContainer manages memory: " << (m_ImportImageContainer->GetContainerManageMemory() ? "true" : "false")
68-
<< std::endl;
69-
}
70-
7157
os << indent << "Spacing: [";
7258
for (i = 0; i < static_cast<int>(VImageDimension) - 1; ++i)
7359
{

0 commit comments

Comments
 (0)