Skip to content

Commit

Permalink
STYLE: Remove unused function
Browse files Browse the repository at this point in the history
The LowerToUpperOrder function is not part of the API, and
is never used.
  • Loading branch information
hjmjohnson committed Apr 11, 2024
1 parent 566f9f5 commit 6a5b346
Showing 1 changed file with 2 additions and 42 deletions.
44 changes: 2 additions & 42 deletions Modules/IO/NIFTI/src/itkNiftiImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ dumpdata(const void * x)
}
} // namespace
#else
# define dumpdata(x)
# define dumpdata(x) ITK_NOOP_STATEMENT
#endif // #if defined(ITK_USE_VERY_VERBOSE_NIFTI_DEBUGGING)

namespace
Expand Down Expand Up @@ -367,45 +367,6 @@ UpperToLowerOrder(int dim)
return rval;
}

// returns an ordering array for converting lower triangular symmetric matrix
// to upper triangular symmetric matrix
int *
LowerToUpperOrder(int dim)
{
auto ** mat = new int *[dim];

for (int i = 0; i < dim; ++i)
{
mat[i] = new int[dim];
}
// fill in
int index(0);
for (int i = 0; i < dim; ++i)
{
for (int j = 0; j <= i; j++, index++)
{
mat[i][j] = index;
mat[j][i] = index;
}
}
auto * rval = new int[index + 1];
int index2(0);
for (int i = 0; i < dim; ++i)
{
for (int j = i; j < dim; j++, index2++)
{
rval[index2] = mat[i][j];
}
}
rval[index2] = -1;
for (int i = 0; i < dim; ++i)
{
delete[] mat[i];
}
delete[] mat;
return rval;
}

// compute the rank of the symmetric matrix from
// the count of the triangular matrix elements
int
Expand Down Expand Up @@ -741,7 +702,6 @@ NiftiImageIO::Read(void * buffer)
if (this->GetPixelType() == IOPixelEnum::DIFFUSIONTENSOR3D ||
this->GetPixelType() == IOPixelEnum::SYMMETRICSECONDRANKTENSOR)
{
// vecOrder = LowerToUpperOrder(SymMatDim(numComponents));
vecOrder = UpperToLowerOrder(SymMatDim(numComponents));
}
else
Expand Down Expand Up @@ -2270,7 +2230,7 @@ NiftiImageIO::SetNIfTIOrientationFromImageIO(unsigned short origdims, unsigned s
// set the quaternions, from the direction vectors
// Initialize to size 3 with values of 0
//
// The type here must be float, because that matches the signature
// The type here must be a float, because that matches the signature
// of the nifti_make_orthog_mat44() method below.
using DirectionMatrixComponentType = float;
const int mindims(dims < 3 ? 3 : dims);
Expand Down

0 comments on commit 6a5b346

Please sign in to comment.