Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkSimpleFilterWatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions Modules/Core/Common/src/itkXMLFilterWatcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ XMLFilterWatcher::ShowProgress()
this->SetSteps(steps);
if (!this->GetQuiet())
{
std::cout << "<filter-progress>" << this->GetProcess()->GetProgress() << "</filter-progress>" << std::endl;
std::cout << std::flush;
std::cout << "<filter-progress>" << this->GetProcess()->GetProgress() << "</filter-progress>" << std::endl
<< std::flush;
}
}
}
Expand All @@ -43,14 +43,13 @@ XMLFilterWatcher::StartFilter()
this->GetTimeProbe().Start();
if (!this->GetQuiet())
{
std::cout << "<filter-start>" << std::endl;
std::cout << "<filter-name>" << (this->GetProcess() ? this->GetProcess()->GetNameOfClass() : "None")
std::cout << "<filter-start>" << std::endl
<< "<filter-name>" << (this->GetProcess() ? this->GetProcess()->GetNameOfClass() : "None")
<< "</filter-name>" << std::endl;
std::cout << "<filter-comment>"
<< " \"" << this->GetComment() << "\" "
<< "</filter-comment>" << std::endl;
std::cout << "</filter-start>" << std::endl;
std::cout << std::flush;
std::cout << "</filter-start>" << std::endl << std::flush;
}
}

Expand Down
3 changes: 1 addition & 2 deletions Modules/Core/GPUCommon/include/itkGPUReduction.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ GPUReduction<TElement>::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);
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/GPUCommon/src/itkOpenCLUtil.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
15 changes: 7 additions & 8 deletions Modules/Core/Mesh/include/itkVTKPolyDataWriter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ VTKPolyDataWriter<TInputMesh>::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

Expand Down Expand Up @@ -171,8 +171,7 @@ VTKPolyDataWriter<TInputMesh>::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)
Expand Down Expand Up @@ -219,8 +218,8 @@ VTKPolyDataWriter<TInputMesh>::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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ QuadEdgeMeshScalarDataVTKPolyDataWriter<TMesh>::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())
{
Expand Down Expand Up @@ -104,8 +103,7 @@ QuadEdgeMeshScalarDataVTKPolyDataWriter<TMesh>::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())
{
Expand Down
4 changes: 1 addition & 3 deletions Modules/Core/SpatialObjects/include/itkSpatialObject.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1305,9 +1305,7 @@ SpatialObject<TDimension>::GetClassNameAndDimension() const
{
std::ostringstream n;

n << GetNameOfClass();
n << "_";
n << TDimension;
n << GetNameOfClass() << "_" << TDimension;

return n.str();
}
Expand Down
12 changes: 6 additions & 6 deletions Modules/Core/SpatialObjects/include/itkSurfaceSpatialObject.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ SurfaceSpatialObject<TDimension, TSurfacePointType>::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;
}

Expand Down Expand Up @@ -250,9 +250,9 @@ SurfaceSpatialObject<TDimension, TSurfacePointType>::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;
}

Expand Down
12 changes: 6 additions & 6 deletions Modules/Core/SpatialObjects/include/itkTubeSpatialObject.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ TubeSpatialObject<TDimension, TTubePointType>::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;
}
}
Expand Down
6 changes: 2 additions & 4 deletions Modules/Core/Transform/include/itkTransform.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ Transform<TParametersValueType, VInputDimension, VOutputDimension>::GetTransform
{
std::ostringstream n;

n << GetNameOfClass();
n << "_";
n << this->GetTransformTypeAsString(static_cast<TParametersValueType *>(nullptr));
n << "_" << this->GetInputSpaceDimension() << "_" << this->GetOutputSpaceDimension();
n << GetNameOfClass() << "_" << this->GetTransformTypeAsString(static_cast<TParametersValueType *>(nullptr)) << "_"
<< this->GetInputSpaceDimension() << "_" << this->GetOutputSpaceDimension();
return n.str();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ GPUGradientNDAnisotropicDiffusionFunction<TImage>::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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ GPUCastImageFilter<TInputImage, TOutputImage>::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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ GPUMeanImageFilter<TInputImage, TOutputImage>::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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ GPUBinaryThresholdImageFilter<TInputImage, TOutputImage>::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.
Expand All @@ -59,17 +59,17 @@ GPUBinaryThresholdImageFilter<TInputImage, TOutputImage>::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
Expand Down
3 changes: 1 addition & 2 deletions Modules/IO/CSV/include/itkCSVNumericObjectFileWriter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ CSVNumericObjectFileWriter<TValue, VRows, VColumns>::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;
}
Expand Down
8 changes: 4 additions & 4 deletions Modules/IO/ImageBase/include/itkImageFileReader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ ImageFileReader<TOutputImage, ConvertPixelTraits>::GenerateOutputInformation()
auto * io = dynamic_cast<ImageIOBase *>(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;
}
}
Expand Down
17 changes: 8 additions & 9 deletions Modules/IO/ImageBase/include/itkImageFileWriter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ ImageFileWriter<TInputImage>::Write()
auto * io = dynamic_cast<ImageIOBase *>(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);
Expand Down Expand Up @@ -365,11 +365,10 @@ ImageFileWriter<TInputImage>::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;
Expand Down
4 changes: 2 additions & 2 deletions Modules/IO/JPEG2000/src/itkJPEG2000ImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
9 changes: 3 additions & 6 deletions Modules/IO/MeshBYU/src/itkBYUMeshIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/IO/MeshBase/include/itkMeshFileReader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ MeshFileReader<TOutputMesh, ConvertPointPixelTraits, ConvertCellPixelTraits>::Ge
auto * io = dynamic_cast<MeshIOBase *>(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);
Expand Down
8 changes: 4 additions & 4 deletions Modules/IO/MeshBase/include/itkMeshFileWriter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ MeshFileWriter<TInputMesh>::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"))
{
Expand All @@ -121,8 +121,8 @@ MeshFileWriter<TInputMesh>::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;
Expand Down
4 changes: 2 additions & 2 deletions Modules/IO/MeshOBJ/src/itkOBJMeshIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Loading