[vtkusers] vtkImageReslice and vtkImageResample, different behaviour between 32-bit and 64-bit platform
jimmigoo
jimmigoo at gmail.com
Thu Jan 27 15:17:59 EST 2011
The very strange behaviour is that, if you debug the code,
if you execute this code
void ResampleDTM()
> {
> //------------- open original file ----------------------------------
> vtkStructuredPointsReader* imageReader =
> vtkStructuredPointsReader::New();
> imageReader->SetFileName(“SaintHelene.vtk”);
> imageReader->Update();
[...]
> vtkImageResample * resample = vtkImageResample::New();
> resample->SetInputConnection(0, imageReader->GetOutputPort());
> resample->SetDimensionality(3);
> resample->SetAxisMagnificationFactor(0,1.0);
> resample->SetAxisMagnificationFactor(1,1.0);
> resample->SetAxisMagnificationFactor(2,1.0);
>
> XExtent = (int)((Xmax_new- Xmin_new)/xResolution_new);
> YExtent = (int)((Ymax_new- Ymin_new)/yResolution_new);
>
> resample->SetOutputOrigin(X0_new,Y0_new,0);
> resample->SetOutputExtent(0,XExtent-1,0,YExtent-1,0,0);
> resample->SetAxisOutputSpacing(0, xResolution_new);
> resample->SetAxisOutputSpacing(1, yResolution_new);
> resample->SetAxisOutputSpacing(2, 1);
> resample->Update();
> vtkImageData* map = resample->GetOutput();
without the line you told me in the previous post
(GetArray(0)->SetName("cellvar")).
Analyzing vtkImageData pointer with Visual Studio debugger, I noticed that,
inside
vtkDataSet->PointData->vtkDoubleArray->Array->Memory, all elements are 0
values,
while following imageReader->GetOutput() (vtkImageData) pointer, the same
PointArray
contains valid values. All these behaviour still remains on 64-bit
platforms, while on 32-bit platforms
everything works well.
Any suggests?
--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageReslice-and-vtkImageResample-different-behaviour-between-32-bit-and-64-bit-platform-tp3358830p3360378.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list