X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkInversCrop.cxx;h=8581943820eb2e983ad2861975efcda79f2223cb;hb=42286a16f16c8af07589bbbe30c157770b73bbb2;hp=7d0962f05e94adc731073c9da1a9b7a7eb4762e7;hpb=0dde94ea04d1505b73e3b57bb3d736363104642f;p=bbtk.git diff --git a/packages/vtk/src/bbvtkInversCrop.cxx b/packages/vtk/src/bbvtkInversCrop.cxx index 7d0962f..8581943 100644 --- a/packages/vtk/src/bbvtkInversCrop.cxx +++ b/packages/vtk/src/bbvtkInversCrop.cxx @@ -28,24 +28,43 @@ void InversCrop::Process() if ((bbGetInputImageFix()!=NULL) && (bbGetInputImageMove()!=NULL) ) { -printf("EED InversCrop::Process ScalarType %d %d \n", bbGetInputImageFix()->GetScalarType(), bbGetInputImageMove()->GetScalarType() ); if ( bbGetInputImageFix()->GetScalarType()==bbGetInputImageMove()->GetScalarType() ) { // Creating Image 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; - - _imageoutput = vtkImageData::New(); - _imageoutput->Initialize(); - _imageoutput->SetScalarType( bbGetInputImageFix()->GetScalarType() ); - _imageoutput->SetSpacing( bbGetInputImageFix()->GetSpacing() ); - _imageoutput->SetDimensions( dim[0], dim[1], dim[2] ); - _imageoutput->AllocateScalars(); + + if (bbGetInputType()==0) + { + _imageoutput = vtkImageData::New(); + _imageoutput->Initialize(); + _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) + { + _imageoutput=bbGetInputImageFix(); + } + // Duplicating Fix Image long sizeimage = dim[0]*dim[1]*dim[2]*bbGetInputImageFix()->GetScalarSize(); @@ -55,7 +74,14 @@ printf("EED InversCrop::Process ScalarType %d %d \n", bbGetInputImageFix()->Get 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; @@ -110,6 +136,7 @@ void InversCrop::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 + bbSetInputType(0); bbSetInputImageFix(NULL); bbSetInputImageMove(NULL);