X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvAnimatedGIFWriter.cxx;h=026ebe091dd877b5f3547d6c1f6f6df85e2153f9;hb=41796e945c3027937cedda97d1762bc0a5193c3c;hp=1efd50dcc1cc5f27be12899c980d41815be88587;hpb=abdae5f22ecae40608e0279729108b428c9dbc62;p=clitk.git diff --git a/vv/vvAnimatedGIFWriter.cxx b/vv/vvAnimatedGIFWriter.cxx index 1efd50d..026ebe0 100644 --- a/vv/vvAnimatedGIFWriter.cxx +++ b/vv/vvAnimatedGIFWriter.cxx @@ -1,6 +1,9 @@ #include "vvAnimatedGIFWriter.h" #include "clitkDD.h" +#include +#include +#include #include #include #include @@ -39,14 +42,30 @@ 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(); +#elif VTK_MAJOR_VERSION >= 7 && VTK_MINOR_VERSION >= 1 + this->UpdateInformation(); + int *wExtent = this->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()); + this->UpdateExtent(wExtent); + this->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 +76,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();