Commit 5efcd8d2 authored by David Gobbi's avatar David Gobbi
Browse files

Bug 15934: vtkMetaImageWriter incorrect voxel spacing and origin

The vtkMetaImageWriter's Write() method was getting the spacing and origin
from the input's data object before updating the data object.  As a result,
an incorrect spacing and origin was written to the file header.
parent 1a04e8a1
......@@ -111,6 +111,12 @@ void vtkMetaImageWriter::Write( )
}
}
vtkStreamingDemandDrivenPipeline::SetUpdateExtent(
this->GetInputInformation(0, 0), ext);
vtkDemandDrivenPipeline::SafeDownCast(
this->GetInputExecutive(0, 0))->UpdateData(
this->GetInputConnection(0, 0)->GetIndex());
double origin[3];
double spacingDouble[3];
this->GetInput()->GetOrigin(origin);
......@@ -153,11 +159,6 @@ void vtkMetaImageWriter::Write( )
int numberOfElements = this->GetInput()->GetNumberOfScalarComponents();
vtkStreamingDemandDrivenPipeline::SetUpdateExtent(
this->GetInputInformation(0, 0), ext);
vtkDemandDrivenPipeline::SafeDownCast(
this->GetInputExecutive(0, 0))->UpdateData(
this->GetInputConnection(0, 0)->GetIndex());
this->MetaImagePtr->InitializeEssential( nDims,
dimSize,
spacing,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment