- 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;
-
+ dim[0]= ext[1]-ext[0]+1;
+ dim[1]= ext[3]-ext[2]+1;
+ dim[2] = 1;
+ if (bbGetInputImageFix()->GetDataDimension()==3)
+ {
+ 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] );