View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001128VTK(No Category)public2004-09-02 12:382016-08-12 09:54
Assigned ToCharles Law 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001128: vtkImageResample produces incorrect extents
Descriptioninput is a 128x128x64 image (extents 0-127,0-127,0-63), if I do the folowing:

resample->SetAxisMagnificationFactor(0, 4);
resample->SetAxisMagnificationFactor(1, 4);

int dims[3];
resample->GetOutput()->Print( cout );
cout<<"Dims: "<<dims[0]<<", "<<dims[1]<<endl;

dims[0] and dims[1] contain "509" and the Print shows extents of 0-508 for the x and y direction.

Expected results are dims of 512 and extents 0-511

the problem appears to be in the "wholeMax" calculation of the ExecuteInformation function.


TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
Mathieu Malaterre (developer)
2004-09-02 13:07

Adding complete test:

import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

v16 = vtk.vtkVolume16Reader()
v16.SetDataDimensions(64, 64)
v16.SetFilePrefix(VTK_DATA_ROOT + "/Data/headsq/quarter")
v16.SetImageRange(1, 93)
v16.SetDataSpacing(3.2, 3.2, 1.5)

print v16.GetOutput().GetDimensions()

print "Multiplying x,y by 4"

resample = vtk.vtkImageResample()
resample.SetInput( v16.GetOutput() )
resample.SetAxisMagnificationFactor(0, 4)
resample.SetAxisMagnificationFactor(1, 4)

print resample.GetOutput().GetDimensions()
print resample.GetOutput().GetExtent()

2004-09-14 15:13

Well, I tried looking into this myself but it looks like the problem is related to the following reported earlier: [^] [^]
Has there been any discussion on changing this in an upcoming release? I understand it would be a pretty big internal change, but it seems unintuitive currently. Thanks.

David Gobbi (developer)
2005-01-06 11:40

I think the current behaviour is correct. If an image is 128x128, then the distance from the first pixel to the last pixel is 127. Multiplying by four gives 508, so the output image should have an extent of [0,508].

If a 512x512 image is needed, then don't use vtkImageResample. Instead, use vtkImageReslice and set the OutputSpacing and OutputExtent appropriately.
Kitware Robot (administrator)
2016-08-12 09:54

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.

- Issue History
Date Modified Username Field Change
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2016-08-12 09:54 Kitware Robot Note Added: 0036749
2016-08-12 09:54 Kitware Robot Status expired => closed
2016-08-12 09:54 Kitware Robot Resolution open => moved

Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker