[vtkusers] memory allocate problem of multi-iso reconstruction(large data)

朱文武 cool.wenwu at gmail.com
Fri Nov 13 09:59:36 EST 2009


Hello all  in mailing list,

The develop tool of  my application are VC6.0 + vtk5.1. And I'd  appreciate
any advice to help me to soleve the problem.

The state of mine is that when i use MC to reconstruct , and select one
single contour value,  the number of image is 200(bmp: 329*354). of coucse ,
the app is sucessfully executing!
However, i'd like to reconstuct multi-isosurface. In addition, i hope the
app can control property of each isosurface(vtkactor*). So I use
multi-pipeline to reconstruct,each actor has private pipeline, but the
result is error when there are many contour values ,for example the number
of contour values is 4 , the main code and relevant information as follows:

// the data set is bmp: 329*354*350

    std::vector<vtkMarchingCubes*> vskinExtractor;
    std::vector<vtkDecimatePro*> vdeci;//
    std::vector<vtkSmoothPolyDataFilter*> vsmoother;//
    std::vector<vtkPolyDataNormals*> vskinNormal;//
    std::vector<vtkPolyDataMapper*> vskinMapper;//
    std::vector<vtkActor*> vskin;

//y is the number of the scalar value, here is 4
    for (size_t numIndex = 0; numIndex < y; numIndex++)
    {
        vskinExtractor.push_back(vtkMarchingCubes::New());

vskinExtractor[numIndex]->SetInputConnection(m_read->GetOutputPort());
        vskinExtractor[numIndex]->SetValue(numIndex, vYuzhi[numIndex]);

        vdeci.push_back(vtkDecimatePro::New());

vdeci[numIndex]->SetInputConnection(vskinExtractor[numIndex]->GetOutputPort());//
        vdeci[numIndex]->SetTargetReduction(0.5);//
        vdeci[numIndex]->PreserveTopologyOn();//

        vsmoother.push_back(vtkSmoothPolyDataFilter::New());

vsmoother[numIndex]->SetInputConnection(vdeci[numIndex]->GetOutputPort());//
        vsmoother[numIndex]->SetNumberOfIterations(800);//Specify the number
of iterations for Laplacian smoothing

        vskinNormal.push_back(vtkPolyDataNormals::New());

vskinNormal[numIndex]->SetInputConnection(vsmoother[numIndex]->GetOutputPort());//
        vskinNormal[numIndex]->SetFeatureAngle(60.0);//

        vskinMapper.push_back(vtkPolyDataMapper::New());

vskinMapper[numIndex]->SetInputConnection(vskinNormal[numIndex]->GetOutputPort());
        vskinMapper[numIndex]->ScalarVisibilityOff();

        vskin.push_back(vtkActor::New());
        vskin[numIndex]->SetMapper(vskinMapper[numIndex]);
    }


After the app  executing  dozens of minutes, the vtkOutputWindow output
error messages:
Error:in c:\vtk5.0\vtk\common\vtkDataArrayTemplate.cxx line 255
vtkIdTypeArray(0x...):unable to allocate 62300005 elements of size 2

In my opinion,may be the reason  is that  data is too large or there are
generating too many meshes while MC   extracting isosurface, but i do not
know how to solve it!
I alse lookup information in "VTK FAQ" in KitWare web, and the solution
can't fit my problem. Thanks for any help!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091113/0672029c/attachment.htm>


More information about the vtkusers mailing list