Hello Bill,<br>&nbsp;&nbsp;&nbsp; <br><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font size="2">&nbsp; 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-&gt;m_read-&gt;GetOutput()-&gt;GlobalReleaseDataFlagOn();<br><br>I set the &ldquo;global flag&rdquo; instead of &ldquo;object flag&ldquo; 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: &quot;Times New Roman&quot;;" 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&nbsp; there was nothing in the render window. So i thought the solution can&#39;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&nbsp; 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&nbsp; 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">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</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]-&gt;ReleaseDataFlagOn();<br>
vdeci[numIndex]-&gt;ReleaseDataFlagOn();<br>
vsmoother[numIndex]-&gt;ReleaseDataFlagOn();<br>
vskinNormal[numIndex]-&gt;ReleaseDataFlagOn();<br>
<br>
These will release the data downstream in the pipeline. Since you are<br>
not changing any of the filter&#39;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]-&gt;ComputeNormalsOff();<br>
vskinExtractor[numIndex]-&gt;ComputeGradientsOff();<br>
vskinExtractor[numIndex]-&gt;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, ÖìÎÄÎä &lt;<a href="mailto:cool.wenwu@gmail.com">cool.wenwu@gmail.com</a>&gt; wrote:<br>
&gt; Hello all&nbsp; in mailing list,<br>
&gt;<br>
&gt; The develop tool of&nbsp; my application are VC6.0 + vtk5.1. And I&#39;d&nbsp; appreciate<br>
&gt; any advice to help me to soleve the problem.<br>
&gt;<br>
&gt; The state of mine is that when i use MC to reconstruct , and select one<br>
&gt; single contour value,&nbsp; the number of image is 200(bmp: 329*354). of coucse ,<br>
&gt; the app is sucessfully executing!<br>
&gt; However, i&#39;d like to reconstuct multi-isosurface. In addition, i hope the<br>
&gt; app can control property of each isosurface(vtkactor*). So I use<br>
&gt; multi-pipeline to reconstruct,each actor has private pipeline, but the<br>
&gt; result is error when there are many contour values ,for example the number<br>
&gt; of contour values is 4 , the main code and relevant information as follows:<br>
&gt;<br>
&gt; // the data set is bmp: 329*354*350<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp; std::vector&lt;vtkMarchingCubes*&gt; vskinExtractor;<br>
&gt; &nbsp;&nbsp;&nbsp; std::vector&lt;vtkDecimatePro*&gt; vdeci;//<br>
&gt; &nbsp;&nbsp;&nbsp; std::vector&lt;vtkSmoothPolyDataFilter*&gt; vsmoother;//<br>
&gt; &nbsp;&nbsp;&nbsp; std::vector&lt;vtkPolyDataNormals*&gt; vskinNormal;//<br>
&gt; &nbsp;&nbsp;&nbsp; std::vector&lt;vtkPolyDataMapper*&gt; vskinMapper;//<br>
&gt; &nbsp;&nbsp;&nbsp; std::vector&lt;vtkActor*&gt; vskin;<br>
&gt;<br>
&gt; //y is the number of the scalar value, here is 4<br>
&gt; &nbsp;&nbsp;&nbsp; for (size_t numIndex = 0; numIndex &lt; y; numIndex++)<br>
&gt; &nbsp;&nbsp;&nbsp; {<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskinExtractor.push_back(vtkMarchingCubes::New());<br>
&gt;<br>
&gt; vskinExtractor[numIndex]-&gt;SetInputConnection(m_read-&gt;GetOutputPort());<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskinExtractor[numIndex]-&gt;SetValue(numIndex, vYuzhi[numIndex]);<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vdeci.push_back(vtkDecimatePro::New());<br>
&gt;<br>
&gt; vdeci[numIndex]-&gt;SetInputConnection(vskinExtractor[numIndex]-&gt;GetOutputPort());//<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vdeci[numIndex]-&gt;SetTargetReduction(0.5);//<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vdeci[numIndex]-&gt;PreserveTopologyOn();//<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vsmoother.push_back(vtkSmoothPolyDataFilter::New());<br>
&gt;<br>
&gt; vsmoother[numIndex]-&gt;SetInputConnection(vdeci[numIndex]-&gt;GetOutputPort());//<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vsmoother[numIndex]-&gt;SetNumberOfIterations(800);//Specify the number<br>
&gt; of iterations for Laplacian smoothing<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskinNormal.push_back(vtkPolyDataNormals::New());<br>
&gt;<br>
&gt; vskinNormal[numIndex]-&gt;SetInputConnection(vsmoother[numIndex]-&gt;GetOutputPort());//<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskinNormal[numIndex]-&gt;SetFeatureAngle(60.0);//<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskinMapper.push_back(vtkPolyDataMapper::New());<br>
&gt;<br>
&gt; vskinMapper[numIndex]-&gt;SetInputConnection(vskinNormal[numIndex]-&gt;GetOutputPort());<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskinMapper[numIndex]-&gt;ScalarVisibilityOff();<br>
&gt;<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskin.push_back(vtkActor::New());<br>
&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vskin[numIndex]-&gt;SetMapper(vskinMapper[numIndex]);<br>
&gt; &nbsp;&nbsp;&nbsp; }<br>
&gt;<br>
&gt;<br>
&gt; After the app&nbsp; executing&nbsp; dozens of minutes, the vtkOutputWindow output<br>
&gt; error messages:<br>
&gt; Error:in c:\vtk5.0\vtk\common\vtkDataArrayTemplate.cxx line 255<br>
&gt; vtkIdTypeArray(0x...):unable to allocate 62300005 elements of size 2<br>
&gt;<br>
&gt; In my opinion,may be the reason&nbsp; is that&nbsp; data is too large or there are<br>
&gt; generating too many meshes while MC&nbsp;&nbsp; extracting isosurface, but i do not<br>
&gt; know how to solve it!<br>
&gt; I alse lookup information in &quot;VTK FAQ&quot; in KitWare web, and the solution<br>
&gt; can&#39;t fit my problem. Thanks for any help!!<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br><br>