From: Eduardo DAVILA Date: Wed, 8 Aug 2018 10:54:12 +0000 (+0200) Subject: #3212 BBTK Feature New Normal - vtk8itk4wx3-mingw64 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9e57b365ed2fbfe0ac5fd144a7e1d88cbea6cffa;p=bbtk.git #3212 BBTK Feature New Normal - vtk8itk4wx3-mingw64 --- diff --git a/packages/vtk/src/bbvtkImageBoundaries.cxx b/packages/vtk/src/bbvtkImageBoundaries.cxx index 8d003bd..67eefef 100644 --- a/packages/vtk/src/bbvtkImageBoundaries.cxx +++ b/packages/vtk/src/bbvtkImageBoundaries.cxx @@ -93,10 +93,8 @@ void ImageBoundaries::Process() */ DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI,bbGetInputIn()) - int i; - int j; long int index=0; - for (int k=0 ; k= 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; + dim[0]= ext[1]-ext[0]+1; + dim[1]= ext[3]-ext[2]+1; + dim[2]= ext[5]-ext[4]+1; - 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(); - memcpy( _imageoutput->GetScalarPointer() , bbGetInputImageFix()->GetScalarPointer() , sizeimage); - - // Copy the Move Image - 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; - - int spxM=0; // start px MoveImage - int sizeXM=0; // sizeX MoveImage - - px=bbGetInputOrigin()[0]; - spxM=0; - if (px<=0) - { - spxM=px*(-1); - px=0; - } - sizeXM = dimMoveX-spxM; - if (px+sizeXM>=dim[0]) sizeXM=dim[0]-px; - - sizeXM=sizeXM*bbGetInputImageFix()->GetScalarSize(); - for (k=0; k=0) && (pz>=0) && - (sizeXM>0) ) + if (bbGetInputType()==0) { _imageoutput = vtkImageData::New(); _imageoutput->Initialize(); - _imageoutput->SetScalarType( bbGetInputImageFix()->GetScalarType() ); _imageoutput->SetSpacing( bbGetInputImageFix()->GetSpacing() ); - _imageoutput->SetDimensions( dim[0], dim[1], dim[2] ); + _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 + // Duplicating Fix Image long sizeimage = dim[0]*dim[1]*dim[2]*bbGetInputImageFix()->GetScalarSize(); memcpy( _imageoutput->GetScalarPointer() , bbGetInputImageFix()->GetScalarPointer() , sizeimage); @@ -134,7 +77,13 @@ 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;