20 #include <itkCenteredEuler3DTransform.h>
21 #include <itkCenteredTransformInitializer.h>
47 template <
class TPixelType,
unsigned int VImageDimension>
49 itk::Image<TPixelType, VImageDimension> * )
51 typedef typename itk::Image<TPixelType, VImageDimension> FixedImageType;
52 typedef typename itk::Image<TPixelType, VImageDimension> MovingImageType;
53 if (VImageDimension == 3)
57 transformPointer->SetIdentity();
58 m_CenterX = transformPointer->GetCenter()[0];
59 m_CenterY = transformPointer->GetCenter()[1];
60 m_CenterZ = transformPointer->GetCenter()[2];
62 return transformPointer.GetPointer();
69 itk::Array<double> transformValues;
70 transformValues.SetSize(9);
71 transformValues.fill(0);
72 transformValues[0] =
m_Controls.m_UseOptimizerScalesCenteredEuler3D->isChecked();
73 transformValues[1] =
m_Controls.m_ScalesCenteredEuler3DTransformScale1->text().toDouble();
74 transformValues[2] =
m_Controls.m_ScalesCenteredEuler3DTransformScale2->text().toDouble();
75 transformValues[3] =
m_Controls.m_ScalesCenteredEuler3DTransformScale3->text().toDouble();
76 transformValues[4] =
m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationX->text().toDouble();
77 transformValues[5] =
m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationY->text().toDouble();
78 transformValues[6] =
m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationZ->text().toDouble();
79 transformValues[7] =
m_Controls.m_CenterForInitializerCenteredEuler3D->isChecked();
80 transformValues[8] =
m_Controls.m_MomentsCenteredEuler3D->isChecked();
81 return transformValues;
86 m_Controls.m_UseOptimizerScalesCenteredEuler3D->setChecked(transformValues[0]);
87 m_Controls.m_ScalesCenteredEuler3DTransformScale1->setText(QString::number(transformValues[1]));
88 m_Controls.m_ScalesCenteredEuler3DTransformScale2->setText(QString::number(transformValues[2]));
89 m_Controls.m_ScalesCenteredEuler3DTransformScale3->setText(QString::number(transformValues[3]));
90 m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationX->setText(QString::number(transformValues[4]));
91 m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationY->setText(QString::number(transformValues[5]));
92 m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationZ->setText(QString::number(transformValues[6]));
93 m_Controls.m_CenterForInitializerCenteredEuler3D->setChecked(transformValues[7]);
94 m_Controls.m_MomentsCenteredEuler3D->setChecked(transformValues[8]);
95 m_Controls.m_GeometryCenteredEuler3D->setChecked(!transformValues[8]);
100 return "CenteredEuler3D";
106 QValidator *validatorLineEditInputFloat =
new QDoubleValidator(0, 20000000, 8,
this);
107 m_Controls.m_ScalesCenteredEuler3DTransformScale1->setValidator(validatorLineEditInputFloat);
108 m_Controls.m_ScalesCenteredEuler3DTransformScale2->setValidator(validatorLineEditInputFloat);
109 m_Controls.m_ScalesCenteredEuler3DTransformScale3->setValidator(validatorLineEditInputFloat);
110 m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationX->setValidator(validatorLineEditInputFloat);
111 m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationY->setValidator(validatorLineEditInputFloat);
112 m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat);
117 itk::Array<double> scales;
120 if (
m_Controls.m_UseOptimizerScalesCenteredEuler3D->isChecked())
122 scales[0] =
m_Controls.m_ScalesCenteredEuler3DTransformScale1->text().toDouble();
123 scales[1] =
m_Controls.m_ScalesCenteredEuler3DTransformScale2->text().toDouble();
124 scales[2] =
m_Controls.m_ScalesCenteredEuler3DTransformScale3->text().toDouble();
125 scales[3] =
m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationX->text().toDouble();
126 scales[4] =
m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationY->text().toDouble();
127 scales[5] =
m_Controls.m_ScalesCenteredEuler3DTransformScaleTranslationZ->text().toDouble();
133 vtkTransform *vtktransform,
134 itk::Array<double> transformParams)
141 vtktransform->PostMultiply();
143 vtktransform->RotateX(angleX);
144 vtktransform->RotateY(angleY);
145 vtktransform->RotateZ(angleZ);
147 vtktransform->Translate(transformParams[3], transformParams[4], transformParams[5]);
148 vtktransform->PreMultiply();
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.