Skip to content

Commit

Permalink
STYLE: Update template parameter names for KWStyle
Browse files Browse the repository at this point in the history
`N` is removed as a valid template name prefix such that `NComponents`
is no longer a valid template name. Updated name to `VComponents` which
conforms to ITK KWStyle guidelines.

Relevant ITK KWStyle change is at commit 4b43536c8b22bb716a4f0b76a0582a99d6d8911d
  • Loading branch information
tbirdso committed May 9, 2022
1 parent 38af7b6 commit f98ff9d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions include/itkImageToImageOfVectorsFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ namespace itk
*
* \ingroup BSplineGradient
*/
template <typename TInputImage, unsigned int NComponents = 3>
template <typename TInputImage, unsigned int VComponents = 3>
class ITK_TEMPLATE_EXPORT ImageToImageOfVectorsFilter
: public ImageToImageFilter<
TInputImage,
Image<Vector<typename TInputImage::InternalPixelType, NComponents>, TInputImage::ImageDimension>>
Image<Vector<typename TInputImage::InternalPixelType, VComponents>, TInputImage::ImageDimension>>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ImageToImageOfVectorsFilter);

using Superclass = ImageToImageFilter<
TInputImage,
Image<Vector<typename TInputImage::InternalPixelType, NComponents>, TInputImage::ImageDimension>>;
Image<Vector<typename TInputImage::InternalPixelType, VComponents>, TInputImage::ImageDimension>>;
using Self = ImageToImageOfVectorsFilter;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
Expand All @@ -71,7 +71,7 @@ class ITK_TEMPLATE_EXPORT ImageToImageOfVectorsFilter

using InputPixelType = typename InputImageType::InternalPixelType;

using OutputPixelType = Vector<InputPixelType, NComponents>;
using OutputPixelType = Vector<InputPixelType, VComponents>;
using OutputImageType = Image<OutputPixelType, ImageDimension>;
using RegionType = typename OutputImageType::RegionType;

Expand Down
20 changes: 10 additions & 10 deletions include/itkImageToImageOfVectorsFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@
namespace itk
{

template <typename TInputImage, unsigned int NComponents>
ImageToImageOfVectorsFilter<TInputImage, NComponents>::ImageToImageOfVectorsFilter()
template <typename TInputImage, unsigned int VComponents>
ImageToImageOfVectorsFilter<TInputImage, VComponents>::ImageToImageOfVectorsFilter()
{
// At least 1 input is required.
this->SetNumberOfRequiredInputs(1);
}

template <typename TInputImage, unsigned int NComponents>
template <typename TInputImage, unsigned int VComponents>
void
ImageToImageOfVectorsFilter<TInputImage, NComponents>::BeforeThreadedGenerateData()
ImageToImageOfVectorsFilter<TInputImage, VComponents>::BeforeThreadedGenerateData()
{
RegionType region;

for (unsigned int i = 0; i < NComponents; i++)
for (unsigned int i = 0; i < VComponents; i++)
{
auto * input = static_cast<InputImageType *>(this->ProcessObject::GetInput(i));
if (!input)
Expand All @@ -55,9 +55,9 @@ ImageToImageOfVectorsFilter<TInputImage, NComponents>::BeforeThreadedGenerateDat
}
}

template <typename TInputImage, unsigned int NComponents>
template <typename TInputImage, unsigned int VComponents>
void
ImageToImageOfVectorsFilter<TInputImage, NComponents>::DynamicThreadedGenerateData(
ImageToImageOfVectorsFilter<TInputImage, VComponents>::DynamicThreadedGenerateData(
const RegionType & outputRegionForThread)
{
typename OutputImageType::Pointer outputImage = static_cast<OutputImageType *>(this->ProcessObject::GetOutput(0));
Expand All @@ -68,7 +68,7 @@ ImageToImageOfVectorsFilter<TInputImage, NComponents>::DynamicThreadedGenerateDa
using InputIteratorType = ImageRegionConstIterator<InputImageType>;
std::vector<InputIteratorType *> inputItContainer;

for (unsigned int i = 0; i < NComponents; i++)
for (unsigned int i = 0; i < VComponents; i++)
{
typename InputImageType::Pointer inputImagePointer =
static_cast<InputImageType *>(this->ProcessObject::GetInput(i));
Expand All @@ -81,7 +81,7 @@ ImageToImageOfVectorsFilter<TInputImage, NComponents>::DynamicThreadedGenerateDa
typename OutputImageType::PixelType pix;
while (!oit.IsAtEnd())
{
for (unsigned int i = 0; i < NComponents; i++)
for (unsigned int i = 0; i < VComponents; i++)
{
pix[i] = inputItContainer[i]->Get();
++(*inputItContainer[i]);
Expand All @@ -90,7 +90,7 @@ ImageToImageOfVectorsFilter<TInputImage, NComponents>::DynamicThreadedGenerateDa
++oit;
}

for (unsigned int i = 0; i < NComponents; i++)
for (unsigned int i = 0; i < VComponents; i++)
{
delete inputItContainer[i];
}
Expand Down

0 comments on commit f98ff9d

Please sign in to comment.