20 #include <itkTranslationTransform.h>
46 template <
class TPixelType,
unsigned int VImageDimension>
48 itk::Image<TPixelType, VImageDimension> * )
50 typedef typename itk::Image<TPixelType, VImageDimension> FixedImageType;
51 typedef typename itk::Image<TPixelType, VImageDimension> MovingImageType;
52 typedef itk::TranslationTransform<double, VImageDimension> TransformType;
54 transform->SetIdentity();
56 return transform.GetPointer();
61 itk::Array<double> transformValues;
62 transformValues.SetSize(4);
63 transformValues.fill(0);
64 transformValues[0] =
m_Controls.m_UseOptimizerScalesTranslation->isChecked();
65 transformValues[1] =
m_Controls.m_ScalesTranslationTransformTranslationX->text().toDouble();
66 transformValues[2] =
m_Controls.m_ScalesTranslationTransformTranslationY->text().toDouble();
67 transformValues[3] =
m_Controls.m_ScalesTranslationTransformTranslationZ->text().toDouble();
68 return transformValues;
73 m_Controls.m_UseOptimizerScalesTranslation->setChecked(transformValues[0]);
74 m_Controls.m_ScalesTranslationTransformTranslationX->setText(QString::number(transformValues[1]));
75 m_Controls.m_ScalesTranslationTransformTranslationY->setText(QString::number(transformValues[2]));
76 m_Controls.m_ScalesTranslationTransformTranslationZ->setText(QString::number(transformValues[3]));
87 QValidator *validatorLineEditInputFloat =
new QDoubleValidator(0, 20000000, 8,
this);
88 m_Controls.m_ScalesTranslationTransformTranslationX->setValidator(validatorLineEditInputFloat);
89 m_Controls.m_ScalesTranslationTransformTranslationY->setValidator(validatorLineEditInputFloat);
90 m_Controls.m_ScalesTranslationTransformTranslationZ->setValidator(validatorLineEditInputFloat);
95 itk::Array<double> scales;
98 if (
m_Controls.m_UseOptimizerScalesTranslation->isChecked())
100 scales[0] =
m_Controls.m_ScalesTranslationTransformTranslationX->text().toDouble();
101 scales[1] =
m_Controls.m_ScalesTranslationTransformTranslationY->text().toDouble();
102 scales[2] =
m_Controls.m_ScalesTranslationTransformTranslationZ->text().toDouble();
108 vtkTransform *vtktransform,
109 itk::Array<double> transformParams)
113 if (transformParams.size() == 2)
115 vtktransform->Translate(transformParams[0], transformParams[1], 0);
117 else if (transformParams.size() == 3)
119 vtktransform->Translate(transformParams[0], transformParams[1], transformParams[2]);
120 std::cout <<
"Translation is: " << transformParams[0] << transformParams[1] << transformParams[2] << std::endl;
132 m_Controls.m_ScalesTranslationTransformTranslationZ->hide();
139 m_Controls.m_ScalesTranslationTransformTranslationZ->show();
itk::SmartPointer< Self > Pointer
TransformType
Unique integer value for every transform.
#define AccessByItk(mitkImage, itkImageTypeFunction)
Access a MITK image by an ITK image.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.