MantisBT - VTK
View Issue Details
0013448VTK(No Category)public2012-09-12 05:512013-04-06 15:34
Dominik Szczerba 
David Gobbi 
urgentminorhave not tried
closedfixed 
 
5.10.1 
TBD
incorrect functionality
0013448: vtkMetaImageWriter does not respect image spacing and always outputs 1/1/1
vtkMetaImageWriter does not respect image spacing and always outputs 1/1/1
No tags attached.
Issue History
2012-09-12 05:51Dominik SzczerbaNew Issue
2012-09-12 09:25Cory QuammenNote Added: 0029189
2012-09-12 14:46Dominik SzczerbaNote Added: 0029190
2012-09-12 14:47Dominik SzczerbaNote Edited: 0029190bug_revision_view_page.php?bugnote_id=29190#r481
2012-09-12 15:20Cory QuammenNote Added: 0029191
2012-09-12 15:33Dominik SzczerbaNote Added: 0029192
2013-02-24 19:19David GobbiAssigned To => David Gobbi
2013-02-24 19:19David GobbiStatusbacklog => tabled
2013-02-24 19:29David GobbiNote Added: 0030378
2013-04-06 15:34David GobbiNote Added: 0030538
2013-04-06 15:34David GobbiStatustabled => closed
2013-04-06 15:34David GobbiResolutionopen => fixed
2013-04-06 15:34David GobbiFixed in Version => 5.10.1

Notes
(0029189)
Cory Quammen   
2012-09-12 09:25   
I'm currently using vtkMetaImageWriter in a project and it does output the correct image spacing. Could you provide a code sample that demonstrates the bug you are observing?
(0029190)
Dominik Szczerba   
2012-09-12 14:46   
(edited on: 2012-09-12 14:47)
Hmmm if I create an artificial example then the spacing is indeed saved properly.
My case is as follows:

vox = vtkMyFilter()
# ...
vox.Update()

image = vox.GetOutput()
print image.GetSpacing()
writer = vtk.vtkMetaImageWriter()
writer.SetFileName(filename2)
writer.SetCompression(1)
writer.SetInput(image)
writer.Write()

image.GetSpacing reports correct spacing, but the one saved into the mhd file is always 1/1/1. If I replace the writer with the vtkXMLImageDataWriter then the spacing written in the vti file is correct. Please advise how to narrow down the hunt.

Dominik

(0029191)
Cory Quammen   
2012-09-12 15:20   
I'm using VTK from master. From your code sample, I can see you are using an older version of VTK. Perhaps there was a bug fixed between versions.

Could you try a new version of VTK and see if the error persists?
(0029192)
Dominik Szczerba   
2012-09-12 15:33   
I am using the latest release version 5.10.0.
(0030378)
David Gobbi   
2013-02-24 19:29   
This was probably fixed by commit 1dfe95d3 on Oct 11, 2012, which is in the 5.10.1 release.
Can the original reporter try VTK 5.10.1 to see if the issue is resolved?
(0030538)
David Gobbi   
2013-04-06 15:34   
Closing because there has been no response from the original reporter and I believe that the problem has been fixed.