20 #include <itkCenteredTransformInitializer.h>
21 #include <itkEuler3DTransform.h>
47 template <
class TPixelType,
unsigned int VImageDimension>
48 itk::Object::Pointer QmitkEuler3DTransformView::GetTransform2(itk::Image<TPixelType, VImageDimension> * )
50 if (VImageDimension == 3)
53 transformPointer->SetIdentity();
54 m_CenterX = transformPointer->GetCenter()[0];
55 m_CenterY = transformPointer->GetCenter()[1];
56 m_CenterZ = transformPointer->GetCenter()[2];
58 return transformPointer.GetPointer();
65 itk::Array<double> transformValues;
66 transformValues.SetSize(9);
67 transformValues.fill(0);
68 transformValues[0] =
m_Controls.m_UseOptimizerScalesEuler3D->isChecked();
69 transformValues[1] =
m_Controls.m_ScalesEuler3DTransformScale1->text().toDouble();
70 transformValues[2] =
m_Controls.m_ScalesEuler3DTransformScale2->text().toDouble();
71 transformValues[3] =
m_Controls.m_ScalesEuler3DTransformScale3->text().toDouble();
72 transformValues[4] =
m_Controls.m_ScalesEuler3DTransformScaleTranslationX->text().toDouble();
73 transformValues[5] =
m_Controls.m_ScalesEuler3DTransformScaleTranslationY->text().toDouble();
74 transformValues[6] =
m_Controls.m_ScalesEuler3DTransformScaleTranslationZ->text().toDouble();
75 transformValues[7] =
m_Controls.m_CenterForInitializerEuler3D->isChecked();
76 transformValues[8] =
m_Controls.m_MomentsEuler3D->isChecked();
77 return transformValues;
82 m_Controls.m_UseOptimizerScalesEuler3D->setChecked(transformValues[0]);
83 m_Controls.m_ScalesEuler3DTransformScale1->setText(QString::number(transformValues[1]));
84 m_Controls.m_ScalesEuler3DTransformScale2->setText(QString::number(transformValues[2]));
85 m_Controls.m_ScalesEuler3DTransformScale3->setText(QString::number(transformValues[3]));
86 m_Controls.m_ScalesEuler3DTransformScaleTranslationX->setText(QString::number(transformValues[4]));
87 m_Controls.m_ScalesEuler3DTransformScaleTranslationY->setText(QString::number(transformValues[5]));
88 m_Controls.m_ScalesEuler3DTransformScaleTranslationZ->setText(QString::number(transformValues[6]));
89 m_Controls.m_CenterForInitializerEuler3D->setChecked(transformValues[7]);
90 m_Controls.m_MomentsEuler3D->setChecked(transformValues[8]);
91 m_Controls.m_GeometryEuler3D->setChecked(!transformValues[8]);
102 QValidator *validatorLineEditInputFloat =
new QDoubleValidator(0, 20000000, 8,
this);
103 m_Controls.m_ScalesEuler3DTransformScale1->setValidator(validatorLineEditInputFloat);
104 m_Controls.m_ScalesEuler3DTransformScale2->setValidator(validatorLineEditInputFloat);
105 m_Controls.m_ScalesEuler3DTransformScale3->setValidator(validatorLineEditInputFloat);
106 m_Controls.m_ScalesEuler3DTransformScaleTranslationX->setValidator(validatorLineEditInputFloat);
107 m_Controls.m_ScalesEuler3DTransformScaleTranslationY->setValidator(validatorLineEditInputFloat);
108 m_Controls.m_ScalesEuler3DTransformScaleTranslationZ->setValidator(validatorLineEditInputFloat);
113 itk::Array<double> scales;
116 if (
m_Controls.m_UseOptimizerScalesEuler3D->isChecked())
118 scales[0] =
m_Controls.m_ScalesEuler3DTransformScale1->text().toDouble();
119 scales[1] =
m_Controls.m_ScalesEuler3DTransformScale2->text().toDouble();
120 scales[2] =
m_Controls.m_ScalesEuler3DTransformScale3->text().toDouble();
121 scales[3] =
m_Controls.m_ScalesEuler3DTransformScaleTranslationX->text().toDouble();
122 scales[4] =
m_Controls.m_ScalesEuler3DTransformScaleTranslationY->text().toDouble();
123 scales[5] =
m_Controls.m_ScalesEuler3DTransformScaleTranslationZ->text().toDouble();
129 vtkTransform *vtktransform,
130 itk::Array<double> transformParams)
137 vtktransform->PostMultiply();
139 vtktransform->RotateX(angleX);
140 vtktransform->RotateY(angleY);
141 vtktransform->RotateZ(angleZ);
143 vtktransform->Translate(transformParams[3], transformParams[4], transformParams[5]);
144 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.