X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvAnimatedGIFWriter.cxx;h=0ab7cb806d5c7aa7100ea1e620b73169f3763c2a;hb=76f43aa4f38939f58b05de5c49399b8ce19076cc;hp=8ba0f69062a3b0b2591c79ce409e3ddbcd1bbcf8;hpb=42e16e21ac020e807f7656d570baec84d46e0579;p=clitk.git diff --git a/vv/vvAnimatedGIFWriter.cxx b/vv/vvAnimatedGIFWriter.cxx index 8ba0f69..0ab7cb8 100644 --- a/vv/vvAnimatedGIFWriter.cxx +++ b/vv/vvAnimatedGIFWriter.cxx @@ -1,8 +1,9 @@ #include "vvAnimatedGIFWriter.h" #include "clitkDD.h" -#include "ximagif.h" - +#include +#include +#include #include #include #include @@ -10,6 +11,8 @@ #include #include +#include "ximagif.h" + //--------------------------------------------------------------------------- vtkStandardNewMacro(vvAnimatedGIFWriter); @@ -39,14 +42,25 @@ void vvAnimatedGIFWriter::Start() void vvAnimatedGIFWriter::Write() { // get the data +#if VTK_MAJOR_VERSION <= 5 this->GetInput()->UpdateInformation(); int *wExtent = this->GetInput()->GetWholeExtent(); this->GetInput()->SetUpdateExtent(wExtent); this->GetInput()->Update(); +#else + this->UpdateInformation(); + int *wExtent = this->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()); + this->SetUpdateExtent(wExtent); + this->Update(); +#endif RGBslices.push_back( vtkSmartPointer::New() ); RGBslices.back()->ShallowCopy(this->GetInput()); +#if VTK_MAJOR_VERSION <= 5 RGBvolume->AddInput(RGBslices.back()); +#else + RGBvolume->AddInputData(RGBslices.back()); +#endif } //--------------------------------------------------------------------------- @@ -57,12 +71,20 @@ void vvAnimatedGIFWriter::End() // Quantize to 8 bit colors vtkSmartPointer quant = vtkSmartPointer::New(); quant->SetNumberOfColors(256); +#if VTK_MAJOR_VERSION <= 5 quant->SetInput(RGBvolume->GetOutput()); +#else + quant->SetInputConnection(RGBvolume->GetOutputPort()); +#endif quant->Update(); // Convert to 8 bit image vtkSmartPointer cast = vtkSmartPointer::New(); +#if VTK_MAJOR_VERSION <= 5 cast->SetInput( quant->GetOutput() ); +#else + cast->SetInputConnection( quant->GetOutputPort() ); +#endif cast->SetOutputScalarTypeToUnsignedChar(); cast->Update();