-
-
Notifications
You must be signed in to change notification settings - Fork 726
Overload the stream insertion operator for types that are missing it #513
Copy link
Copy link
Closed
Labels
Good first issueA good issue for community members new to contributingA good issue for community members new to contributingtype:EnhancementImprovement of existing methods or implementationImprovement of existing methods or implementationtype:InfrastructureInfrastructure/ecosystem related changes, such as CMake or buildbotsInfrastructure/ecosystem related changes, such as CMake or buildbots
Metadata
Metadata
Assignees
Labels
Good first issueA good issue for community members new to contributingA good issue for community members new to contributingtype:EnhancementImprovement of existing methods or implementationImprovement of existing methods or implementationtype:InfrastructureInfrastructure/ecosystem related changes, such as CMake or buildbotsInfrastructure/ecosystem related changes, such as CMake or buildbots
Description
Overload the stream insertion operator for types that are missing it.
Expected behavior
To be able to print any data structure with a single line, e.g.:
Actual behavior
Developer's are forced to iterate over such structures to get them printed (usually in the
PrintSelfmethod), e.g.:Additional information
Some fundamental ITK types (e.g.
IndexTypes,SizeType,SpacingType,OffsetType,DirectionType,OffsetTable,RegionType) either seem not to have such an overload or it is just because some filters (itkImageConstIteratorWithIndex.h,itkImageIORegion.h,itkNeighborhood.h,itkImportImageFilter.h,itkConstNeighborhoodIterator.h,itkImportImageFilter.hxx,itkDisplacementFieldJacobianDeterminantFilter.h,itkGaussianBlurImageFunction.h,itkEllipsoidInteriorExteriorSpatialFunction.h) that declare ivars of such types are not using the correct types, since it looks weird that such fundamental types do not have the stream insertion operator overload.Other more exotic type aliases (
GradientType,StrideTable,SeedsContainerType,WeightsType,ErrorArrayType,ExtentArrayType) would also deserve some investigation, as well as other aliases that are not consistent with the toolkit convention for the intended use (e.g.InputTypeinitkEllipsoidInteriorExteriorSpatialFunction.h).Finally, other data structures that are also missing such an overload are regular arrays, e.g.
in
itkBSplineControlPointImageFunction.horitkGaussianDerivativeImageFuncton.hor
in
itkScalableAffineTransform.h.std::listtypes (e.g.itkHoughTransform2DCirclesImageFilter.horitkHoughTransform2DLinesImageFilter.h).Or
vnl_matrixmatrix (e.g.itkBSplineScatteredDataPointSetToImageFilter.h).This is related to #512.