vtkSmartPointer< vtkImageLuminance > luminance = vtkSmartPointer< vtkImageLuminance >::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
luminance->SetInput(img);
+#else
+ luminance->SetInputData(img);
+#endif
+
luminance->Update();
vtkSmartPointer< vtkImageAppendComponents > append = vtkSmartPointer< vtkImageAppendComponents >::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
append->SetInput(0, img);
append->SetInput(1, luminance->GetOutput());
+#else
+ append->SetInputData(0, img);
+ append->SetInputData(1, luminance->GetOutput());
+#endif
+
append->Update();
for(unsigned i = 0; i < img->GetNumberOfScalarComponents(); i++){
vectimg.push_back(vtkImageData::New());
- vectimg[i]->SetNumberOfScalarComponents(1);
vectimg[i]->SetExtent(img->GetExtent());
vectimg[i]->SetSpacing(img->GetSpacing());
vectimg[i]->SetOrigin(img->GetOrigin());
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ vectimg[i]->SetNumberOfScalarComponents(1);
vectimg[i]->SetScalarType(img->GetScalarType());
vectimg[i]->AllocateScalars();
+#else
+ vectimg[i]->AllocateScalars(img->GetScalarType(),1);
+#endif
+
}
int *extent = img->GetExtent();
vtkImageData* img = reader->GetOutput();
vtkImageCast* cast = vtkImageCast::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
cast->SetInput(img);
+#else
+ cast->SetInputData(img);
+#endif
+
cast->SetOutputScalarTypeToUnsignedShort();
cast->Update();
//reader->Delete();