msgBox.addButton(tr("Yes"), QMessageBox::AcceptRole);
msgBox.addButton(tr("No"), QMessageBox::RejectRole);
if (msgBox.exec() == QMessageBox::AcceptRole) {
- SetTransform(mInitialMatrix);
+ if (mCurrentSlicerManager)
+ SetTransform(mInitialMatrix);
return vvToolWidgetBase::close();
}
return false;
itk::Euler3DTransform<double>::Pointer euler;
euler = itk::Euler3DTransform<double>::New();
euler->SetCenter(center);
- euler->SetMatrix(rotMat);
+ try {
+#if ITK_VERSION_MAJOR > 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR > 6)
+ euler->SetMatrix(rotMat,0.00001);
+#else
+ euler->SetMatrix(rotMat);
+#endif
+ } catch (itk::ExceptionObject) {
+ QString warning = "The matrice is a non-orthogonal rotation matrix.\nThe manual registration doesn't work.";
+ QMessageBox msgBox(QMessageBox::Warning, tr("Reset transform"),warning, 0, this);
+ msgBox.addButton(tr("OK"), QMessageBox::AcceptRole);
+ if (msgBox.exec() == QMessageBox::AcceptRole) {
+ //SetTransform(mInitialMatrix);
+ vvToolWidgetBase::close();
+ }
+ }
euler->SetOffset(transVec);
// Modify GUI according to the new parameters