- int ext[6];
- int newDim[3];
- double spc[3];
- int scalartype;
-
- imagedata->GetSpacing(spc);
- imagedata->GetExtent(ext);
- newDim[0]=ext[1]-ext[0]+1;
- newDim[1]=ext[3]-ext[2]+1;
- newDim[2]=ext[5]-ext[4]+1;
- scalartype = imagedata->GetScalarType();
-
- if (imagedataValueResult!=NULL)
- {
- imagedataValueResult->Delete();
- }
- imagedataValueResult = vtkImageData::New();
-// imagedataValueResult->SetScalarType(scalartype);
- imagedataValueResult->SetScalarTypeToUnsignedShort();
- imagedataValueResult->SetSpacing(spc);
- imagedataValueResult->SetDimensions( newDim );
- imagedataValueResult->AllocateScalars();
-
- if (imagedataMaskResult!=NULL)
- {
- imagedataMaskResult->Delete();
- }
- imagedataMaskResult = vtkImageData::New();
-// imagedataMaskResult->SetScalarType(scalartype);
- imagedataMaskResult->SetScalarTypeToUnsignedShort();
- imagedataMaskResult->SetSpacing(spc);
- imagedataMaskResult->SetDimensions( newDim );
- imagedataMaskResult->AllocateScalars();
+ int ext[6];
+ int newDim[3];
+ double spc[3];
+ int scalartype;
+
+ imagedata->GetSpacing(spc);
+ imagedata->GetExtent(ext);
+ newDim[0]=ext[1]-ext[0]+1;
+ newDim[1]=ext[3]-ext[2]+1;
+ newDim[2]=ext[5]-ext[4]+1;
+ scalartype = imagedata->GetScalarType();
+
+ if (imagedataValueResult!=NULL)
+ {
+ imagedataValueResult->Delete();
+ }
+ imagedataValueResult = vtkImageData::New();
+ // imagedataValueResult->SetScalarType(scalartype);
+ imagedataValueResult->SetSpacing(spc);
+ imagedataValueResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataValueResult->SetScalarTypeToUnsignedShort();
+ imagedataValueResult->AllocateScalars();
+#else
+ imagedataValueResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+
+
+ if (imagedataMaskResult!=NULL)
+ {
+ imagedataMaskResult->Delete();
+ }
+ imagedataMaskResult = vtkImageData::New();
+ // imagedataMaskResult->SetScalarType(scalartype);
+ imagedataMaskResult->SetSpacing(spc);
+ imagedataMaskResult->SetDimensions( newDim );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ imagedataMaskResult->SetScalarTypeToUnsignedShort();
+ imagedataMaskResult->AllocateScalars();
+#else
+ imagedataMaskResult->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
+