Hi,<br><br>You may want to try increasing the sigma parameter on the HessianRecursiveGaussianFilter. This is a parameter for smoothing that occurs during (which is equivalent to before) the Hessian estimation. By increasing the amount of smoothing, smaller structures and high frequency noise will not be identified as vessels. Not that in the exampled referenced, the smoothing is relatively high, so only the large vessels around the Circle of Willis, etc are extracted.<br>
<br>Please reply-to-all so messages reach the mailing list.<br><br>Thanks,<br>Matt<br><br><div class="gmail_quote">On Fri, Aug 2, 2013 at 3:12 AM, zhq <span dir="ltr"><<a href="mailto:15891495523@126.com" target="_blank">15891495523@126.com</a>></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">With referencing to the [1] , I written my code as follow . And there is some error with the code "
<span style="color:rgb(255,0,0)">writer->Update();</span> " , but the writer's input<div>is ok , because I can get all the pixel value with the method :vesselFilter->GetOutput()->GetPixel(index); . </div>
<div><br></div><div>Then I get the second slice from vesselFilter , and the result is :</div><div><img src="cid:782ddb15$1$1403ddeff01$Coremail$15891495523$126.com" style="min-height:279px;width:600px"></div><div><br></div>
<div><br></div><div>so , Is there any workable algorithm ?</div><div><br></div><div><div>#include "itkImage.h"</div><div>#include "itkImageSeriesReader.h"</div><div>#include "itkImageFileWriter.h"</div>
<div>#include "itkNumericSeriesFileNames.h"</div><div>#include "itkGDCMImageIO.h"</div><div>#include <Windows.h></div><div>#include "itkShiftScaleImageFilter.h"</div><div>#include "itkHessianRecursiveGaussianImageFilter.h"</div>
<div>#include "itkHessian3DToVesselnessMeasureImageFilter.h"</div><div>void main()</div><div>{</div><div><span style="white-space:pre-wrap">        </span>typedef unsigned short PixelType ; </div><div><span style="white-space:pre-wrap">        </span>const unsigned int Dimension = 3; </div>
<div><span style="white-space:pre-wrap">        </span>typedef itk::Image<PixelType , Dimension> ImageType ; </div><div><span style="white-space:pre-wrap">        </span>typedef itk::ImageSeriesReader<ImageType> ReaderType ; </div>
<div><span style="white-space:pre-wrap">        </span></div><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->SetSeriesFormat("C:\\Users\\zhq\\Desktop\\data\\SNAP_CR\\E403434298\\E403434298S1901I%3d.dcm");</div><div><span style="white-space:pre-wrap">        </span>nameGenerator->SetStartIndex(301);</div>
<div><span style="white-space:pre-wrap">        </span>nameGenerator->SetEndIndex(305);</div><div><span style="white-space:pre-wrap">        </span>nameGenerator->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->SetImageIO(itk::GDCMImageIO::New());</div><div><span style="white-space:pre-wrap">        </span>reader->SetFileNames(nameGenerator->GetFileNames());</div>
<div><span style="white-space:pre-wrap">        </span>reader->Update();</div><div><br></div><div><span style="white-space:pre-wrap">        </span>typedef itk::Image<double,3> doubleImageType ; </div><div><span style="white-space:pre-wrap">        </span>typedef itk::ShiftScaleImageFilter<ImageType,doubleImageType> ShiftFilter ; </div>
<div><span style="white-space:pre-wrap">        </span>ShiftFilter::Pointer filter = ShiftFilter::New();</div><div><span style="white-space:pre-wrap">        </span>filter->SetInput(reader->GetOutput());</div><div><span style="white-space:pre-wrap">        </span>filter->Update();</div>
<div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span>typedef itk::HessianRecursiveGaussianImageFilter<doubleImageType> 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->SetInput(filter->GetOutput());</div><div><br></div><div><span style="white-space:pre-wrap">        </span>typedef itk::Hessian3DToVesselnessMeasureImageFilter<float> VesselMeasureFilterType ; </div>
<div><span style="white-space:pre-wrap">        </span>VesselMeasureFilterType::Pointer vesselFilter = VesselMeasureFilterType::New();</div><div><span style="white-space:pre-wrap">        </span>vesselFilter->SetInput(hessianFilter->GetOutput());</div>
<div><span style="white-space:pre-wrap">        </span>vesselFilter->Update();</div><div><span style="white-space:pre-wrap">        </span>std::cout<<"vesselFilter update"<<std::endl;</div><div><br></div><div><span style="white-space:pre-wrap">        </span>typedef itk::ImageFileWriter< itk::Image<float,3> > WriterType ; </div>
<div><span style="white-space:pre-wrap">        </span>WriterType::Pointer writer = WriterType::New();</div><div><span style="white-space:pre-wrap">        </span>writer->SetInput(vesselFilter->GetOutput());</div><div><span style="white-space:pre-wrap">        </span>writer->SetFileName("C:\\Users\\zhq\\Desktop\\mydata.vtk");</div>
<div><span style="white-space:pre-wrap">        </span><span style="color:rgb(255,0,0)">writer->Update();</span></div><div><br></div><div><span style="white-space:pre-wrap">        </span>system("pause");</div><div>}</div>
<br><br><br><br><div></div><div></div><br><pre><div class="im"><br>At <a href="tel:2013-08-02%C2%A011" value="+12013080211" target="_blank">2013-08-02 11</a>:24:29,"Matt McCormick" <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a></div>
> wrote:
>Hi,
>
>Here[1] is a very simple brain vessel segmentation example.
>
>For more advanced vessel segmentation methods, you may want to try
>TubeTK[2], which supports analysis and visualization with the ITK and
>VTK based 3DSlicer[3].
>
>Thanks,
>Matt
>
>[1] <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">
>[2] <a href="http://tubetk.org/" target="_blank">http://tubetk.org/</a>
>[3] <a href="http://slicer.org/" target="_blank">http://slicer.org/</a>
>
>On Fri, Jul 26, 2013 at 9:19 PM, 章强 <<a href="mailto:15891495523@126.com" target="_blank">15891495523@126.com</a>> wrote:
>> Hello :
>> there is a series of dcm format files which is the results of scanning
>> the brain . I want to segment blood vessels from these files with ITK , and
>> show it with VTK . Please give me a simple case . I have a problem with
>> this project .
>> how can I segment a specified region ? I know that ITK provide some
>> segmentation algorithm , but they need the Index of seeds . Can I show the
>> picture with VTK fristly ,and then point out a seed in the picture ? And if
>> there are some algorithms which can segment volume data ?
>>
>>
>> 来自网易手机号码邮箱了解更多
>>
>> _____________________________________
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>
>>
>> Visit other Kitware open-source projects at
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a>
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a>
>>
>> Follow this link to subscribe/unsubscribe:
>> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a>
>>
</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>