X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkInversCrop.cxx;h=8581943820eb2e983ad2861975efcda79f2223cb;hb=d19c5512748aa8e2dd5c3d01d9ec680ded1f17ce;hp=97963bca7327d6d4f3edc07a6ac10e4ba8019d7f;hpb=088ed2b7bdbe14eb85a7245afaa693ddb7a53a97;p=bbtk.git diff --git a/packages/vtk/src/bbvtkInversCrop.cxx b/packages/vtk/src/bbvtkInversCrop.cxx index 97963bc..8581943 100644 --- a/packages/vtk/src/bbvtkInversCrop.cxx +++ b/packages/vtk/src/bbvtkInversCrop.cxx @@ -34,7 +34,13 @@ void InversCrop::Process() int dim[3]; int ext[6]; +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) bbGetInputImageFix()->GetWholeExtent(ext); +#endif +#if (VTK_MAJOR_VERSION >= 6) + bbGetInputImageFix()->GetExtent(ext); +#endif dim[0]= ext[1]-ext[0]+1; dim[1]= ext[3]-ext[2]+1; dim[2]= ext[5]-ext[4]+1; @@ -43,10 +49,16 @@ void InversCrop::Process() { _imageoutput = vtkImageData::New(); _imageoutput->Initialize(); - _imageoutput->SetScalarType( bbGetInputImageFix()->GetScalarType() ); _imageoutput->SetSpacing( bbGetInputImageFix()->GetSpacing() ); _imageoutput->SetDimensions( dim[0], dim[1], dim[2] ); +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) + _imageoutput->SetScalarType( bbGetInputImageFix()->GetScalarType() ); _imageoutput->AllocateScalars(); +#endif +#if (VTK_MAJOR_VERSION >= 6) + _imageoutput->AllocateScalars(bbGetInputImageFix()->GetScalarType() , 1); +#endif } if (bbGetInputType()==1) { @@ -62,7 +74,14 @@ void InversCrop::Process() int j,k; int px,py,pz; +//EED 2017-01-01 Migration VTK7 +#if (VTK_MAJOR_VERSION <= 5) bbGetInputImageMove()->GetWholeExtent(ext); +#endif +#if (VTK_MAJOR_VERSION >= 6) + bbGetInputImageMove()->GetExtent(ext); +#endif + int dimMoveX = ext[1]-ext[0]+1; int dimMoveY = ext[3]-ext[2]+1; int dimMoveZ = ext[5]-ext[4]+1;