Hello Steiner <span dir="ltr">,</span>thank you  <span dir="ltr"></span>very much at first! If my undestanding is right,your code may be very suitable to catch exception! I will learn it !<br>However, the key problem of my app  may not the bug, but how to manage memory more efficiently !<br>
<br><br><br><div class="gmail_quote">2009/11/14 Dipl.-Ing. Helmut Steiner <span dir="ltr">&lt;<a href="mailto:office@shl.at">office@shl.at</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;">










<div link="blue" vlink="purple" lang="DE-AT">

<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hello user cool.wenwu!</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">You are low on memory, try to encapsulate vtk calls with try
catch blocks.</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Something like this:</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">      CDlgBAPMessageWarn dlgwarn;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">      <span style="color: blue;">try</span> </span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">      </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">{</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            m_p3DRSurfExtractor-&gt;SetInput(pexVoi-&gt;GetOutput());</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            <span style="color: green;">//m_p3DRSurfExtractor-&gt;GenerateValues(2, contourRange);</span></span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            m_p3DRSurfExtractor-&gt;SetValue(0,(<span style="color: blue;">double</span>) surfpegel);</span></p>


<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            <span style="color: green;">//m_p3DRSurfExtractor-&gt;SetValue(0, dval-0.5);</span></span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            m_p3DRSurfExtractor-&gt;ComputeScalarsOff();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            m_p3DRSurfExtractor-&gt;ComputeNormalsOn();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            VtkObserverProgressContour
*contourProgress =
VtkObserverProgressContour::New(pParentVolume-&gt;m_p3DRStatusText-&gt;GetTextMapper(),
pParentVolume-&gt;m_p3DRIren, <span style="color: rgb(163, 21, 21);">&quot;Contour
Progress&quot;</span>);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            m_p3DRSurfExtractor-&gt;AddObserver(vtkCommand::ProgressEvent,
contourProgress);</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            contourProgress-&gt;Delete();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            m_p3DRSurfExtractor-&gt;Update();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">      }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">      <span style="color: blue;">catch</span> (std::exception <span style="color: blue;">const</span>
&amp;err)</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">      {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.mstrHeader
= CConstTxt::BAP_MSG_HEAD_054 [theApp.iLanguage];</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.mstrLine1 
= CConstTxt::BAP_MSG_LIN1_054 [theApp.iLanguage];</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.mstrLine2 
= CConstTxt::BAP_MSG_LIN2_054 [theApp.iLanguage];</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.DoModal();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            pexVoi-&gt;Delete();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            <span style="color: blue;">return</span> <span style="color: blue;">false</span>;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">      }</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">      <span style="color: blue;">catch</span> (...)</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">      {</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.mstrHeader
= CConstTxt::BAP_MSG_HEAD_054 [theApp.iLanguage];</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.mstrLine1 
= CConstTxt::BAP_MSG_LIN1_054 [theApp.iLanguage];</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.mstrLine2 
= CConstTxt::BAP_MSG_LIN2_054 [theApp.iLanguage];</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            dlgwarn.DoModal();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            pexVoi-&gt;Delete();</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">            <span style="color: blue;">return</span> <span style="color: blue;">false</span>;</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">      </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">}</span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">      pexVoi-&gt;Delete();</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Mfg</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US">Helmut Steiner</span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>

<div>

<div>

<div>

<div>

<div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);" lang="EN-US"> </span></p>

<p class="MsoNormal"><span style="font-size: 11pt; color: black;"><img src="" alt="cid:image001.jpg@01C9D5CC.9F177890" height="45" width="207"></span><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>

<p class="MsoNormal"><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(31, 73, 125);" lang="EN-GB">*********************************************************<br>
* SHL - Solutions for Healthcare and Life-Sciences GmbH *<br>
* Bahnstraße 58,  A-3481 Fels am Wagram,
 Österreich    *<br>
* Firmenbuch Nr.: 276073 s   
                         
*<br>
* Web:</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: maroon;" lang="EN-GB">  </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"> </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="DE"><a href="http://www.shl.at/" title="blocked::http://www.shl.at/" target="_blank"><span style="color: blue;" lang="EN-GB">www.shl.at</span></a></span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: rgb(31, 73, 125);" lang="EN-GB">
                                    *<br>
* </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">Email: </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="DE"><a href="mailto:office@shl.at" title="blocked::mailto:office@shl.at" target="_blank"><span style="color: blue;" lang="EN-GB">office@shl.at</span></a></span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">           
                      *<br>
