Skip to content

Commit

Permalink
ENH: ONLY test
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmjohnson committed Nov 27, 2024
1 parent 2194ac2 commit 6ed41a2
Show file tree
Hide file tree
Showing 151 changed files with 772 additions and 304 deletions.
3 changes: 2 additions & 1 deletion Modules/Core/Common/include/itkTetrahedronCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ TetrahedronCell<TCellInterface>::EvaluatePosition(CoordRepType * x,
else
{ // could easily be sped up using parametric localization - next release
double dist2;
CoordRepType closest[PointDimension], pc[3];
CoordRepType closest[PointDimension];
CoordRepType pc[3];

if (closestPoint)
{
Expand Down
5 changes: 4 additions & 1 deletion Modules/Core/Common/src/itkSmapsFileParser.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ ITKCommon_EXPORT std::istream &

// Get name
std::istringstream stream(headerline);
std::string address, perms, offset, device;
std::string address;
std::string perms;
std::string offset;
std::string device;
int inode = -1;
// the header is defined with the following expression: "address permissions
// offset device inode [name]"
Expand Down
4 changes: 3 additions & 1 deletion Modules/Core/Common/test/itkModifiedTimeTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ itkModifiedTimeTest(int, char *[])
using PointsContainer = itk::VectorContainer<Point>;
using BoundingBox = itk::BoundingBox<unsigned long, 3, double, PointsContainer>;

Point p, q, r;
Point p;
Point q;
Point r;

p.Fill(0);
q.Fill(0);
Expand Down
4 changes: 3 additions & 1 deletion Modules/Core/Common/test/itkNeighborhoodIteratorTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ itkNeighborhoodIteratorTest(int, char *[])
it3.SetLocation(loc);

it3.Print(std::cout);
unsigned int x, y, i;
unsigned int x;
unsigned int y;
unsigned int i;
for (y = 0, i = 0; y < 5; ++y)
{
for (x = 0; x < 5; ++x, ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ TestPrintNeighborhood(IteratorType & p, VectorIteratorType & v)

std::cout << "Output from operator()(const OffsetType &, const OffsetType &, const NeighborhoodType *) const"
<< std::endl;
unsigned int x, y, i = 0;
unsigned int x;
unsigned int y;
unsigned int i = 0;
for (y = 0; y < p.GetSize()[1]; ++y)
{
for (x = 0; x < p.GetSize()[0]; ++x, ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
FiniteDifferenceSparseImageFilter<TInputImageType, TSparseOutputImageType>::ApplyUpdateThreaderCallback(void * arg)
{
FDThreadStruct * str;
ThreadIdType total, workUnitID, workUnitCount;
ThreadIdType total;
ThreadIdType workUnitID;
ThreadIdType workUnitCount;

workUnitID = ((MultiThreaderBase::WorkUnitInfo *)(arg))->WorkUnitID;
workUnitCount = ((MultiThreaderBase::WorkUnitInfo *)(arg))->NumberOfWorkUnits;
Expand Down Expand Up @@ -182,7 +184,9 @@ ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
FiniteDifferenceSparseImageFilter<TInputImageType, TSparseOutputImageType>::CalculateChangeThreaderCallback(void * arg)
{
FDThreadStruct * str;
ThreadIdType total, workUnitID, workUnitCount;
ThreadIdType total;
ThreadIdType workUnitID;
ThreadIdType workUnitCount;

workUnitID = ((MultiThreaderBase::WorkUnitInfo *)(arg))->WorkUnitID;
workUnitCount = ((MultiThreaderBase::WorkUnitInfo *)(arg))->NumberOfWorkUnits;
Expand Down Expand Up @@ -211,7 +215,9 @@ FiniteDifferenceSparseImageFilter<TInputImageType, TSparseOutputImageType>::Prec
void * arg)
{
FDThreadStruct * str;
ThreadIdType total, workUnitID, workUnitCount;
ThreadIdType total;
ThreadIdType workUnitID;
ThreadIdType workUnitCount;

workUnitID = ((MultiThreaderBase::WorkUnitInfo *)(arg))->WorkUnitID;
workUnitCount = ((MultiThreaderBase::WorkUnitInfo *)(arg))->NumberOfWorkUnits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ RayCastInterpolateImageFunction<TInputImage, TCoordRep>::RayCastHelper::CalcPlan

// find the equations of the planes

int c1 = 0, c2 = 0, c3 = 0;
int c1 = 0;
int c2 = 0;
int c3 = 0;

for (j = 0; j < 6; ++j)
{ // loop around for planes
Expand Down Expand Up @@ -406,8 +408,12 @@ RayCastInterpolateImageFunction<TInputImage, TCoordRep>::RayCastHelper::CalcPlan
break;
}

double line1x, line1y, line1z;
double line2x, line2y, line2z;
double line1x;
double line1y;
double line1z;
double line2x;
double line2y;
double line2z;

// lines from one corner to another in x,y,z dirns
line1x = m_BoundingCorner[c1][0] - m_BoundingCorner[c2][0];
Expand All @@ -419,7 +425,10 @@ RayCastInterpolateImageFunction<TInputImage, TCoordRep>::RayCastHelper::CalcPlan
line1z = m_BoundingCorner[c1][2] - m_BoundingCorner[c2][2];
line2z = m_BoundingCorner[c1][2] - m_BoundingCorner[c3][2];

double A, B, C, D;
double A;
double B;
double C;
double D;

// take cross product
A = line1y * line2z - line2y * line1z;
Expand Down Expand Up @@ -758,7 +767,9 @@ template <typename TInputImage, typename TCoordRep>
void
RayCastInterpolateImageFunction<TInputImage, TCoordRep>::RayCastHelper::CalcDirnVector()
{
double xNum, yNum, zNum;
double xNum;
double yNum;
double zNum;

// Calculate the number of voxels in each direction

Expand Down Expand Up @@ -906,7 +917,8 @@ template <typename TInputImage, typename TCoordRep>
bool
RayCastInterpolateImageFunction<TInputImage, TCoordRep>::RayCastHelper::AdjustRayLength()
{
bool startOK, endOK;
bool startOK;
bool endOK;

int Istart[3];
int Idirn[3];
Expand Down Expand Up @@ -1048,7 +1060,9 @@ RayCastInterpolateImageFunction<TInputImage, TCoordRep>::RayCastHelper::Initiali
{
IndexType index;

int Ix, Iy, Iz;
int Ix;
int Iy;
int Iz;

Ix = static_cast<int>(m_RayVoxelStartPosition[0]);
Iy = static_cast<int>(m_RayVoxelStartPosition[1]);
Expand Down Expand Up @@ -1210,8 +1224,12 @@ template <typename TInputImage, typename TCoordRep>
double
RayCastInterpolateImageFunction<TInputImage, TCoordRep>::RayCastHelper::GetCurrentIntensity() const
{
double a, b, c, d;
double y, z;
double a;
double b;
double c;
double d;
double y;
double z;

if (!m_ValidRay)
{
Expand Down
9 changes: 7 additions & 2 deletions Modules/Core/Mesh/include/itkSimplexMesh.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ SimplexMesh<TPixelType, VDimension, TMeshTraits>::GetNeighbors(PointIdentifier
auto foundIt2 = std::find(list->begin(), list->end(), neighborArray[1]);
auto foundIt3 = std::find(list->begin(), list->end(), neighborArray[2]);
auto endIt = list->end();
bool found1 = false, found2 = false, found3 = false;
bool found1 = false;
bool found2 = false;
bool found3 = false;

if (foundIt1 != endIt)
{
Expand Down Expand Up @@ -390,7 +392,10 @@ template <typename TPixelType, unsigned int VDimension, typename TMeshTraits>
auto
SimplexMesh<TPixelType, VDimension, TMeshTraits>::ComputeNormal(PointIdentifier idx) const -> CovariantVectorType
{
PointType p, n1, n2, n3;
PointType p;
PointType n1;
PointType n2;
PointType n3;

p.Fill(0);
n1.Fill(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ class ITK_TEMPLATE_EXPORT SimplexMeshAdaptTopologyFilter : public MeshToMeshFilt
double
ComputeArea(PointIdentifier p1, PointIdentifier p2, PointIdentifier p3)
{
InputPointType v1, v2, v3;
InputPointType v1;
InputPointType v2;
InputPointType v3;

v1.Fill(0);
v2.Fill(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ SimplexMeshAdaptTopologyFilter<TInputMesh, TOutputMesh>::ComputeCellParameters()
PointIdentifier secondNewIndex = newPointId + 1;

// create first new point
InputPointType newMidPoint, helperPoint;
InputPointType p1, p2;
InputPointType newMidPoint;
InputPointType helperPoint;
InputPointType p1;
InputPointType p2;
p1.Fill(0);
p2.Fill(0);
outputMesh->GetPoint(lineOneFirstIdx, &p1);
Expand Down Expand Up @@ -399,7 +401,8 @@ SimplexMeshAdaptTopologyFilter<TInputMesh, TOutputMesh>::ComputeCellCenter(Input
InputPolygonPointIdIterator pointIt = simplexCell->PointIdsBegin();

InputVectorType tmp;
InputPointType p1, cellCenter;
InputPointType p1;
InputPointType cellCenter;

p1.Fill(0);
cellCenter.Fill(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ void
SimplexMeshToTriangleMeshFilter<TInputMesh, TOutputMesh>::CreateTriangles()
{
auto meshSource = AutoMeshSourceType::New();
typename AutoMeshSourceType::PointType p1, p2, p3;
typename AutoMeshSourceType::PointType p1;
typename AutoMeshSourceType::PointType p2;
typename AutoMeshSourceType::PointType p3;

typename TInputMesh::ConstPointer inputMesh = this->GetInput(0);
typename InputPointsContainer::ConstPointer points = inputMesh->GetPoints();
Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Mesh/include/itkSimplexMeshVolumeCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class ITK_TEMPLATE_EXPORT SimplexMeshVolumeCalculator : public Object
{
using PointIdIterator = typename SimplexPolygonType::PointIdIterator;
PointIdIterator it = poly->PointIdsBegin();
InputPointType center, p;
InputPointType center;
InputPointType p;
center.Fill(0);
p.Fill(0.0);

Expand Down
24 changes: 19 additions & 5 deletions Modules/Core/Mesh/include/itkSimplexMeshVolumeCalculator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,22 @@ SimplexMeshVolumeCalculator<TInputMesh>::CalculateTriangleVolume(InputPointType
InputPointType p3)
{
double area;
double a, b, c, s;
double i[3], j[3], k[3], u[3], absu[3], length;
double ii[3], jj[3], kk[3];
double xavg, yavg, zavg;
double a;
double b;
double c;
double s;
double i[3];
double j[3];
double k[3];
double u[3];
double absu[3];
double length;
double ii[3];
double jj[3];
double kk[3];
double xavg;
double yavg;
double zavg;

// Get i j k vectors ...
//
Expand Down Expand Up @@ -216,7 +228,9 @@ SimplexMeshVolumeCalculator<TInputMesh>::Compute()
{
this->Initialize();

InputPointType p1, p2, p3;
InputPointType p1;
InputPointType p2;
InputPointType p3;
p1.Fill(0.0);
p2.Fill(0.0);
p3.Fill(0.0);
Expand Down
16 changes: 13 additions & 3 deletions Modules/Core/Mesh/include/itkSphereMeshSource.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,19 @@ template <typename TOutputMesh>
void
SphereMeshSource<TOutputMesh>::GenerateData()
{
IdentifierType i, j, jn, p, numpts;
double ustep, vstep, ubeg, vbeg, u, v;
int signu, signv;
IdentifierType i;
IdentifierType j;
IdentifierType jn;
IdentifierType p;
IdentifierType numpts;
double ustep;
double vstep;
double ubeg;
double vbeg;
double u;
double v;
int signu;
int signv;

// calculate the number os cells and points
numpts = m_ResolutionX * m_ResolutionY + 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ template <typename TInputMesh>
void
TriangleMeshCurvatureCalculator<TInputMesh>::ComputeGaussCurvature(const InputMeshType * inputMesh)
{
MeshPointType e0, e1, e2;
double A, alpha0, alpha1, alpha2;
MeshPointType e0;
MeshPointType e1;
MeshPointType e2;
double A;
double alpha0;
double alpha1;
double alpha2;

const unsigned int numberOfPoints = inputMesh->GetNumberOfPoints();

Expand Down
16 changes: 12 additions & 4 deletions Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ TriangleMeshToSimplexMeshFilter<TInputMesh, TOutputMesh>::Initialize()

m_FaceSet = new IndexSetType();

InputPointType v1, v2, v3;
InputPointType v1;
InputPointType v2;
InputPointType v3;

for (unsigned int idx1 = 0; idx1 < m_IdOffset; ++idx1)
{
Expand Down Expand Up @@ -159,7 +161,9 @@ TriangleMeshToSimplexMeshFilter<TInputMesh, TOutputMesh>::CreateSimplexNeighbors
OutputPointsContainerPointer outputPointsContainer = output->GetPoints();
OutputPointsContainerIterator points = outputPointsContainer->Begin();

CellIdentifier tp0, tp1, tp2;
CellIdentifier tp0;
CellIdentifier tp1;
CellIdentifier tp2;

InputBoundaryAssignmentsContainerPointer cntlines = this->GetInput(0)->GetBoundaryAssignments(1);

Expand Down Expand Up @@ -312,7 +316,9 @@ TriangleMeshToSimplexMeshFilter<TInputMesh, TOutputMesh>::CreateCells()
auto iterator1 = vertexNeighbors.begin();

auto tmpMap = MapType::New();
CellIdentifier startIdx = NumericTraits<CellIdentifier>::max(), lastIdx = 0, wrongIdx = 0;
CellIdentifier startIdx = NumericTraits<CellIdentifier>::max();
CellIdentifier lastIdx = 0;
CellIdentifier wrongIdx = 0;

while (lastIdx != startIdx)
{
Expand Down Expand Up @@ -403,7 +409,9 @@ TriangleMeshToSimplexMeshFilter<TInputMesh, TOutputMesh>::ComputeFaceCenter(Cell
const InputMeshType * inputMesh)
-> InputPointType
{
InputPointType v1, v2, v3;
InputPointType v1;
InputPointType v2;
InputPointType v3;

CellAutoPointer cellPointer;

Expand Down
3 changes: 2 additions & 1 deletion Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ itkQuadrilateralCellTest(int, char *[])
* pointer to a cell; in this example it ends up pointing to
* different types of cells.
*/
CellAutoPointer testCell1, testCell2;
CellAutoPointer testCell1;
CellAutoPointer testCell2;
testCell1.TakeOwnership(new QuadrilateralHelper); // polymorphism
testCell2.TakeOwnership(new QuadrilateralHelper); // polymorphism
// List the points that the polygon will use from the mesh.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ QuadEdgeMeshEulerOperatorDeleteCenterVertexFunction<TMesh, TQEType>::Evaluate(QE
// that are incident to g->GetDestination().(This prevents the operation
// from collapsing a volume into two facets glued together with opposite
// orientations, such as would happen with any vertex of a tetrahedron.)
PointIdentifier PointId1, PointId2;
PointIdentifier PointId1;
PointIdentifier PointId2;
PointId1 = pList.back();
pList.pop_back();
PointId2 = pList.back();
Expand Down
Loading

0 comments on commit 6ed41a2

Please sign in to comment.