X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvtkVOXImageWriter.cxx;h=b703e96b4d5da7436ff024654d292c3936924837;hb=769d159c09a35005afb6934fae83843f0b116d36;hp=4d7c92cc63b1f25fb3b7f4685c1e65dace9ecffb;hpb=573d80d0f7a17607d2ee883c21c940c0ba020282;p=clitk.git diff --git a/vv/vtkVOXImageWriter.cxx b/vv/vtkVOXImageWriter.cxx index 4d7c92c..b703e96 100644 --- a/vv/vtkVOXImageWriter.cxx +++ b/vv/vtkVOXImageWriter.cxx @@ -28,13 +28,12 @@ #include "vtkObjectFactory.h" #include "vtkStreamingDemandDrivenPipeline.h" #include "vtkDataSetAttributes.h" - -#include +#include +#include #include //---------------------------------------------------------------------------- -vtkCxxRevisionMacro(vtkVOXImageWriter, "DummyRevision"); vtkStandardNewMacro(vtkVOXImageWriter); //---------------------------------------------------------------------------- @@ -55,9 +54,11 @@ vtkVOXImageWriter::~vtkVOXImageWriter() void vtkVOXImageWriter::Write( ) { this->SetErrorCode(vtkErrorCode::NoError); - +#if VTK_MAJOR_VERSION <= 5 this->GetInput()->UpdateInformation(); - +#else + this->UpdateInformation(); +#endif // Error checking if (this->GetInput() == NULL ) { vtkErrorMacro(<<"Write:Please specify an input!"); @@ -70,7 +71,11 @@ void vtkVOXImageWriter::Write( ) } int nDims = 3; +#if VTK_MAJOR_VERSION <= 5 int * ext = this->GetInput()->GetWholeExtent(); +#else + int * ext = this->GetInformation()->Get(vtkDataObject::DATA_EXTENT()); +#endif if ( ext[4] == ext[5] ) { nDims = 2; if ( ext[2] == ext[3] ) { @@ -134,12 +139,18 @@ void vtkVOXImageWriter::Write( ) origin[1] += ext[2] * spacing[1]; origin[2] += ext[4] * spacing[2]; +#if VTK_MAJOR_VERSION <= 5 this->GetInput()->SetUpdateExtent(ext[0], ext[1], ext[2], ext[3], ext[4], ext[5]); this->GetInput()->UpdateData(); - - +#elif VTK_MAJOR_VERSION >= 8 || (VTK_MAJOR_VERSION == 7 && VTK_MINOR_VERSION >= 1) + this->UpdateExtent(ext); + this->Update(); +#else + this->SetUpdateExtent(ext); + this->Update(); +#endif this->SetFileDimensionality(nDims); this->InvokeEvent(vtkCommand::StartEvent);