Skip to content

Commit

Permalink
STYLE: Rename ANTSGroupwiseRegistration to ANTSGroupwiseBuildTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Oct 9, 2024
1 parent ef800a5 commit 5162452
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*
*=========================================================================*/
#ifndef itkANTSGroupwiseRegistration_h
#define itkANTSGroupwiseRegistration_h
#ifndef itkANTSGroupwiseBuildTemplate_h
#define itkANTSGroupwiseBuildTemplate_h

#include "itkImageToImageFilter.h"
#include "itkANTSRegistration.h"
Expand All @@ -26,7 +26,7 @@
namespace itk
{

/** \class ANTSGroupwiseRegistration
/** \class ANTSGroupwiseBuildTemplate
*
* \brief Group-wise image registration method parameterized according to ANTsPy.
*
Expand All @@ -48,10 +48,10 @@ namespace itk
template <typename TImage,
typename TTemplateImage = Image<float, TImage::ImageDimension>,
typename TParametersValueType = double>
class ANTSGroupwiseRegistration : public ImageToImageFilter<TTemplateImage, TTemplateImage>
class ANTSGroupwiseBuildTemplate : public ImageToImageFilter<TTemplateImage, TTemplateImage>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ANTSGroupwiseRegistration);
ITK_DISALLOW_COPY_AND_MOVE(ANTSGroupwiseBuildTemplate);

static constexpr unsigned int ImageDimension = TImage::ImageDimension;

Expand All @@ -66,13 +66,13 @@ class ANTSGroupwiseRegistration : public ImageToImageFilter<TTemplateImage, TTem
using DecoratedOutputTransformType = DataObjectDecorator<OutputTransformType>;

/** Standard class aliases. */
using Self = ANTSGroupwiseRegistration<ImageType, TTemplateImage, ParametersValueType>;
using Self = ANTSGroupwiseBuildTemplate<ImageType, TTemplateImage, ParametersValueType>;
using Superclass = ImageToImageFilter<TTemplateImage, TTemplateImage>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;

/** Run-time type information. */
itkTypeMacro(ANTSGroupwiseRegistration, ImageToImageFilter);
itkTypeMacro(ANTSGroupwiseBuildTemplate, ImageToImageFilter);

/** Standard New macro. */
itkNewMacro(Self);
Expand Down Expand Up @@ -184,8 +184,8 @@ class ANTSGroupwiseRegistration : public ImageToImageFilter<TTemplateImage, TTem
GenerateOutputInformation() override;

protected:
ANTSGroupwiseRegistration();
~ANTSGroupwiseRegistration() override = default;
ANTSGroupwiseBuildTemplate();
~ANTSGroupwiseBuildTemplate() override = default;

/** Make a DataObject of the correct type to be used as the specified output. */
using DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType;
Expand Down Expand Up @@ -243,7 +243,7 @@ class ANTSGroupwiseRegistration : public ImageToImageFilter<TTemplateImage, TTem
} // namespace itk

#ifndef ITK_MANUAL_INSTANTIATION
# include "itkANTSGroupwiseRegistration.hxx"
# include "itkANTSGroupwiseBuildTemplate.hxx"
#endif

#endif // itkANTSGroupwiseRegistration
#endif // itkANTSGroupwiseBuildTemplate
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
* limitations under the License.
*
*=========================================================================*/
#ifndef itkANTSGroupwiseRegistration_hxx
#define itkANTSGroupwiseRegistration_hxx
#ifndef itkANTSGroupwiseBuildTemplate_hxx
#define itkANTSGroupwiseBuildTemplate_hxx

#include <sstream>

#include "itkPrintHelper.h"
#include "itkANTSGroupwiseRegistration.h" // needed by Visual Studio for code completion
#include "itkANTSGroupwiseBuildTemplate.h" // needed by Visual Studio for code completion
#include "itkImageDuplicator.h"
#include "itkWeightedAddImageFilter.h"
#include "itkAverageAffineTransformFunction.h"
Expand Down Expand Up @@ -78,7 +78,7 @@ namespace itk
{

template <typename TImage, typename TTemplateImage, typename TParametersValueType>
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::ANTSGroupwiseRegistration()
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::ANTSGroupwiseBuildTemplate()
{
this->SetPrimaryInputName("InitialTemplate");
this->SetPrimaryOutputName("OptimizedImage");
Expand All @@ -91,7 +91,7 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::ANTSGro

template <typename TImage, typename TTemplateImage, typename TParametersValueType>
void
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::PrintSelf(std::ostream & os,
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::PrintSelf(std::ostream & os,
Indent indent) const
{
using namespace print_helper;
Expand Down Expand Up @@ -127,7 +127,7 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::PrintSe

template <typename TImage, typename TTemplateImage, typename TParametersValueType>
void
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::VerifyInputInformation() const
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::VerifyInputInformation() const
{
if (m_ImageList.empty() && m_PathList.empty())
{
Expand Down Expand Up @@ -155,7 +155,7 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::VerifyI

template <typename TImage, typename TTemplateImage, typename TParametersValueType>
DataObject::Pointer
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::MakeOutput(DataObjectPointerArraySizeType)
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::MakeOutput(DataObjectPointerArraySizeType)
{
typename OutputTransformType::Pointer ptr;
Self::MakeOutputTransform(ptr);
Expand All @@ -167,7 +167,7 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::MakeOut

template <typename TImage, typename TTemplateImage, typename TParametersValueType>
auto
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::DuplicateImage(const TemplateImageType * image)
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::DuplicateImage(const TemplateImageType * image)
-> typename TemplateImageType::Pointer
{
using DuplicatorType = ImageDuplicator<TemplateImageType>;
Expand All @@ -181,7 +181,7 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::Duplica
template <typename TImage, typename TTemplateImage, typename TParametersValueType>
template <typename TOutputImage, typename TInputImage>
auto
itk::ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::ResampleToTarget(
itk::ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::ResampleToTarget(
const TInputImage * input,
const TemplateImageType * target,
typename TransformType::ConstPointer transform) -> typename TOutputImage::Pointer
Expand All @@ -204,7 +204,7 @@ itk::ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::Re
template <typename TImage, typename TTemplateImage, typename TParametersValueType>
template <typename TTempImage>
typename TTempImage::Pointer
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::ScaleAndAdd(
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::ScaleAndAdd(
typename TTempImage::Pointer temp,
const TTempImage * image,
typename TTempImage::PixelType weight)
Expand All @@ -230,7 +230,7 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::ScaleAn

template <typename TImage, typename TTemplateImage, typename TParametersValueType>
void
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::GenerateOutputInformation()
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::GenerateOutputInformation()
{
if (!m_PairwiseRegistration) // a custom pairwise registration is not set
{
Expand Down Expand Up @@ -299,7 +299,7 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::Generat

template <typename TImage, typename TTemplateImage, typename TParametersValueType>
void
ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::GenerateData()
ANTSGroupwiseBuildTemplate<TImage, TTemplateImage, TParametersValueType>::GenerateData()
{
this->UpdateProgress(0.0);

Expand Down Expand Up @@ -502,4 +502,4 @@ ANTSGroupwiseRegistration<TImage, TTemplateImage, TParametersValueType>::Generat

} // end namespace itk

#endif // itkANTSGroupwiseRegistration_hxx
#endif // itkANTSGroupwiseBuildTemplate_hxx
4 changes: 2 additions & 2 deletions test/itkANTSGroupwiseRegistrationTest3D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*=========================================================================*/

#include "itkANTSGroupwiseRegistration.h"
#include "itkANTSGroupwiseBuildTemplate.h"

#include "itkImageFileWriter.h"
#include "itkTxtTransformIOFactory.h"
Expand Down Expand Up @@ -44,7 +44,7 @@ itkANTSGroupwiseRegistrationTest3D(int argc, char * argv[])

using ImageType = itk::Image<signed short, 3>;
using FloatImageType = itk::Image<float, 3>;
using FilterType = itk::ANTSGroupwiseRegistration<ImageType, ImageType, float>;
using FilterType = itk::ANTSGroupwiseBuildTemplate<ImageType, ImageType, float>;
typename FilterType::Pointer filter = FilterType::New();

std::vector<ImageType::Pointer> images;
Expand Down
6 changes: 3 additions & 3 deletions test/itkANTSGroupwiseRegistrationTestFaces.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*=========================================================================*/

#include "itkANTSGroupwiseRegistration.h"
#include "itkANTSGroupwiseBuildTemplate.h"

#include "itkImageFileWriter.h"
#include "itkSimpleFilterWatcher.h"
Expand Down Expand Up @@ -56,15 +56,15 @@ itkANTSGroupwiseRegistrationTestFaces(int argc, char * argv[])

using ImageType = itk::Image<unsigned char, 2>;
using FloatImageType = itk::Image<float, 2>;
using FilterType = itk::ANTSGroupwiseRegistration<ImageType, FloatImageType, float>;
using FilterType = itk::ANTSGroupwiseBuildTemplate<ImageType, FloatImageType, float>;
typename FilterType::Pointer filter = FilterType::New();

if (argc > 5)
{
auto initialTemplate = itk::ReadImage<FloatImageType>(argv[5]);
filter->SetInitialTemplateImage(initialTemplate);
}
ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ANTSGroupwiseRegistration, ImageToImageFilter);
ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ANTSGroupwiseBuildTemplate, ImageToImageFilter);

itk::SimpleFilterWatcher watcher(filter, "ANTs groupwise registration");
std::vector<ImageType::Pointer> images;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if ("3" IN_LIST ITK_WRAP_IMAGE_DIMS)
list(APPEND Dimensions "3")
endif()

itk_wrap_class("itk::ANTSGroupwiseRegistration" POINTER)
itk_wrap_class("itk::ANTSGroupwiseBuildTemplate" POINTER)
foreach(d ${Dimensions})
foreach(t ${WRAP_ITK_SCALAR})
string(APPEND ITK_WRAP_PYTHON_SWIG_EXT "DECL_PYTHON_STD_VEC_RAW_TO_SMARTPTR_TYPEMAP(itkImage${ITKM_${t}}${d}, itkImage${ITKM_${t}}${d}_Pointer)\n")
Expand Down
2 changes: 1 addition & 1 deletion wrapping/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ itk_python_add_test(NAME PythonANTSRegistrationTest
)

itk_python_expression_add_test(NAME PythonInstantiateANTSGroupwiseRegistrationShort3Dfloat
EXPRESSION "reg = itk.ANTSGroupwiseRegistration[itk.Image[itk.SS, 3], itk.Image[itk.F, 3], itk.F].New()"
EXPRESSION "reg = itk.ANTSGroupwiseBuildTemplate[itk.Image[itk.SS, 3], itk.Image[itk.F, 3], itk.F].New()"
)

itk_python_add_test(NAME PythonANTsGroupwiseFaces
Expand Down
2 changes: 1 addition & 1 deletion wrapping/test/PythonANTsGroupwiseBrainSlices.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
assert ImageType == type(first_image)
TemplateImageType = itk.Image[itk.F, Dimension]

gwr = itk.ANTSGroupwiseRegistration[ImageType, TemplateImageType, itk.F].New()
gwr = itk.ANTSGroupwiseBuildTemplate[ImageType, TemplateImageType, itk.F].New()
# pairwise registration has different order of template parameters
pwr = itk.ANTSRegistration[TemplateImageType, ImageType, itk.F].New()

Expand Down
2 changes: 1 addition & 1 deletion wrapping/test/PythonANTsGroupwiseFaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
assert ImageType == type(first_image)
TemplateImageType = itk.Image[itk.F, Dimension]

gwr = itk.ANTSGroupwiseRegistration[ImageType, TemplateImageType, itk.F].New()
gwr = itk.ANTSGroupwiseBuildTemplate[ImageType, TemplateImageType, itk.F].New()
# pairwise registration has different order of template parameters
pwr = itk.ANTSRegistration[TemplateImageType, ImageType, itk.F].New()

Expand Down
2 changes: 1 addition & 1 deletion wrapping/test/PythonANTsGroupwisePaths.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
assert ImageType == type(first_image)
TemplateImageType = itk.Image[itk.F, Dimension]

gwr = itk.ANTSGroupwiseRegistration[ImageType, TemplateImageType, itk.F].New()
gwr = itk.ANTSGroupwiseBuildTemplate[ImageType, TemplateImageType, itk.F].New()
# pairwise registration has different order of template parameters
pwr = itk.ANTSRegistration[TemplateImageType, ImageType, itk.F].New()

Expand Down

0 comments on commit 5162452

Please sign in to comment.