Hi zhq,<br><br>It may be that you are running out of memory.&nbsp; If that is the case, streaming can be applied to process the image in small chunks.&nbsp; This can be achived with the StreamingImageFilter [1] or SetNumberOfStreamDivisions [2] on ImageFileWriter.<br>
<br>Thanks,<br>Matt<br><br>[1] <a href="http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html</a><br>[2] <a href="http://www.itk.org/Doxygen/html/classitk_1_1ImageFileWriter.html#a3dc8330ca50ef60844a15c1a81cc6ade">http://www.itk.org/Doxygen/html/classitk_1_1ImageFileWriter.html#a3dc8330ca50ef60844a15c1a81cc6ade</a><br>
<br><div class="gmail_quote">On Fri, Aug 2, 2013 at 8:46 PM, zhq <span dir="ltr">&lt;<a href="mailto:15891495523@126.com" target="_blank">15891495523@126.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="line-height:1.7;font-size:14px;font-family:arial">Hello :<div>&nbsp; &nbsp; &nbsp;I must make an apology for my yesterday email .&nbsp;</div><div>&nbsp; &nbsp; &nbsp;With referencing to the [1] , I can successfully segment blood vessels . Thank you very much . Although the result isn&#39;t very well , it help me a lot .&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp;But , there still a problem . I have 100 dicom files , and I thought read 100 files , and then segment those files . But , if I read more then 43 files , an error happened .&nbsp;</div><div>&nbsp; &nbsp; &nbsp;My code and the error are shown as follow .</div>
<div><img src="cid:eb1e039$1$14041a3d7a3$Coremail$15891495523$126.com" style="min-height:388px;width:600px"><br>my code :</div><div><div>//use the itkHessian3DToVesselnessMeasureImageFilter method to segment</div><div>//bright blood vessel</div>
<div class="im"><div>#include &quot;itkImage.h&quot;</div><div>#include &quot;itkImageSeriesReader.h&quot;</div><div>#include &quot;itkImageFileWriter.h&quot;</div><div>#include &quot;itkNumericSeriesFileNames.h&quot;</div>
<div>#include &quot;itkGDCMImageIO.h&quot;</div><div>#include &lt;Windows.h&gt;</div><div>#include &quot;itkShiftScaleImageFilter.h&quot;</div><div>#include &quot;itkHessianRecursiveGaussianImageFilter.h&quot;</div><div>#include &quot;itkHessian3DToVesselnessMeasureImageFilter.h&quot;</div>
<div>void main()</div><div>{</div><div><span style="white-space:pre-wrap">        </span>typedef unsigned short PixelType ;&nbsp;</div><div><span style="white-space:pre-wrap">        </span>const unsigned int Dimension = 3;&nbsp;</div><div><span style="white-space:pre-wrap">        </span>typedef itk::Image&lt;PixelType , Dimension&gt; ImageType ;&nbsp;</div>
<div><span style="white-space:pre-wrap">        </span>typedef itk::ImageSeriesReader&lt;ImageType&gt; ReaderType ;&nbsp;</div></div><div><span style="white-space:pre-wrap">        </span>//there still some parameters can be set</div><div class="im">
<div><span style="white-space:pre-wrap">        </span>typedef itk::NumericSeriesFileNames NameGeneratorType ;</div><div><span style="white-space:pre-wrap">        </span>NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();</div>
<div><span style="white-space:pre-wrap">        </span>nameGenerator-&gt;SetSeriesFormat(&quot;C:\\Users\\zhq\\Desktop\\data\\SNAP_CR\\E403434298\\E403434298S1901I%3d.dcm&quot;);</div><div><span style="white-space:pre-wrap">        </span>nameGenerator-&gt;SetStartIndex(301);</div>
</div><div><span style="white-space:pre-wrap">        </span>nameGenerator-&gt;SetEndIndex(350);</div><div class="im"><div><span style="white-space:pre-wrap">        </span>nameGenerator-&gt;SetIncrementIndex(1);</div><div><span style="white-space:pre-wrap">        </span></div>
<div><span style="white-space:pre-wrap">        </span>ReaderType::Pointer reader = ReaderType::New();</div><div><span style="white-space:pre-wrap">        </span>reader-&gt;SetImageIO(itk::GDCMImageIO::New());</div><div><span style="white-space:pre-wrap">        </span>reader-&gt;SetFileNames(nameGenerator-&gt;GetFileNames());</div>
<div><span style="white-space:pre-wrap">        </span>reader-&gt;Update();</div></div><div><span style="white-space:pre-wrap">        </span>std::cout&lt;&lt;&quot;reader updata&quot;&lt;&lt;std::endl;</div><div class="im"><div><br></div>
<div><span style="white-space:pre-wrap">        </span>typedef itk::Image&lt;double,3&gt; doubleImageType ;&nbsp;</div><div><span style="white-space:pre-wrap">        </span>typedef itk::ShiftScaleImageFilter&lt;ImageType,doubleImageType&gt; ShiftFilter ;&nbsp;</div>
<div><span style="white-space:pre-wrap">        </span>ShiftFilter::Pointer filter = ShiftFilter::New();</div><div><span style="white-space:pre-wrap">        </span>filter-&gt;SetInput(reader-&gt;GetOutput());</div><div><span style="white-space:pre-wrap">        </span>filter-&gt;Update();</div>
</div><div><span style="white-space:pre-wrap">        </span>std::cout&lt;&lt;&quot;filter updata&quot;&lt;&lt;std::endl ;&nbsp;</div><div class="im"><div><br></div><div><span style="white-space:pre-wrap">        </span>typedef itk::HessianRecursiveGaussianImageFilter&lt;doubleImageType&gt; HessianFilterType;</div>
<div><span style="white-space:pre-wrap">        </span>HessianFilterType::Pointer hessianFilter = HessianFilterType::New();</div><div><span style="white-space:pre-wrap">        </span>hessianFilter-&gt;SetInput(filter-&gt;GetOutput());</div>
</div><div><span style="white-space:pre-wrap">        </span>hessianFilter-&gt;Update();</div><div><span style="white-space:pre-wrap">        </span>std::cout&lt;&lt;&quot;hessian Filter&quot;&lt;&lt;std::endl ;&nbsp;</div><div>//if read 44 files , there is a error <span style="white-space:pre-wrap">        </span></div>
<div class="im"><div><span style="white-space:pre-wrap">        </span>typedef itk::Hessian3DToVesselnessMeasureImageFilter&lt;float&gt; VesselMeasureFilterType ;&nbsp;</div><div><span style="white-space:pre-wrap">        </span>VesselMeasureFilterType::Pointer vesselFilter = VesselMeasureFilterType::New();</div>
<div><span style="white-space:pre-wrap">        </span>vesselFilter-&gt;SetInput(hessianFilter-&gt;GetOutput());</div><div><span style="white-space:pre-wrap">        </span>vesselFilter-&gt;Update();</div><div><span style="white-space:pre-wrap">        </span>std::cout&lt;&lt;&quot;vesselFilter update&quot;&lt;&lt;std::endl;</div>
<div><br></div><div><span style="white-space:pre-wrap">        </span>typedef itk::ImageFileWriter&lt; itk::Image&lt;float,3&gt; &gt; WriterType ;&nbsp;</div><div><span style="white-space:pre-wrap">        </span>WriterType::Pointer writer = WriterType::New();</div>
<div><span style="white-space:pre-wrap">        </span>writer-&gt;SetInput(vesselFilter-&gt;GetOutput());</div><div><span style="white-space:pre-wrap">        </span>writer-&gt;SetFileName(&quot;C:\\Users\\zhq\\Desktop\\mydata.vtk&quot;);</div>
<div><span style="white-space:pre-wrap">        </span>writer-&gt;Update();</div></div><div><span style="white-space:pre-wrap">        </span>std::cout&lt;&lt;&quot;writer updata&quot;&lt;&lt;std::endl ;</div><div><br></div><div><span style="white-space:pre-wrap">        </span>system(&quot;pause&quot;);</div>
<div>}</div><div><br></div><br><br><br><div></div><div></div><br><pre><div class="im"><br>At&nbsp;<a href="tel:2013-08-02%C2%A011" value="+12013080211" target="_blank">2013-08-02&nbsp;11</a>:24:29,&quot;Matt&nbsp;McCormick&quot;&nbsp;&lt;<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a></div>
&gt;&nbsp;wrote:
&gt;Hi,
&gt;
&gt;Here[1]&nbsp;is&nbsp;a&nbsp;very&nbsp;simple&nbsp;brain&nbsp;vessel&nbsp;segmentation&nbsp;example.
&gt;
&gt;For&nbsp;more&nbsp;advanced&nbsp;vessel&nbsp;segmentation&nbsp;methods,&nbsp;you&nbsp;may&nbsp;want&nbsp;to&nbsp;try
&gt;TubeTK[2],&nbsp;which&nbsp;supports&nbsp;analysis&nbsp;and&nbsp;visualization&nbsp;with&nbsp;the&nbsp;ITK&nbsp;and
&gt;VTK&nbsp;based&nbsp;3DSlicer[3].
&gt;
&gt;Thanks,
&gt;Matt
&gt;
&gt;[1]&nbsp;<a href="http://itk.org/ITKExamples/src/Filtering/ImageFeature/SegmentBloodVessels/Documentation.html" target="_blank">http://itk.org/ITKExamples/src/Filtering/ImageFeature/SegmentBloodVessels/Documentation.html</a><div>
<div class="h5">
&gt;[2]&nbsp;<a href="http://tubetk.org/" target="_blank">http://tubetk.org/</a>
&gt;[3]&nbsp;<a href="http://slicer.org/" target="_blank">http://slicer.org/</a>
&gt;
&gt;On&nbsp;Fri,&nbsp;Jul&nbsp;26,&nbsp;2013&nbsp;at&nbsp;9:19&nbsp;PM,&nbsp;章强&nbsp;&lt;<a href="mailto:15891495523@126.com" target="_blank">15891495523@126.com</a>&gt;&nbsp;wrote:
&gt;&gt;&nbsp;Hello&nbsp;:
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;there&nbsp;is&nbsp;a&nbsp;series&nbsp;of&nbsp;dcm&nbsp;format&nbsp;files&nbsp;which&nbsp;is&nbsp;the&nbsp;results&nbsp;of&nbsp;scanning
&gt;&gt;&nbsp;the&nbsp;brain&nbsp;.&nbsp;I&nbsp;want&nbsp;to&nbsp;segment&nbsp;blood&nbsp;vessels&nbsp;from&nbsp;these&nbsp;files&nbsp;with&nbsp;ITK&nbsp;,&nbsp;and
&gt;&gt;&nbsp;show&nbsp;it&nbsp;with&nbsp;VTK&nbsp;.&nbsp;Please&nbsp;give&nbsp;me&nbsp;a&nbsp;simple&nbsp;case&nbsp;.&nbsp;I&nbsp;have&nbsp;a&nbsp;&nbsp;problem&nbsp;with
&gt;&gt;&nbsp;this&nbsp;project&nbsp;.
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;how&nbsp;can&nbsp;I&nbsp;segment&nbsp;a&nbsp;specified&nbsp;region&nbsp;?&nbsp;I&nbsp;know&nbsp;that&nbsp;ITK&nbsp;provide&nbsp;some
&gt;&gt;&nbsp;segmentation&nbsp;algorithm&nbsp;&nbsp;,&nbsp;but&nbsp;they&nbsp;need&nbsp;the&nbsp;Index&nbsp;of&nbsp;seeds&nbsp;.&nbsp;Can&nbsp;I&nbsp;show&nbsp;the
&gt;&gt;&nbsp;picture&nbsp;with&nbsp;VTK&nbsp;fristly&nbsp;,and&nbsp;then&nbsp;point&nbsp;out&nbsp;a&nbsp;seed&nbsp;in&nbsp;the&nbsp;picture&nbsp;?&nbsp;And&nbsp;if
&gt;&gt;&nbsp;there&nbsp;are&nbsp;some&nbsp;algorithms&nbsp;which&nbsp;can&nbsp;segment&nbsp;volume&nbsp;data&nbsp;?
&gt;&gt;
&gt;&gt;
&gt;&gt;&nbsp;来自网易手机号码邮箱了解更多
&gt;&gt;
&gt;&gt;&nbsp;_____________________________________
&gt;&gt;&nbsp;Powered&nbsp;by&nbsp;<a href="http://www.kitware.com" target="_blank">www.kitware.com</a>
&gt;&gt;
&gt;&gt;&nbsp;Visit&nbsp;other&nbsp;Kitware&nbsp;open-source&nbsp;projects&nbsp;at
&gt;&gt;&nbsp;<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>
&gt;&gt;
&gt;&gt;&nbsp;Kitware&nbsp;offers&nbsp;ITK&nbsp;Training&nbsp;Courses,&nbsp;for&nbsp;more&nbsp;information&nbsp;visit:
&gt;&gt;&nbsp;<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a>
&gt;&gt;
&gt;&gt;&nbsp;Please&nbsp;keep&nbsp;messages&nbsp;on-topic&nbsp;and&nbsp;check&nbsp;the&nbsp;ITK&nbsp;FAQ&nbsp;at:
&gt;&gt;&nbsp;<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a>
&gt;&gt;
&gt;&gt;&nbsp;Follow&nbsp;this&nbsp;link&nbsp;to&nbsp;subscribe/unsubscribe:
&gt;&gt;&nbsp;<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a>
&gt;&gt;
</div></div></pre></div></div><br><br><span title="neteasefooter"><span><div><div style="border-top:#cccccc 1px solid;padding:10px 5px;font-size:12px;color:#666;line-height:22px">来自网易手机号码邮箱<a href="http://shouji.163.com" style="color:#0000ff" target="_blank">了解更多</a></div>
</div>
</span></span></blockquote></div><br>