Question about CompositeTransform

Hi,

I have a question on CompositeTransform. The description of CompositeTransform says " This class concatenates transforms in reverse queue order by means of composition". I am wondering why the reverse queue is used. I made the following simple code. Translation of (1, 1) comes first and Rotation of (180 degree with (2,1) as the center) comes second. When (0, 0) is the starting point, it returns (5, 3), which means transformation occurs in the order of rotation - translation. This is exactly what the description says. But I want it to return (3, 1), as the translation comes first. If I would like to know the final position of a point in a fixed image after multiple transforms in registration, I have to construct CompositeTransform in the reverse order to get a right position. Is this not an intended way to use CompositeTransform? Or Do I misunderstand something?

#include
#include “itkTranslationTransform.h”
#include “itkCenteredRigid2DTransform.h”
#include “itkCompositeTransform.h”

using namespace itk;
using namespace std;

int main(int argc, char* argv)
{
static constexpr unsigned int VImageDimension = 2;
using TCoordinateRepType = double;

using TransTransformType = itk::TranslationTransform<TCoordinateRepType, 2>;
TransTransformType::Pointer t1 = TransTransformType::New();
const unsigned int numberOfParameters = t1->GetNumberOfParameters();
TransTransformType::ParametersType p1 = t1->GetParameters();
p1[0] = 1.0;
p1[1] = 1.0;
t1->SetParameters(p1);

using CRTransformType = itk::CenteredRigid2DTransform;
CRTransformType::Pointer t2 = CRTransformType::New();
const unsigned int numberOfParameters2 = t2->GetNumberOfParameters();
TransTransformType::ParametersType p2 = t2->GetParameters();
p2[0] = std::atan(1) * 4.0;
p2[1] = 2.0;
p2[2] = 1.0;
p2[3] = 0.0;
p2[4] = 0.0;
t2->SetParameters(p2);

using CompTransformType = itk::CompositeTransform< TCoordinateRepType, 2>;
CompTransformType::Pointer ct = CompTransformType::New();
ct->AddTransform(t1);
ct->AddTransform(t2);

CompTransformType::InputPointType inputPoint;
CompTransformType::OutputPointType outputPoint;
inputPoint[0] = 0.0;
inputPoint[1] = 0.0;
outputPoint = ct->TransformPoint(inputPoint);

std::cout << outputPoint << endl;
std::cout << “” << endl;
}

Thank you for your advice.

Kenji