MantisBT - VTK
View Issue Details
0011193VTK(No Category)public2010-08-31 08:462016-08-12 09:55
Gerald Lodron 
Kitware Robot 
normalmajoralways
closedmoved 
 
 
0011193: Wrong origin in vtkImageCast on vtkImageData
When i have a 3D vtkImageData with origin not equal to 0,0,0 the vtkImageCast returns an output with origin 0,0,0!

Here my code:

std::cout << "Input 1" << std::endl;
std::cout << " Origin: " << oInput1->GetOrigin()[0] << " " << oInput1->GetOrigin()[1] << " " << oInput1->GetOrigin()[2] << std::endl;
//Original Origin which is not 0,0,0
 
vtkSmartPointer<vtkImageCast> oInputCaster1 = vtkImageCast::New();
oInputCaster1->ReleaseDataFlagOn();
oInputCaster1->SetInput(oInput1);
oInputCaster1->SetOutputScalarTypeToShort();
oInputCaster1->Update();

std::cout << "Input caster 1" << std::endl;
std::cout << " Origin: " << oInputCaster1->GetOutput()->GetOrigin()[0] << " " << oInputCaster1->GetOutput()->GetOrigin()[1] << " " << oInputCaster1->GetOutput()->GetOrigin()[2] << std::endl;
//Origin is 0,0,0!
              
vtkSmartPointer<vtkImageChangeInformation> oOrigin1 = vtkImageChangeInformation::New();
oOrigin1->SetInput(oInputCaster1->GetOutput());
oOrigin1->ReleaseDataFlagOn();
oOrigin1->SetOutputOrigin(oInput1->GetOrigin());
oOrigin1->Update();
               
std::cout << "Origin changer 1" << std::endl; std::cout << " Origin: " << oOrigin1->GetOutput()->GetOrigin()[0] << " " << oOrigin1->GetOutput()->GetOrigin()[1] << " " << oOrigin1->GetOutput()->GetOrigin()[2] << std::endl;
//Origin is correct
No tags attached.
Issue History
2010-08-31 08:46Gerald LodronNew Issue
2010-10-13 00:44Gerald LodronNote Added: 0022488
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:55Kitware RobotNote Added: 0037199
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0022488)
Gerald Lodron   
2010-10-13 00:44   
ok, it seems that i forget to call the update before printing....
sorry, how can i close this bug?
(0037199)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.