[vtkusers] Sudden VTK error after recent Windows Update KB958869
Thomas Zhang
tzhang at xradia.com
Sun Oct 18 23:29:05 EDT 2009
========================================
Hello: I posted a similar question some time ago and got no response. Since then I have found a workaround to solve my problem.
But on Oct 13, 2009, Microsoft pushed a Windows update for KB958869. All the sudden my workaround failed to work. The MS update changed the Windows GdiPlus.dll file to prevent centain buffer overrun issues.
Can anyone please help?
Here is the code that gives the problem. It is 2D image rotating with vtkImageReslice and vtkTransform.
If you try the code, it works just fine! The problem is, we are using the code in the same application that uses a 3rd party library utilizing DirectX hardware acceleration. After we initialize the DirectX based library, the code below would fail with nDim[0]==1. Once we comment the 3rd party library, the code would work perfect as expected.
vtkImageData *pvtkImageData1;
pvtkImageData1= vtkImageData::New();
pvtkImageData1->SetDimensions(nOriginalWidth,nOriginalHeight,1);
pvtkImageData1->SetScalarTypeToFloat();
pvtkImageData1->SetNumberOfScalarComponents(1);
//here, need to put image data in pvtkImageData1. Size is
//nOriginalWidthXnOriginalHeight
vtkTransform *pTransForm = vtkTransform::New();
pTransForm->Identity();
pTransForm->RotateZ(fAngle);
vtkImageReslice *pImageReslice = vtkImageReslice::New();
pImageReslice->SetOutputDimensionality(2);
pImageReslice->SetResliceAxesDirectionCosines(1,0,0,0,1,0,0,0,1);
pImageReslice->SetResliceTransform(pTransForm);
pImageReslice->SetInput(pvtkImageData1);
vtkImageChangeInformation* centering =vtkImageChangeInformation::New();
centering->SetInput(pvtkImageData1);
centering->CenterImageOn();
pImageReslice->SetInput(centering->GetOutput());
pImageReslice->SetResliceAxesOrigin(0,0,0);
pImageReslice->SetOutputExtentToDefault();
pImageReslice->GetOutput()->SetUpdateExtentToWholeExtent();
pImageReslice->Update();
pImageReslice->GetOutput()->Update();
vtkImageData *pvtkOutImageData = pImageReslice->GetOutput();
int nDim[3];
pvtkOutImageData->GetDimensions(nDim);
//===================Error===========================
//at this point the nDim[0] return 1, which is wrong.
//nDim[0] should be at least nOriginalWidth.
Thanks!
Thomas
________________________________
The information in this email, including any attachments, is confidential and intended only for the recipient(s) listed. Any use of this email for any other purpose is prohibited. If you have received this email in error, please notify me immediately by reply email, delete this email, and do not disclose its contents to anyone.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091018/dbd5926b/attachment.htm>
More information about the vtkusers
mailing list