-#if VTK_MAJOR_VERSION >= 6
- vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
- try {
- mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
- } catch (const std::bad_cast& e) {
- std::cerr << e.what() << std::endl;
- std::cerr << "Conversion error" << std::endl;
- return;
- }
- if (mFirstSetSliceOrientation) {
- copyExtent(ext, mRegisterExtent);
- } else {
- int w_croppingRegion[6];
- copyExtent(mRegisterExtent, w_croppingRegion);
- w_croppingRegion[ this->SliceOrientation*2 ] = this->Slice;
- w_croppingRegion[ this->SliceOrientation*2+1 ] = this->Slice;
- mapperOpenGL->SetCroppingRegion(w_croppingRegion);
- }
-#endif