*********************************************************</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB"><br>
</span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-GB">* DISCLAIMER                                           
*<br>
* This eMail may contain confidential and/or            *<br>
* privileged information. If you are not the            *<br>
* intended recipient (or have received this eMail       *<br>
* in error) please notify the sender immediately        *<br>
* and destroy this eMail. Any
unauthorised              *<br>
* copying, disclosure or distribution of the            *<br>
* material in this eMail is strictly forbidden.         </span><span style="font-size: 8pt; font-family: &quot;Courier New&quot;; color: black;" lang="DE">*<br>
*********************************************************</span><span style="color: black;" lang="DE"></span></p>

</div>

</div>

</div>

</div>

</div>

<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>

<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">

<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="DE">Von:</span></b><span style="font-size: 10pt;" lang="DE">
<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a> [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>] <b>Im Auftrag von </b>???<br>
<b>Gesendet:</b> Freitag, 13. November 2009 16:00<br>
<b>An:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Betreff:</b> [vtkusers] memory allocate problem of multi-iso
reconstruction(large data)</span></p>

</div><div><div></div><div class="h5">

<p class="MsoNormal"> </p>

<p class="MsoNormal">Hello all  in mailing list,<br>
<br>
The develop tool of  my application are VC6.0 + vtk5.1. And I&#39;d 
appreciate 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 single
contour value,  the number of image is 200(bmp: 329*354). of coucse , the
app is sucessfully executing!<br>
However, i&#39;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:<br>
<br>
// the data set is bmp: 329*354*350<br>
<br>
    std::vector&lt;vtkMarchingCubes*&gt; vskinExtractor;<br>
    std::vector&lt;vtkDecimatePro*&gt; vdeci;//<br>
    std::vector&lt;vtkSmoothPolyDataFilter*&gt; vsmoother;//<br>
    std::vector&lt;vtkPolyDataNormals*&gt; vskinNormal;//<br>
    std::vector&lt;vtkPolyDataMapper*&gt; vskinMapper;//<br>
    std::vector&lt;vtkActor*&gt; vskin;<br>
    <br>
//y is the number of the scalar value, here is 4<br>
    for (size_t numIndex = 0; numIndex &lt; y; numIndex++)<br>
    {<br>
        vskinExtractor.push_back(vtkMarchingCubes::New());<br>
       
vskinExtractor[numIndex]-&gt;SetInputConnection(m_read-&gt;GetOutputPort());<br>
       
vskinExtractor[numIndex]-&gt;SetValue(numIndex, vYuzhi[numIndex]);<br>
<br>
        vdeci.push_back(vtkDecimatePro::New());<br>
        vdeci[numIndex]-&gt;SetInputConnection(vskinExtractor[numIndex]-&gt;GetOutputPort());//<br>
       
vdeci[numIndex]-&gt;SetTargetReduction(0.5);//<br>
       
vdeci[numIndex]-&gt;PreserveTopologyOn();//<br>
<br>
       
vsmoother.push_back(vtkSmoothPolyDataFilter::New());<br>
        vsmoother[numIndex]-&gt;SetInputConnection(vdeci[numIndex]-&gt;GetOutputPort());//<br>
       
vsmoother[numIndex]-&gt;SetNumberOfIterations(800);//Specify the number of
iterations for Laplacian smoothing<br>
<br>
       
vskinNormal.push_back(vtkPolyDataNormals::New());<br>
        vskinNormal[numIndex]-&gt;SetInputConnection(vsmoother[numIndex]-&gt;GetOutputPort());//<br>
       
vskinNormal[numIndex]-&gt;SetFeatureAngle(60.0);//<br>
<br>
       
vskinMapper.push_back(vtkPolyDataMapper::New());<br>
       
vskinMapper[numIndex]-&gt;SetInputConnection(vskinNormal[numIndex]-&gt;GetOutputPort());<br>
       
vskinMapper[numIndex]-&gt;ScalarVisibilityOff();<br>
        <br>
        vskin.push_back(vtkActor::New());<br>
       
vskin[numIndex]-&gt;SetMapper(vskinMapper[numIndex]);   
    <br>
    }<br>
<br>
<br>
After the app  executing  dozens of minutes, the vtkOutputWindow
output 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 generating too many meshes while MC   extracting isosurface, but
i do not know how to solve it!<br>
I alse lookup information in &quot;VTK FAQ&quot; in KitWare web, and the
solution can&#39;t fit my problem. Thanks for any help!!<br clear="all">
</p>

</div></div></div>

</div>


</blockquote></div><br><br clear="all"><br>-- <br>祝<br>工作愉快,身体健康!<br>