mCurrentSlicerManager->GetSlicer(i)->EnableReducedExtent(false);
UpdateExtent();
}
+ mCurrentSlicerManager->GetImage()->GetTransform()[0]->SetMatrix(mConcatenedTransform);
+ for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
+ mCurrentSlicerManager->GetSlicer(i)->ResetCamera();
+ mCurrentSlicerManager->GetSlicer(i)->Render();
+ mCurrentSlicerManager->UpdateLinkedNavigation( mCurrentSlicerManager->GetSlicer(i) );
+ }
vvToolWidgetBase::closeEvent(event);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolCropImage::InputIsSelected(vvSlicerManager * slicer)
{
+ //Save the current transformation
+ mConcatenedTransform = vtkSmartPointer<vtkMatrix4x4>::New();
+ mConcatenedTransform->DeepCopy(slicer->GetSlicer(0)->GetConcatenatedTransform()->GetMatrix());
+ vtkSmartPointer<vtkMatrix4x4> matrix = vtkSmartPointer<vtkMatrix4x4>::New();
+ matrix->Identity();
+ mCurrentSlicerManager->GetImage()->GetTransform()[0]->SetMatrix(matrix);
+ for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++) {
+ mCurrentSlicerManager->GetSlicer(i)->ResetCamera();
+ mCurrentSlicerManager->GetSlicer(i)->Render();
+ mCurrentSlicerManager->UpdateLinkedNavigation( mCurrentSlicerManager->GetSlicer(i) );
+ }
+
// Change interface according to number of dimension
mExtentSize = 2*slicer->GetDimension();
if (slicer->GetDimension()<4) {
// Retrieve result and display it
vvImage::Pointer output = filter->GetOutputVVImage();
+ output->GetTransform()[0]->SetMatrix(mConcatenedTransform);
+
AddImage(output,croppedImageName.str());
// End
#include "vvToolWidgetBase.h"
#include "vvMainWindowBase.h"
#include "ui_vvToolCropImage.h"
+//vtk
+#include <vtkTransform.h>
//------------------------------------------------------------------------------
class vvToolCropImage:
virtual void closeEvent(QCloseEvent *event);
std::vector<QSlider*> mSliders;
+ vtkSmartPointer<vtkMatrix4x4> mConcatenedTransform;
}; // end class vvToolCropImage
//------------------------------------------------------------------------------