View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001128VTK(No Category)public2004-09-02 12:382016-08-12 09:54
Reporterminnus 
Assigned ToCharles Law 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
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);
resample->Update();
resample->UpdateWholeExtent();
resample->GetOutput()->Update();

int dims[3];
resample->GetOutput()->GetDimensions(dims);
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.

Thanks.

Martins
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0001407)
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.SetDataByteOrderToLittleEndian()
v16.SetFilePrefix(VTK_DATA_ROOT + "/Data/headsq/quarter")
v16.SetImageRange(1, 93)
v16.SetDataSpacing(3.2, 3.2, 1.5)
v16.Update()

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)
resample.Update();

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

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:

http://public.kitware.com/pipermail/vtkusers/2004-May/073744.html [^]
http://public.kitware.com/pipermail/vtkusers/2002-July/061960.html [^]
 
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.

Martins
(0001860)
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.
(0036749)
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 - 2018 MantisBT Team