vtkSmartPointer<vtkLinearExtrusionFilter> extrude=vtkSmartPointer<vtkLinearExtrusionFilter>::New();
#if VTK_MAJOR_VERSION <= 5
extrude->SetInput(mesh);
- ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !)
- extrude->SetVector(0, 0, -0.5*mSpacing[2]);
#else
extrude->SetInputData(mesh);
- ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !)
- extrude->SetVector(0, 0, 0.5*mSpacing[2]);
#endif
+ ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !)
+ extrude->SetVector(0, 0, -mSpacing[2]);
// Binarization
vtkSmartPointer<vtkPolyDataToImageStencil> sts=vtkSmartPointer<vtkPolyDataToImageStencil>::New();
double * p = mData->GetPoint(i);
points[i*3] = p[0];
points[i*3+1] = p[1];
- points[i*3+2] = p[2];
+#if VTK_MAJOR_VERSION <= 5
+ points[i*3+1] = p[2];
+#else
+ points[i*3+1] = p[2]-0.5;
+#endif
}
// Get attribute
double p[3];
p[0] = points[i*3];
p[1] = points[i*3+1];
+#if VTK_MAJOR_VERSION <= 5
p[2] = points[i*3+2];
+#else
+ p[2] = points[i*3+2]+0.5;
+#endif
mData->SetPoint(i, p);
if (mZ == -1) mZ = p[2];
if (p[2] != mZ) {
double p[3];
p[0] = points[i*3];
p[1] = points[i*3+1];
+#if VTK_MAJOR_VERSION <= 5
p[2] = points[i*3+2];
+#else
+ p[2] = points[i*3+2]+0.5;
+#endif
mData->SetPoint(i, p);
if (mZ == -1) mZ = p[2];
if (p[2] != mZ) {