From 67ca856a8ced8b0ba481b5d81e2afaf192e90609 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Mon, 19 Dec 2022 18:45:19 +0100 Subject: [PATCH] STYLE: Chain consecutive insertions (`<<`) to the same output stream Avoiding unnecessarily mentioning one and the same output stream repetitively, when multiple consecutive statements insert into that one output stream. Using Notepad++ v8.4.7 Regular Expressions, find `^([ ]+[^ ]+) << (.+);\r\n\1 << ` and replace with `$1 << $2 << `. --- .../Common/include/itkSimpleFilterWatcher.h | 2 +- .../Core/Common/src/itkXMLFilterWatcher.cxx | 11 +++--- .../GPUCommon/include/itkGPUReduction.hxx | 3 +- Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx | 4 +- .../Mesh/include/itkVTKPolyDataWriter.hxx | 15 ++++--- ...uadEdgeMeshScalarDataVTKPolyDataWriter.hxx | 6 +-- .../include/itkSpatialObject.hxx | 4 +- .../include/itkSurfaceSpatialObject.hxx | 12 +++--- .../include/itkTubeSpatialObject.hxx | 12 +++--- .../Core/Transform/include/itkTransform.hxx | 6 +-- ...GradientNDAnisotropicDiffusionFunction.hxx | 4 +- .../include/itkGPUCastImageFilter.hxx | 4 +- .../include/itkGPUMeanImageFilter.hxx | 4 +- .../itkGPUBinaryThresholdImageFilter.hxx | 16 ++++---- .../include/itkCSVNumericObjectFileWriter.hxx | 3 +- .../ImageBase/include/itkImageFileReader.hxx | 8 ++-- .../ImageBase/include/itkImageFileWriter.hxx | 17 ++++---- .../IO/JPEG2000/src/itkJPEG2000ImageIO.cxx | 4 +- Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx | 9 ++--- .../IO/MeshBase/include/itkMeshFileReader.hxx | 4 +- .../IO/MeshBase/include/itkMeshFileWriter.hxx | 8 ++-- Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx | 4 +- .../IO/MeshVTK/include/itkVTKPolyDataMeshIO.h | 39 +++++++------------ .../PhilipsREC/src/itkPhilipsRECImageIO.cxx | 11 +++--- .../src/itkTransformFileReader.cxx | 8 ++-- .../itkTransformFileWriterSpecializations.cxx | 8 ++-- .../TransformHDF5/src/itkHDF5TransformIO.cxx | 4 +- .../src/itkTxtTransformIO.cxx | 3 +- Modules/IO/VTK/src/itkVTKImageIO.cxx | 8 ++-- .../Nonunit/Review/src/itkVoxBoCUBImageIO.cxx | 3 +- .../FEM/include/itkFEMImageMetricLoad.hxx | 3 +- .../Optimizers/src/itkExhaustiveOptimizer.cxx | 8 ++-- .../itkOnePlusOneEvolutionaryOptimizer.cxx | 12 +++--- .../include/itkCommandIterationUpdatev4.h | 21 ++++------ .../include/itkExhaustiveOptimizerv4.hxx | 8 ++-- .../itkOnePlusOneEvolutionaryOptimizerv4.hxx | 12 +++--- .../include/itkCommandIterationUpdate.h | 23 +++++------ .../include/itkCommandVnlIterationUpdate.h | 17 ++++---- .../src/itkKLMSegmentationBorder.cxx | 3 +- .../src/itkKLMSegmentationRegion.cxx | 14 +++---- 40 files changed, 159 insertions(+), 206 deletions(-) diff --git a/Modules/Core/Common/include/itkSimpleFilterWatcher.h b/Modules/Core/Common/include/itkSimpleFilterWatcher.h index 91a803f7b3c..bf28d7e95d4 100644 --- a/Modules/Core/Common/include/itkSimpleFilterWatcher.h +++ b/Modules/Core/Common/include/itkSimpleFilterWatcher.h @@ -262,8 +262,8 @@ class ITKCommon_EXPORT SimpleFilterWatcher EndFilter() { m_TimeProbe.Stop(); - std::cout << std::endl << "Filter took " << m_TimeProbe.GetMean() << " seconds."; std::cout << std::endl + << "Filter took " << m_TimeProbe.GetMean() << " seconds." << std::endl << "-------- End " << (m_Process.GetPointer() ? m_Process->GetNameOfClass() : "None") << " \"" << m_Comment << "\" " << std::endl; if (!m_Quiet) diff --git a/Modules/Core/Common/src/itkXMLFilterWatcher.cxx b/Modules/Core/Common/src/itkXMLFilterWatcher.cxx index a43d42df6df..b0f6e2e18f5 100644 --- a/Modules/Core/Common/src/itkXMLFilterWatcher.cxx +++ b/Modules/Core/Common/src/itkXMLFilterWatcher.cxx @@ -29,8 +29,8 @@ XMLFilterWatcher::ShowProgress() this->SetSteps(steps); if (!this->GetQuiet()) { - std::cout << "" << this->GetProcess()->GetProgress() << "" << std::endl; - std::cout << std::flush; + std::cout << "" << this->GetProcess()->GetProgress() << "" << std::endl + << std::flush; } } } @@ -43,14 +43,13 @@ XMLFilterWatcher::StartFilter() this->GetTimeProbe().Start(); if (!this->GetQuiet()) { - std::cout << "" << std::endl; - std::cout << "" << (this->GetProcess() ? this->GetProcess()->GetNameOfClass() : "None") + std::cout << "" << std::endl + << "" << (this->GetProcess() ? this->GetProcess()->GetNameOfClass() : "None") << "" << std::endl; std::cout << "" << " \"" << this->GetComment() << "\" " << "" << std::endl; - std::cout << "" << std::endl; - std::cout << std::flush; + std::cout << "" << std::endl << std::flush; } } diff --git a/Modules/Core/GPUCommon/include/itkGPUReduction.hxx b/Modules/Core/GPUCommon/include/itkGPUReduction.hxx index b7f69cc0cd2..fb76828ba68 100644 --- a/Modules/Core/GPUCommon/include/itkGPUReduction.hxx +++ b/Modules/Core/GPUCommon/include/itkGPUReduction.hxx @@ -119,8 +119,7 @@ GPUReduction::GetReductionKernel(int whichKernel, int blockSize, int i std::ostringstream defines; - defines << "#define blockSize " << blockSize << std::endl; - defines << "#define nIsPow2 " << isPowOf2 << std::endl; + defines << "#define blockSize " << blockSize << std::endl << "#define nIsPow2 " << isPowOf2 << std::endl; defines << "#define T "; GetTypenameInString(typeid(TElement), defines); diff --git a/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx b/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx index b9f937bd506..1a37e5b2ead 100644 --- a/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx +++ b/Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx @@ -455,8 +455,8 @@ std::string Get64BitPragma() { std::ostringstream msg; - msg << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; - msg << "#pragma OPENCL EXTENSION cl_amd_fp64 : enable\n"; + msg << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" + << "#pragma OPENCL EXTENSION cl_amd_fp64 : enable\n"; return msg.str(); } diff --git a/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx b/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx index afa4f750851..3b1daaa9f69 100644 --- a/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx +++ b/Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx @@ -86,10 +86,10 @@ VTKPolyDataWriter::GenerateData() } outputFile.imbue(std::locale::classic()); - outputFile << "# vtk DataFile Version 2.0" << std::endl; - outputFile << "File written by itkVTKPolyDataWriter" << std::endl; - outputFile << "ASCII" << std::endl; - outputFile << "DATASET POLYDATA" << std::endl; + outputFile << "# vtk DataFile Version 2.0" << std::endl + << "File written by itkVTKPolyDataWriter" << std::endl + << "ASCII" << std::endl + << "DATASET POLYDATA" << std::endl; // POINTS go first @@ -171,8 +171,7 @@ VTKPolyDataWriter::GenerateData() // LINES if (numberOfEdges) { - outputFile << "LINES " << numberOfEdges << " " << 3 * numberOfEdges; - outputFile << std::endl; + outputFile << "LINES " << numberOfEdges << " " << 3 * numberOfEdges << std::endl; cellIterator = cells->Begin(); while (cellIterator != cellEnd) @@ -219,8 +218,8 @@ VTKPolyDataWriter::GenerateData() } ++cellIterator; } - outputFile << "POLYGONS " << numberOfPolygons << " "; - outputFile << totalNumberOfPointsInPolygons + numberOfPolygons; // FIXME: Is this right ? + outputFile << "POLYGONS " << numberOfPolygons << " " + << totalNumberOfPointsInPolygons + numberOfPolygons; // FIXME: Is this right ? outputFile << std::endl; cellIterator = cells->Begin(); diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshScalarDataVTKPolyDataWriter.hxx b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshScalarDataVTKPolyDataWriter.hxx index 5ea36283b16..9b7dff4ab69 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshScalarDataVTKPolyDataWriter.hxx +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshScalarDataVTKPolyDataWriter.hxx @@ -52,8 +52,7 @@ QuadEdgeMeshScalarDataVTKPolyDataWriter::WriteCellData() { std::ofstream outputFile(this->m_FileName.c_str(), std::ios_base::app); - outputFile << "CELL_DATA " << this->m_Input->GetNumberOfFaces() << std::endl; - outputFile << "SCALARS "; + outputFile << "CELL_DATA " << this->m_Input->GetNumberOfFaces() << std::endl << "SCALARS "; if (!m_CellDataName.empty()) { @@ -104,8 +103,7 @@ QuadEdgeMeshScalarDataVTKPolyDataWriter::WritePointData() { std::ofstream outputFile(this->m_FileName.c_str(), std::ios_base::app); - outputFile << "POINT_DATA " << this->m_Input->GetNumberOfPoints() << std::endl; - outputFile << "SCALARS "; + outputFile << "POINT_DATA " << this->m_Input->GetNumberOfPoints() << std::endl << "SCALARS "; if (!m_PointDataName.empty()) { diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx index f8679aa64c3..68c81ffa2ad 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx @@ -1305,9 +1305,7 @@ SpatialObject::GetClassNameAndDimension() const { std::ostringstream n; - n << GetNameOfClass(); - n << "_"; - n << TDimension; + n << GetNameOfClass() << "_" << TDimension; return n.str(); } diff --git a/Modules/Core/SpatialObjects/include/itkSurfaceSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkSurfaceSpatialObject.hxx index 1dac77da7e1..5d925289229 100644 --- a/Modules/Core/SpatialObjects/include/itkSurfaceSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkSurfaceSpatialObject.hxx @@ -196,9 +196,9 @@ SurfaceSpatialObject::ComputeNormals() if ((identifier[0] == identifier[1]) || (identifier[1] == identifier[2]) || (identifier[0] == identifier[2])) { - std::cout << "Cannot find 3 distinct points!" << std::endl; - std::cout << identifier[0] << " : " << identifier[1] << " : " << identifier[2] << std::endl; - std::cout << max[0] << " : " << max[1] << " : " << max[2] << std::endl; + std::cout << "Cannot find 3 distinct points!" << std::endl + << identifier[0] << " : " << identifier[1] << " : " << identifier[2] << std::endl + << max[0] << " : " << max[1] << " : " << max[2] << std::endl; return false; } @@ -250,9 +250,9 @@ SurfaceSpatialObject::ComputeNormals() if (Math::AlmostEquals(absvec, 0.0)) { - std::cout << "ComputeNormals Failed!" << std::endl; - std::cout << identifier[0] << " : " << identifier[1] << " : " << identifier[2] << std::endl; - std::cout << badId.size() << " : " << this->m_Points.size() - 1 << std::endl; + std::cout << "ComputeNormals Failed!" << std::endl + << identifier[0] << " : " << identifier[1] << " : " << identifier[2] << std::endl + << badId.size() << " : " << this->m_Points.size() - 1 << std::endl; return false; } diff --git a/Modules/Core/SpatialObjects/include/itkTubeSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkTubeSpatialObject.hxx index 8372768f706..190996e9b90 100644 --- a/Modules/Core/SpatialObjects/include/itkTubeSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkTubeSpatialObject.hxx @@ -383,12 +383,12 @@ TubeSpatialObject::ComputeTangentsAndNormals() // RemoveDuplicatePointsInObjectSpace was not called. if (Math::AlmostEquals(l, 0.0) || std::isnan(l)) { - std::cerr << "TubeSpatialObject::ComputeTangentAndNormals() : "; - std::cerr << "length between two consecutive points is 0"; - std::cerr << " (use RemoveDuplicatePointsInObjectSpace())" << std::endl; - std::cerr << " p1 = " << x1 << std::endl; - std::cerr << " p2 = " << x2 << std::endl; - std::cerr << " p3 = " << x3 << std::endl; + std::cerr << "TubeSpatialObject::ComputeTangentAndNormals() : " + << "length between two consecutive points is 0" + << " (use RemoveDuplicatePointsInObjectSpace())" << std::endl + << " p1 = " << x1 << std::endl + << " p2 = " << x2 << std::endl + << " p3 = " << x3 << std::endl; return false; } } diff --git a/Modules/Core/Transform/include/itkTransform.hxx b/Modules/Core/Transform/include/itkTransform.hxx index 77aadc732fb..3015bbbba99 100644 --- a/Modules/Core/Transform/include/itkTransform.hxx +++ b/Modules/Core/Transform/include/itkTransform.hxx @@ -38,10 +38,8 @@ Transform::GetTransform { std::ostringstream n; - n << GetNameOfClass(); - n << "_"; - n << this->GetTransformTypeAsString(static_cast(nullptr)); - n << "_" << this->GetInputSpaceDimension() << "_" << this->GetOutputSpaceDimension(); + n << GetNameOfClass() << "_" << this->GetTransformTypeAsString(static_cast(nullptr)) << "_" + << this->GetInputSpaceDimension() << "_" << this->GetOutputSpaceDimension(); return n.str(); } diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.hxx b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.hxx index c7810ad303a..27161a05cf6 100644 --- a/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.hxx +++ b/Modules/Filtering/GPUAnisotropicSmoothing/include/itkGPUGradientNDAnisotropicDiffusionFunction.hxx @@ -83,8 +83,8 @@ GPUGradientNDAnisotropicDiffusionFunction::GPUGradientNDAnisotropicDiffu itkExceptionMacro("GPUGradientNDAnisotropicDiffusionFunction supports 1/2/3D image."); } - defines << "#define DIM_" << TImage::ImageDimension << "\n"; - defines << "#define BLOCK_SIZE " << OpenCLGetLocalBlockSize(TImage::ImageDimension) << "\n"; + defines << "#define DIM_" << TImage::ImageDimension << "\n" + << "#define BLOCK_SIZE " << OpenCLGetLocalBlockSize(TImage::ImageDimension) << "\n"; std::string pixeltypename = GetTypename(typeid(typename TImage::PixelType)); defines << "#define PIXELTYPE " << pixeltypename << "\n"; diff --git a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.hxx b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.hxx index ada31418b7a..de14a35521b 100644 --- a/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.hxx +++ b/Modules/Filtering/GPUImageFilterBase/include/itkGPUCastImageFilter.hxx @@ -33,8 +33,8 @@ GPUCastImageFilter::GPUCastImageFilter() itkExceptionMacro("GPUCastImageFilter supports 1/2/3D image."); } - defines << "#define DIM_" << TInputImage::ImageDimension << "\n"; - defines << "#define INPIXELTYPE "; + defines << "#define DIM_" << TInputImage::ImageDimension << "\n" + << "#define INPIXELTYPE "; GetTypenameInString(typeid(typename TInputImage::PixelType), defines); defines << "#define OUTPIXELTYPE "; GetTypenameInString(typeid(typename TOutputImage::PixelType), defines); diff --git a/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.hxx b/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.hxx index 421afe71bfb..041c8f66c66 100644 --- a/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.hxx +++ b/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.hxx @@ -32,8 +32,8 @@ GPUMeanImageFilter::GPUMeanImageFilter() itkExceptionMacro("GPUMeanImageFilter supports 1/2/3D image."); } - defines << "#define DIM_" << TInputImage::ImageDimension << "\n"; - defines << "#define PIXELTYPE "; + defines << "#define DIM_" << TInputImage::ImageDimension << "\n" + << "#define PIXELTYPE "; GetTypenameInString(typeid(typename TInputImage::PixelType), defines); const char * GPUSource = GPUMeanImageFilter::GetOpenCLSource(); diff --git a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.hxx b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.hxx index df26772963a..33bc17f570c 100644 --- a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.hxx +++ b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.hxx @@ -49,8 +49,8 @@ GPUBinaryThresholdImageFilter::GPUBinaryThresholdImag bool isValid = GetValidTypename(typeid(typename TInputImage::PixelType), validTypes, validTypeName); if (isValid) { - defines << "#define InPixelType " << validTypeName << "\n"; - defines << "#define OutPixelType " << validTypeName << "\n"; + defines << "#define InPixelType " << validTypeName << "\n" + << "#define OutPixelType " << validTypeName << "\n"; #ifdef __APPLE__ // This is to work around a bug in the OpenCL compiler on Mac OS 10.6 and 10.7 with NVidia drivers // where the compiler was not handling unsigned char arguments correctly. @@ -59,17 +59,17 @@ GPUBinaryThresholdImageFilter::GPUBinaryThresholdImag // is a known workaround to this problem. if (validTypeName == "unsigned char") { - defines << "#define InArgType unsigned short\n"; - defines << "#define OutArgType unsigned short\n"; + defines << "#define InArgType unsigned short\n" + << "#define OutArgType unsigned short\n"; } else { - defines << "#define InArgType " << validTypeName << "\n"; - defines << "#define OutArgType " << validTypeName << "\n"; + defines << "#define InArgType " << validTypeName << "\n" + << "#define OutArgType " << validTypeName << "\n"; } #else - defines << "#define InArgType " << validTypeName << "\n"; - defines << "#define OutArgType " << validTypeName << "\n"; + defines << "#define InArgType " << validTypeName << "\n" + << "#define OutArgType " << validTypeName << "\n"; #endif } else diff --git a/Modules/IO/CSV/include/itkCSVNumericObjectFileWriter.hxx b/Modules/IO/CSV/include/itkCSVNumericObjectFileWriter.hxx index b69b648f66c..dd414aca70e 100644 --- a/Modules/IO/CSV/include/itkCSVNumericObjectFileWriter.hxx +++ b/Modules/IO/CSV/include/itkCSVNumericObjectFileWriter.hxx @@ -180,8 +180,7 @@ CSVNumericObjectFileWriter::Write() } catch (const itk::ExceptionObject & exp) { - std::cerr << "Exception caught! " << std::endl; - std::cerr << exp << std::endl; + std::cerr << "Exception caught! " << std::endl << exp << std::endl; outputStream.close(); throw; } diff --git a/Modules/IO/ImageBase/include/itkImageFileReader.hxx b/Modules/IO/ImageBase/include/itkImageFileReader.hxx index 79b01dc7aa8..cf3d3c199f2 100644 --- a/Modules/IO/ImageBase/include/itkImageFileReader.hxx +++ b/Modules/IO/ImageBase/include/itkImageFileReader.hxx @@ -119,13 +119,13 @@ ImageFileReader::GenerateOutputInformation() auto * io = dynamic_cast(allobject.GetPointer()); msg << " " << io->GetNameOfClass() << std::endl; } - msg << " You probably failed to set a file suffix, or" << std::endl; - msg << " set the suffix to an unsupported type." << std::endl; + msg << " You probably failed to set a file suffix, or" << std::endl + << " set the suffix to an unsupported type." << std::endl; } else { - msg << " There are no registered IO factories." << std::endl; - msg << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." + msg << " There are no registered IO factories." << std::endl + << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." << std::endl; } } diff --git a/Modules/IO/ImageBase/include/itkImageFileWriter.hxx b/Modules/IO/ImageBase/include/itkImageFileWriter.hxx index acd9253fc29..87911f77ef8 100644 --- a/Modules/IO/ImageBase/include/itkImageFileWriter.hxx +++ b/Modules/IO/ImageBase/include/itkImageFileWriter.hxx @@ -126,13 +126,13 @@ ImageFileWriter::Write() auto * io = dynamic_cast(allobject.GetPointer()); msg << " " << io->GetNameOfClass() << std::endl; } - msg << " You probably failed to set a file suffix, or" << std::endl; - msg << " set the suffix to an unsupported type." << std::endl; + msg << " You probably failed to set a file suffix, or" << std::endl + << " set the suffix to an unsupported type." << std::endl; } else { - msg << " There are no registered IO factories." << std::endl; - msg << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." << std::endl; + msg << " There are no registered IO factories." << std::endl + << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." << std::endl; } e.SetDescription(msg.str().c_str()); e.SetLocation(ITK_LOCATION); @@ -365,11 +365,10 @@ ImageFileWriter::GenerateData() { ImageFileWriterException e(__FILE__, __LINE__); std::ostringstream msg; - msg << "Did not get requested region!" << std::endl; - msg << "Requested:" << std::endl; - msg << ioRegion; - msg << "Actual:" << std::endl; - msg << bufferedRegion; + msg << "Did not get requested region!" << std::endl + << "Requested:" << std::endl + << ioRegion << "Actual:" << std::endl + << bufferedRegion; e.SetDescription(msg.str().c_str()); e.SetLocation(ITK_LOCATION); throw e; diff --git a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx index 699719bc90a..4475a396308 100644 --- a/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx +++ b/Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx @@ -780,8 +780,8 @@ JPEG2000ImageIO::Write(const void * buffer) { // TODO should this be and excpetion? can we continue loading // and expect good results - std::cerr << "Unrecognized progression order in option -P (POC n " << i + 1; - std::cerr << ") [LRCP, RLCP, RPCL, PCRL, CPRL] !!" << std::endl; + std::cerr << "Unrecognized progression order in option -P (POC n " << i + 1 + << ") [LRCP, RLCP, RPCL, PCRL, CPRL] !!" << std::endl; } } diff --git a/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx b/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx index f4f8e74ac8f..46e2e5a9b61 100644 --- a/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx +++ b/Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx @@ -298,12 +298,9 @@ BYUMeshIO::WriteMeshInformation() // Write BYU file header Indent indent(7); - outputFile << indent << 1; - outputFile << indent << this->m_NumberOfPoints; - outputFile << indent << this->m_NumberOfCells; - outputFile << indent << this->m_CellBufferSize - 2 * this->m_NumberOfCells << std::endl; - outputFile << indent << 1; - outputFile << indent << this->m_NumberOfCells << std::endl; + outputFile << indent << 1 << indent << this->m_NumberOfPoints << indent << this->m_NumberOfCells << indent + << this->m_CellBufferSize - 2 * this->m_NumberOfCells << std::endl + << indent << 1 << indent << this->m_NumberOfCells << std::endl; outputFile.close(); } diff --git a/Modules/IO/MeshBase/include/itkMeshFileReader.hxx b/Modules/IO/MeshBase/include/itkMeshFileReader.hxx index 5fc54284b19..d73a956381d 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileReader.hxx +++ b/Modules/IO/MeshBase/include/itkMeshFileReader.hxx @@ -463,8 +463,8 @@ MeshFileReader::Ge auto * io = dynamic_cast(allobject.GetPointer()); msg << " " << io->GetNameOfClass() << std::endl; } - msg << " You probably failed to set a file suffix, or" << std::endl; - msg << " set the suffix to an unsupported type." << std::endl; + msg << " You probably failed to set a file suffix, or" << std::endl + << " set the suffix to an unsupported type." << std::endl; } MeshFileReaderException e(__FILE__, __LINE__, msg.str().c_str(), ITK_LOCATION); diff --git a/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx b/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx index 21949d43f2c..108e599c0cd 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx +++ b/Modules/IO/MeshBase/include/itkMeshFileWriter.hxx @@ -111,8 +111,8 @@ MeshFileWriter::Write() { MeshFileWriterException e(__FILE__, __LINE__); std::ostringstream msg; - msg << " Could not create IO object for file " << m_FileName.c_str() << std::endl; - msg << " Tried to create one of the following:" << std::endl; + msg << " Could not create IO object for file " << m_FileName.c_str() << std::endl + << " Tried to create one of the following:" << std::endl; { for (auto & allobject : ObjectFactoryBase::CreateAllInstance("itkMeshIOBase")) { @@ -121,8 +121,8 @@ MeshFileWriter::Write() } } - msg << " You probably failed to set a file suffix, or" << std::endl; - msg << " set the suffix to an unsupported type." << std::endl; + msg << " You probably failed to set a file suffix, or" << std::endl + << " set the suffix to an unsupported type." << std::endl; e.SetDescription(msg.str().c_str()); e.SetLocation(ITK_LOCATION); throw e; diff --git a/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx b/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx index 1464cb52f5e..76956f25704 100644 --- a/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx +++ b/Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx @@ -363,8 +363,8 @@ OBJMeshIO::WriteMeshInformation() outputFile << "# OBJ file generated by ITK\n"; // Write the number of points and number of cells - outputFile << "# Number of points " << this->m_NumberOfPoints << "\n"; - outputFile << "# Number of cells " << this->m_NumberOfCells << "\n"; + outputFile << "# Number of points " << this->m_NumberOfPoints << "\n" + << "# Number of cells " << this->m_NumberOfCells << "\n"; outputFile.close(); } diff --git a/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h b/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h index 93c7cd3a53e..2579eafb3f4 100644 --- a/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h +++ b/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIO.h @@ -449,8 +449,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase WritePointsBufferAsBINARY(std::ofstream & outputFile, T * buffer, const StringType & pointComponentType) { /** 1. Write number of points */ - outputFile << "POINTS " << this->m_NumberOfPoints; - outputFile << pointComponentType << "\n"; + outputFile << "POINTS " << this->m_NumberOfPoints << pointComponentType << "\n"; itk::ByteSwapper::SwapWriteRangeFromSystemToBigEndian( buffer, this->m_NumberOfPoints * this->m_PointDimension, &outputFile); outputFile << "\n"; @@ -748,12 +747,10 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase // row 1 outputFile << ConvertNumberToString(*ptr++) << indent; e12 = *ptr++; - outputFile << ConvertNumberToString(e12) << indent; - outputFile << ConvertNumberToString(zero) << '\n'; + outputFile << ConvertNumberToString(e12) << indent << ConvertNumberToString(zero) << '\n'; // row 2 - outputFile << ConvertNumberToString(e12) << indent; - outputFile << ConvertNumberToString(*ptr++) << indent; - outputFile << ConvertNumberToString(zero) << '\n'; + outputFile << ConvertNumberToString(e12) << indent << ConvertNumberToString(*ptr++) << indent + << ConvertNumberToString(zero) << '\n'; // row 3 outputFile << ConvertNumberToString(zero) << indent << ConvertNumberToString(zero) << indent << ConvertNumberToString(zero) << "\n\n"; @@ -774,14 +771,12 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase e13 = *ptr++; outputFile << ConvertNumberToString(e13) << '\n'; // row 2 - outputFile << ConvertNumberToString(e12) << indent; - outputFile << ConvertNumberToString(*ptr++) << indent; + outputFile << ConvertNumberToString(e12) << indent << ConvertNumberToString(*ptr++) << indent; e23 = *ptr++; outputFile << ConvertNumberToString(e23) << '\n'; // row 3 - outputFile << ConvertNumberToString(e13) << indent; - outputFile << ConvertNumberToString(e23) << indent; - outputFile << ConvertNumberToString(*ptr++) << "\n\n"; + outputFile << ConvertNumberToString(e13) << indent << ConvertNumberToString(e23) << indent + << ConvertNumberToString(*ptr++) << "\n\n"; i += 6; } } @@ -801,8 +796,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase { outputFile << ConvertNumberToString(buffer[ii * this->m_NumberOfPointPixelComponents + jj]) << indent; } - outputFile << ConvertNumberToString(buffer[ii * this->m_NumberOfPointPixelComponents + jj]); - outputFile << '\n'; + outputFile << ConvertNumberToString(buffer[ii * this->m_NumberOfPointPixelComponents + jj]) << '\n'; } } @@ -944,12 +938,9 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase // row 1 outputFile << *ptr++ << indent; e12 = *ptr++; - outputFile << e12 << indent; - outputFile << zero << '\n'; + outputFile << e12 << indent << zero << '\n'; // row 2 - outputFile << e12 << indent; - outputFile << *ptr++ << indent; - outputFile << zero << '\n'; + outputFile << e12 << indent << *ptr++ << indent << zero << '\n'; // row 3 outputFile << zero << indent << zero << indent << zero << "\n\n"; i += 3; @@ -969,14 +960,11 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase e13 = *ptr++; outputFile << e13 << '\n'; // row 2 - outputFile << e12 << indent; - outputFile << *ptr++ << indent; + outputFile << e12 << indent << *ptr++ << indent; e23 = *ptr++; outputFile << e23 << '\n'; // row 3 - outputFile << e13 << indent; - outputFile << e23 << indent; - outputFile << *ptr++ << "\n\n"; + outputFile << e13 << indent << e23 << indent << *ptr++ << "\n\n"; i += 6; } } @@ -998,8 +986,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIO : public MeshIOBase { outputFile << buffer[ii * this->m_NumberOfCellPixelComponents + jj] << indent; } - outputFile << buffer[ii * this->m_NumberOfCellPixelComponents + jj]; - outputFile << '\n'; + outputFile << buffer[ii * this->m_NumberOfCellPixelComponents + jj] << '\n'; } } diff --git a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx index b365a740353..e3d29acb2e3 100644 --- a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx +++ b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx @@ -761,8 +761,7 @@ PhilipsRECImageIO::ReadImageInformation() } //#define DEBUG_ORIENTATION #ifdef DEBUG_ORIENTATION - std::cout << "Direction cosines = " << direction << std::endl; - std::cout << "Spacing = " << spacing << std::endl; + std::cout << "Direction cosines = " << direction << std::endl << "Spacing = " << spacing << std::endl; #endif // Create right/left rotation matrix (about x axis). AffineMatrix r1; @@ -788,10 +787,10 @@ PhilipsRECImageIO::ReadImageInformation() // Total rotation matrix. AffineMatrix rtotal = r1 * r2 * r3; #ifdef DEBUG_ORIENTATION - std::cout << "Right-Left rotation = " << r1 << std::endl; - std::cout << "Anterior-Posterior rotation = " << r2 << std::endl; - std::cout << "Foot-Head rotation = " << r3 << std::endl; - std::cout << "Total = " << rtotal << std::endl; + std::cout << "Right-Left rotation = " << r1 << std::endl + << "Anterior-Posterior rotation = " << r2 << std::endl + << "Foot-Head rotation = " << r3 << std::endl + << "Total = " << rtotal << std::endl; #endif // Find and set origin diff --git a/Modules/IO/TransformBase/src/itkTransformFileReader.cxx b/Modules/IO/TransformBase/src/itkTransformFileReader.cxx index 8ac26d02bdf..6decc7bb76a 100644 --- a/Modules/IO/TransformBase/src/itkTransformFileReader.cxx +++ b/Modules/IO/TransformBase/src/itkTransformFileReader.cxx @@ -115,13 +115,13 @@ TransformFileReaderTemplate::Update() const Object * obj = dynamic_cast(allobject.GetPointer()); msg << " " << obj->GetNameOfClass() << std::endl; } - msg << " You probably failed to set a file suffix, or" << std::endl; - msg << " set the suffix to an unsupported type." << std::endl; + msg << " You probably failed to set a file suffix, or" << std::endl + << " set the suffix to an unsupported type." << std::endl; } else { - msg << " There are no registered Transform IO factories." << std::endl; - msg << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." + msg << " There are no registered Transform IO factories." << std::endl + << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." << std::endl; } diff --git a/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx b/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx index 7e21604cea3..7d6f3490de9 100644 --- a/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx +++ b/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx @@ -146,13 +146,13 @@ TransformFileWriterTemplate::Update() const Object * obj = dynamic_cast(allobject.GetPointer()); msg << " " << obj->GetNameOfClass() << std::endl; } - msg << " You probably failed to set a file suffix, or" << std::endl; - msg << " set the suffix to an unsupported type." << std::endl; + msg << " You probably failed to set a file suffix, or" << std::endl + << " set the suffix to an unsupported type." << std::endl; } else { - msg << " There are no registered Transform IO factories." << std::endl; - msg << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." + msg << " There are no registered Transform IO factories." << std::endl + << " Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem." << std::endl; } diff --git a/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx b/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx index 3afeb22b29a..76df9f1c461 100644 --- a/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx +++ b/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx @@ -494,9 +494,7 @@ const std::string GetTransformName(int i) { std::stringstream s; - s << HDF5CommonPathNames::transformGroupName; - s << "/"; - s << i; + s << HDF5CommonPathNames::transformGroupName << "/" << i; return s.str(); } diff --git a/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx b/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx index 5eaf8b92db5..bff0247bcfc 100644 --- a/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx +++ b/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx @@ -280,8 +280,7 @@ TxtTransformIOTemplate::Write() for (typename ConstTransformListType::const_iterator it = transformList.begin(); it != end; ++it, ++count) { const std::string TransformTypeName = (*it)->GetTransformTypeAsString(); - out << "#Transform " << count << std::endl; - out << "Transform: " << (*it)->GetTransformTypeAsString() << std::endl; + out << "#Transform " << count << std::endl << "Transform: " << (*it)->GetTransformTypeAsString() << std::endl; // // Composite Transforms are not written out with parameters; // their parameters are the union of all their component diff --git a/Modules/IO/VTK/src/itkVTKImageIO.cxx b/Modules/IO/VTK/src/itkVTKImageIO.cxx index eb47e52091d..1d1e1e9e60b 100644 --- a/Modules/IO/VTK/src/itkVTKImageIO.cxx +++ b/Modules/IO/VTK/src/itkVTKImageIO.cxx @@ -646,8 +646,8 @@ VTKImageIO::WriteImageInformation(const void * itkNotUsed(buffer)) } // Write the VTK header information - file << "# vtk DataFile Version 3.0\n"; - file << "VTK File Generated by Insight Segmentation and Registration Toolkit (ITK)\n"; + file << "# vtk DataFile Version 3.0\n" + << "VTK File Generated by Insight Segmentation and Registration Toolkit (ITK)\n"; if (this->GetFileType() == IOFileEnum::ASCII) { @@ -665,8 +665,8 @@ VTKImageIO::WriteImageInformation(const void * itkNotUsed(buffer)) file.flush(); // Write characteristics of the data - file << "DATASET STRUCTURED_POINTS\n"; - file << "DIMENSIONS " << this->GetDimensions(0) << " " + file << "DATASET STRUCTURED_POINTS\n" + << "DIMENSIONS " << this->GetDimensions(0) << " " << ((this->GetNumberOfDimensions() > 1) ? this->GetDimensions(1) : 1) << " " << ((this->GetNumberOfDimensions() > 2) ? this->GetDimensions(2) : 1) << " " << "\n"; diff --git a/Modules/Nonunit/Review/src/itkVoxBoCUBImageIO.cxx b/Modules/Nonunit/Review/src/itkVoxBoCUBImageIO.cxx index 315af4bede5..3bf46863e57 100644 --- a/Modules/Nonunit/Review/src/itkVoxBoCUBImageIO.cxx +++ b/Modules/Nonunit/Review/src/itkVoxBoCUBImageIO.cxx @@ -643,8 +643,7 @@ VoxBoCUBImageIO::WriteImageInformation() std::ostringstream header; // Write the identifiers - header << m_VB_IDENTIFIER_SYSTEM << std::endl; - header << m_VB_IDENTIFIER_FILETYPE << std::endl; + header << m_VB_IDENTIFIER_SYSTEM << std::endl << m_VB_IDENTIFIER_FILETYPE << std::endl; // Write the data type switch (m_ComponentType) diff --git a/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx b/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx index 85c1ea39836..1cb2114714d 100644 --- a/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx +++ b/Modules/Numerics/FEM/include/itkFEMImageMetricLoad.hxx @@ -119,8 +119,7 @@ ImageMetricLoad::InitializeMetric() } catch (const ExceptionObject & e) { - std::cout << "Metric initialization failed" << std::endl; - std::cout << "Reason " << e.GetDescription() << std::endl; + std::cout << "Metric initialization failed" << std::endl << "Reason " << e.GetDescription() << std::endl; } } diff --git a/Modules/Numerics/Optimizers/src/itkExhaustiveOptimizer.cxx b/Modules/Numerics/Optimizers/src/itkExhaustiveOptimizer.cxx index 189a1eb21a4..51e806bcede 100644 --- a/Modules/Numerics/Optimizers/src/itkExhaustiveOptimizer.cxx +++ b/Modules/Numerics/Optimizers/src/itkExhaustiveOptimizer.cxx @@ -123,8 +123,8 @@ ExhaustiveOptimizer::ResumeWalking() } m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": Running. "; - m_StopConditionDescription << "@ index " << this->GetCurrentIndex() << " value is " << this->GetCurrentValue(); + m_StopConditionDescription << this->GetNameOfClass() << ": Running. " + << "@ index " << this->GetCurrentIndex() << " value is " << this->GetCurrentValue(); this->InvokeEvent(IterationEvent()); this->AdvanceOneStep(); @@ -181,8 +181,8 @@ ExhaustiveOptimizer::IncrementIndex(ParametersType & newPosition) { m_Stop = true; m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "Completed sampling of parametric space of size " << spaceDimension; + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "Completed sampling of parametric space of size " << spaceDimension; } const ScalesType & scales = this->GetScales(); diff --git a/Modules/Numerics/Optimizers/src/itkOnePlusOneEvolutionaryOptimizer.cxx b/Modules/Numerics/Optimizers/src/itkOnePlusOneEvolutionaryOptimizer.cxx index d82bfb810ff..867ca4b45ca 100644 --- a/Modules/Numerics/Optimizers/src/itkOnePlusOneEvolutionaryOptimizer.cxx +++ b/Modules/Numerics/Optimizers/src/itkOnePlusOneEvolutionaryOptimizer.cxx @@ -143,8 +143,8 @@ OnePlusOneEvolutionaryOptimizer::StartOptimization() if (m_Stop) { m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "StopOptimization() called"; + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "StopOptimization() called"; break; } @@ -242,8 +242,8 @@ OnePlusOneEvolutionaryOptimizer::StartOptimization() { itkDebugMacro(<< "converges at iteration = " << iter); m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "Fnorm (" << m_FrobeniusNorm << ") is less than Epsilon (" << m_Epsilon + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "Fnorm (" << m_FrobeniusNorm << ") is less than Epsilon (" << m_Epsilon << " at iteration #" << iter; this->InvokeEvent(EndEvent()); return; @@ -275,8 +275,8 @@ OnePlusOneEvolutionaryOptimizer::StartOptimization() itkDebugMacro(<< "Current position: " << this->GetCurrentPosition()); } m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "Maximum number of iterations (" << m_MaximumIteration << ") exceeded. "; + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "Maximum number of iterations (" << m_MaximumIteration << ") exceeded. "; this->InvokeEvent(EndEvent()); } diff --git a/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h b/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h index 849b8929f51..99130d6b099 100644 --- a/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h +++ b/Modules/Numerics/Optimizersv4/include/itkCommandIterationUpdatev4.h @@ -69,13 +69,11 @@ class CommandIterationUpdatev4 : public Command { if (typeid(event) == typeid(itk::StartEvent)) { - std::cout << std::endl << "Position Value"; - std::cout << std::endl << std::endl; + std::cout << std::endl << "Position Value" << std::endl << std::endl; } else if (typeid(event) == typeid(itk::IterationEvent)) { - std::cout << m_Optimizer->GetCurrentIteration() << " = "; - std::cout << m_Optimizer->GetValue(); + std::cout << m_Optimizer->GetCurrentIteration() << " = " << m_Optimizer->GetValue(); if (m_PrintParameters) { std::cout << " : " << m_Optimizer->GetCurrentPosition(); @@ -84,18 +82,15 @@ class CommandIterationUpdatev4 : public Command } else if (typeid(event) == typeid(itk::EndEvent)) { - std::cout << std::endl << std::endl; - std::cout << "After " << m_Optimizer->GetCurrentIteration(); - std::cout << " iterations " << std::endl; + std::cout << std::endl + << std::endl + << "After " << m_Optimizer->GetCurrentIteration() << " iterations " << std::endl; if (m_PrintParameters) { - std::cout << " Solution is = " << m_Optimizer->GetCurrentPosition(); - std::cout << std::endl; + std::cout << " Solution is = " << m_Optimizer->GetCurrentPosition() << std::endl; } - std::cout << "Solution value = " << m_Optimizer->GetValue(); - std::cout << std::endl; - std::cout << "Stop condition = " << m_Optimizer->GetStopConditionDescription(); - std::cout << std::endl; + std::cout << "Solution value = " << m_Optimizer->GetValue() << std::endl + << "Stop condition = " << m_Optimizer->GetStopConditionDescription() << std::endl; } } diff --git a/Modules/Numerics/Optimizersv4/include/itkExhaustiveOptimizerv4.hxx b/Modules/Numerics/Optimizersv4/include/itkExhaustiveOptimizerv4.hxx index 932036a6eec..36ef4990085 100644 --- a/Modules/Numerics/Optimizersv4/include/itkExhaustiveOptimizerv4.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkExhaustiveOptimizerv4.hxx @@ -129,8 +129,8 @@ ExhaustiveOptimizerv4::ResumeWalking() } m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": Running. "; - m_StopConditionDescription << "@ index " << this->GetCurrentIndex() << " value is " << m_CurrentValue; + m_StopConditionDescription << this->GetNameOfClass() << ": Running. " + << "@ index " << this->GetCurrentIndex() << " value is " << m_CurrentValue; this->InvokeEvent(IterationEvent()); this->AdvanceOneStep(); @@ -190,8 +190,8 @@ ExhaustiveOptimizerv4::IncrementIndex(ParametersT { m_Stop = true; m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "Completed sampling of parametric space of size " << spaceDimension; + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "Completed sampling of parametric space of size " << spaceDimension; } const ScalesType & scales = this->GetScales(); diff --git a/Modules/Numerics/Optimizersv4/include/itkOnePlusOneEvolutionaryOptimizerv4.hxx b/Modules/Numerics/Optimizersv4/include/itkOnePlusOneEvolutionaryOptimizerv4.hxx index c03a8017f03..d70c69f48ed 100644 --- a/Modules/Numerics/Optimizersv4/include/itkOnePlusOneEvolutionaryOptimizerv4.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkOnePlusOneEvolutionaryOptimizerv4.hxx @@ -151,8 +151,8 @@ OnePlusOneEvolutionaryOptimizerv4::StartOptimizat if (m_Stop) { m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "StopOptimization() called"; + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "StopOptimization() called"; break; } @@ -232,8 +232,8 @@ OnePlusOneEvolutionaryOptimizerv4::StartOptimizat { itkDebugMacro(<< "converges at iteration = " << this->m_CurrentIteration); m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "Fnorm (" << m_FrobeniusNorm << ") is less than Epsilon (" << m_Epsilon + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "Fnorm (" << m_FrobeniusNorm << ") is less than Epsilon (" << m_Epsilon << " at iteration #" << this->m_CurrentIteration; this->InvokeEvent(EndEvent()); return; @@ -267,8 +267,8 @@ OnePlusOneEvolutionaryOptimizerv4::StartOptimizat if (this->m_CurrentIteration >= m_MaximumIteration) { m_StopConditionDescription.str(""); - m_StopConditionDescription << this->GetNameOfClass() << ": "; - m_StopConditionDescription << "Maximum number of iterations (" << m_MaximumIteration << ") exceeded. "; + m_StopConditionDescription << this->GetNameOfClass() << ": " + << "Maximum number of iterations (" << m_MaximumIteration << ") exceeded. "; } this->InvokeEvent(EndEvent()); } diff --git a/Modules/Registration/Common/include/itkCommandIterationUpdate.h b/Modules/Registration/Common/include/itkCommandIterationUpdate.h index 621a1c2ce31..92214433def 100644 --- a/Modules/Registration/Common/include/itkCommandIterationUpdate.h +++ b/Modules/Registration/Common/include/itkCommandIterationUpdate.h @@ -69,26 +69,21 @@ class CommandIterationUpdate : public Command { if (typeid(event) == typeid(itk::StartEvent)) { - std::cout << std::endl << "Position Value"; - std::cout << std::endl << std::endl; + std::cout << std::endl << "Position Value" << std::endl << std::endl; } else if (typeid(event) == typeid(itk::IterationEvent)) { - std::cout << m_Optimizer->GetCurrentIteration() << " = "; - std::cout << m_Optimizer->GetValue() << " : "; - std::cout << m_Optimizer->GetCurrentPosition() << std::endl; + std::cout << m_Optimizer->GetCurrentIteration() << " = " << m_Optimizer->GetValue() << " : " + << m_Optimizer->GetCurrentPosition() << std::endl; } else if (typeid(event) == typeid(itk::EndEvent)) { - std::cout << std::endl << std::endl; - std::cout << "After " << m_Optimizer->GetCurrentIteration(); - std::cout << " iterations " << std::endl; - std::cout << "Solution is = " << m_Optimizer->GetCurrentPosition(); - std::cout << std::endl; - std::cout << "With value = " << m_Optimizer->GetValue(); - std::cout << std::endl; - std::cout << "Stop condition = " << m_Optimizer->GetStopCondition(); - std::cout << std::endl; + std::cout << std::endl + << std::endl + << "After " << m_Optimizer->GetCurrentIteration() << " iterations " << std::endl + << "Solution is = " << m_Optimizer->GetCurrentPosition() << std::endl + << "With value = " << m_Optimizer->GetValue() << std::endl + << "Stop condition = " << m_Optimizer->GetStopCondition() << std::endl; } } diff --git a/Modules/Registration/Common/include/itkCommandVnlIterationUpdate.h b/Modules/Registration/Common/include/itkCommandVnlIterationUpdate.h index d22a0db273d..22826333a90 100644 --- a/Modules/Registration/Common/include/itkCommandVnlIterationUpdate.h +++ b/Modules/Registration/Common/include/itkCommandVnlIterationUpdate.h @@ -69,22 +69,19 @@ class CommandVnlIterationUpdate : public Command { if (typeid(event) == typeid(itk::StartEvent)) { - std::cout << std::endl << "Position Value"; - std::cout << std::endl << std::endl; + std::cout << std::endl << "Position Value" << std::endl << std::endl; } else if (itk::IterationEvent().CheckEvent(&event)) { - std::cout << m_Optimizer->GetCurrentIteration() << " = "; - std::cout << m_Optimizer->GetCurrentPosition() << std::endl; + std::cout << m_Optimizer->GetCurrentIteration() << " = " << m_Optimizer->GetCurrentPosition() << std::endl; } else if (typeid(event) == typeid(itk::EndEvent)) { - std::cout << std::endl << std::endl; - std::cout << "After " << m_Optimizer->GetCurrentIteration(); - std::cout << " iterations " << std::endl; - std::cout << "Solution is = " << m_Optimizer->GetCurrentPosition(); - std::cout << std::endl; - std::cout << "vnl report = " << std::endl; + std::cout << std::endl + << std::endl + << "After " << m_Optimizer->GetCurrentIteration() << " iterations " << std::endl + << "Solution is = " << m_Optimizer->GetCurrentPosition() << std::endl + << "vnl report = " << std::endl; m_Optimizer->GetOptimizer()->diagnose_outcome(std::cout); } } diff --git a/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationBorder.cxx b/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationBorder.cxx index d39d9261af2..1cac79e46da 100644 --- a/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationBorder.cxx +++ b/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationBorder.cxx @@ -84,7 +84,6 @@ KLMSegmentationBorder::PrintBorderInfo() itkDebugMacro(<< "------------------------------"); itkDebugMacro(<< "------------------------------"); - std::cout << "Location : " << this << std::endl; - std::cout << "Lambda : " << m_Lambda << std::endl; + std::cout << "Location : " << this << std::endl << "Lambda : " << m_Lambda << std::endl; } } // namespace itk diff --git a/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx b/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx index 3a0ececbad9..77180fd6e57 100644 --- a/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx +++ b/Modules/Segmentation/KLMRegionGrowing/src/itkKLMSegmentationRegion.cxx @@ -461,13 +461,13 @@ KLMSegmentationRegion::PrintRegionInfo() // If there are border pointers print the results RegionBorderVectorIterator tempVectorIt; - std::cout << "------------------------------" << std::endl; - std::cout << "Location : " << this << std::endl; - std::cout << "Label : " << (this->GetRegionLabel()) << std::endl; - std::cout << "Area : " << (this->GetRegionArea()) << std::endl; - std::cout << "Mean : " << (this->GetMeanRegionIntensity()) << std::endl; - std::cout << "Num Borders: " << static_cast(m_RegionBorderVector.size()) << std::endl; - std::cout << "++++++++++++++++++++++++++++++" << std::endl; + std::cout << "------------------------------" << std::endl + << "Location : " << this << std::endl + << "Label : " << (this->GetRegionLabel()) << std::endl + << "Area : " << (this->GetRegionArea()) << std::endl + << "Mean : " << (this->GetMeanRegionIntensity()) << std::endl + << "Num Borders: " << static_cast(m_RegionBorderVector.size()) << std::endl + << "++++++++++++++++++++++++++++++" << std::endl; // If there are border pointers print the results tempVectorIt = m_RegionBorderVector.begin();