Hello Bill,<br> <br><font size="2"> </font><font size="2"> thank you very much ! In fact, the solution you metioned</font> i once tested, but i set the flag<br>of vtkBMPReader object. The relevant code as follows:<br>
<br>vtkBMPReader * m_read = vtkBMPReader::New();<br>......<br>this->m_read->GetOutput()->GlobalReleaseDataFlagOn();<br><br>I set the “global flag” instead of “object flag“ due to the explanation in the VTK FAQ£º<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///D:%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><style>
<!--
/* Font Definitions */
@font-face
        {font-family:ËÎÌå;
        panose-1:2 1 6 0 3 1 1 1 1 1;
        mso-font-alt:SimSun;
        mso-font-charset:134;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
        {font-family:"\@ËÎÌå";
        panose-1:2 1 6 0 3 1 1 1 1 1;
        mso-font-charset:134;
        mso-generic-font-family:auto;
        mso-font-pitch:variable;
        mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        mso-pagination:none;
        font-size:10.5pt;
        mso-bidi-font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:ËÎÌå;
        mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
        {mso-page-border-surround-header:no;
        mso-page-border-surround-footer:no;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-</style><span style="font-size: 10.5pt; font-family: "Times New Roman";" lang="EN-US"><br><br>if GlobalReleaseDataFlag is set on ANY data object, all data objects
will release their memory once their dependent filter has finished executing.</span><br><br>The result you can guess the there was nothing in the render window. So i thought the solution can't work£¬then i turened to mail list for help !..... <br>
Just now I take your idea for practice, and the performance of app improved greatly. I can gain satisfied result when the data set is 329*354*350, and the number of contour values is three. But when the data set is 329*354*500, and the number of contour values increased to <br>
8£¬the memory error is appearing again.<br>Now i have no idea to improve the app further. In short, my problem is as follows:<br>1¡¢How to manage memory when the data is <strong style="font-weight: normal;">augment</strong>ing£¿for example£º329*354*500£¬and contour value is 8 or more¡£<br>
2¡¢May be my architecture of generating multi-actor is not suitable£¬ could any one provide more efficient code or idea to help me£¿<br><br><span class="keyword">Additional</span><span class="pronounce"> </span>£¬there is 8 GB physical memory and 4 processors in workstation£¡<br>
<br>Thanks All£¡<br><br><br><div class="gmail_quote">2009/11/14 Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Wenwu,<br>
<br>
You can reduce memory usage in the pipeline using:<br>
vskinExtractor[numIndex]->ReleaseDataFlagOn();<br>
vdeci[numIndex]->ReleaseDataFlagOn();<br>
vsmoother[numIndex]->ReleaseDataFlagOn();<br>
vskinNormal[numIndex]->ReleaseDataFlagOn();<br>
<br>
These will release the data downstream in the pipeline. Since you are<br>
not changing any of the filter's states, this should help.<br>
<br>
Also, you can suppress the generation of normals and scalars by<br>
marching cubes since you are creating new ones later in the pipeline:<br>
vskinExtractor[numIndex]->ComputeNormalsOff();<br>
vskinExtractor[numIndex]->ComputeGradientsOff();<br>
vskinExtractor[numIndex]->ComputeScalarsOff();<br>
<br>
See if these changes reduce your memory. There are other techniques<br>
that can still be applied, but try these first.<br>
<br>
Bill<br>
<div><div></div><div class="h5"><br>
<br>
On Fri, Nov 13, 2009 at 9:59 AM, ÖìÎÄÎä <<a href="mailto:cool.wenwu@gmail.com">cool.wenwu@gmail.com</a>> wrote:<br>
> Hello all in mailing list,<br>
><br>
> The develop tool of my application are VC6.0 + vtk5.1. And I'd appreciate<br>
> any advice to help me to soleve the problem.<br>
><br>
> The state of mine is that when i use MC to reconstruct , and select one<br>
> single contour value, the number of image is 200(bmp: 329*354). of coucse ,<br>
> the app is sucessfully executing!<br>
> However, i'd like to reconstuct multi-isosurface. In addition, i hope the<br>
> app can control property of each isosurface(vtkactor*). So I use<br>
> multi-pipeline to reconstruct,each actor has private pipeline, but the<br>
> result is error when there are many contour values ,for example the number<br>
> of contour values is 4 , the main code and relevant information as follows:<br>
><br>
> // the data set is bmp: 329*354*350<br>
><br>
> std::vector<vtkMarchingCubes*> vskinExtractor;<br>
> std::vector<vtkDecimatePro*> vdeci;//<br>
> std::vector<vtkSmoothPolyDataFilter*> vsmoother;//<br>
> std::vector<vtkPolyDataNormals*> vskinNormal;//<br>
> std::vector<vtkPolyDataMapper*> vskinMapper;//<br>
> std::vector<vtkActor*> vskin;<br>
><br>
> //y is the number of the scalar value, here is 4<br>
> for (size_t numIndex = 0; numIndex < y; numIndex++)<br>
> {<br>
> vskinExtractor.push_back(vtkMarchingCubes::New());<br>
><br>
> vskinExtractor[numIndex]->SetInputConnection(m_read->GetOutputPort());<br>
> vskinExtractor[numIndex]->SetValue(numIndex, vYuzhi[numIndex]);<br>
><br>
> vdeci.push_back(vtkDecimatePro::New());<br>
><br>
> vdeci[numIndex]->SetInputConnection(vskinExtractor[numIndex]->GetOutputPort());//<br>
> vdeci[numIndex]->SetTargetReduction(0.5);//<br>
> vdeci[numIndex]->PreserveTopologyOn();//<br>
><br>
> vsmoother.push_back(vtkSmoothPolyDataFilter::New());<br>
><br>
> vsmoother[numIndex]->SetInputConnection(vdeci[numIndex]->GetOutputPort());//<br>
> vsmoother[numIndex]->SetNumberOfIterations(800);//Specify the number<br>
> of iterations for Laplacian smoothing<br>
><br>
> vskinNormal.push_back(vtkPolyDataNormals::New());<br>
><br>
> vskinNormal[numIndex]->SetInputConnection(vsmoother[numIndex]->GetOutputPort());//<br>
> vskinNormal[numIndex]->SetFeatureAngle(60.0);//<br>
><br>
> vskinMapper.push_back(vtkPolyDataMapper::New());<br>
><br>
> vskinMapper[numIndex]->SetInputConnection(vskinNormal[numIndex]->GetOutputPort());<br>
> vskinMapper[numIndex]->ScalarVisibilityOff();<br>
><br>
> vskin.push_back(vtkActor::New());<br>
> vskin[numIndex]->SetMapper(vskinMapper[numIndex]);<br>
> }<br>
><br>
><br>
> After the app executing dozens of minutes, the vtkOutputWindow output<br>
> error messages:<br>
> Error:in c:\vtk5.0\vtk\common\vtkDataArrayTemplate.cxx line 255<br>
> vtkIdTypeArray(0x...):unable to allocate 62300005 elements of size 2<br>
><br>
> In my opinion,may be the reason is that data is too large or there are<br>
> generating too many meshes while MC extracting isosurface, but i do not<br>
> know how to solve it!<br>
> I alse lookup information in "VTK FAQ" in KitWare web, and the solution<br>
> can't fit my problem. Thanks for any help!!<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br><br>