X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolCropImage.cxx;h=539e30ef9ea892727b49348220e9e9e8c2333eae;hb=72c516346c3a550e2d34a7635f5f41061a16306c;hp=9d6d891bbadd2bafe01892278c72ffc2f1d09738;hpb=ec961a7ab6c69087e6059d5ef6e8c02806a8f93f;p=clitk.git diff --git a/vv/vvToolCropImage.cxx b/vv/vvToolCropImage.cxx index 9d6d891..539e30e 100644 --- a/vv/vvToolCropImage.cxx +++ b/vv/vvToolCropImage.cxx @@ -33,6 +33,9 @@ #include // vtk +#include +#include +#include #include #include #include @@ -173,8 +176,11 @@ void vvToolCropImage::InputIsSelected(vvSlicerManager * slicer) spin_zmin->setHidden(true); spin_zmax->setHidden(true); } - +#if VTK_MAJOR_VERSION <= 5 int *a = mCurrentImage->GetFirstVTKImageData()->GetWholeExtent(); +#else + int *a = mCurrentImage->GetFirstVTKImageData()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()); +#endif for(int i=0; i<6; i++){ mInitialExtent[i] = a[i]; mReducedExtent[i] = a[i]; @@ -274,15 +280,19 @@ void vvToolCropImage::apply() catch(clitk::ExceptionObject & e) { DD(e.what()); QApplication::restoreOverrideCursor(); + delete [] mArgsInfo.boundingBox_arg; close(); } std::ostringstream croppedImageName; croppedImageName << "Cropped_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd"; // Retrieve result and display it vvImage::Pointer output = filter->GetOutputVVImage(); + AddImage(output,croppedImageName.str()); + // End QApplication::restoreOverrideCursor(); + delete [] mArgsInfo.boundingBox_arg; close(); } //------------------------------------------------------------------------------