<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><FONT size=2><FONT color=#008000 size=2><FONT color=#008000 size=2>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Hi Luis and itk users,</FONT></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>I’ve tried <SPAN style="mso-no-proof: yes">HybridSegmentationFuzzyVoronoi with 2D images and its working fine. When I try to do the segmentation using the same filter with 3D image </SPAN>I get the error:</FONT></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Unhandled exception at 0x00418286 in HybridSegmentation.exe: 0xC0000005: Access violation reading location 0x35847334. </FONT></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Any help ? </FONT></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>I past my code bellow.</FONT></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Thank you</FONT></DIV>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Sara </FONT></DIV>
<DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>// HybridSegmentationFuzzyVoronoi 3D image</DIV></DIV></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>#include</FONT></FONT><FONT size=2> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"itkSimpleFuzzyConnectednessScalarImageFilter.h"</DIV></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>#include</FONT></FONT><FONT size=2> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"itkVoronoiSegmentationImageFilter.h"</DIV></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>#include</FONT></FONT><FONT size=2> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"itkImage.h"</DIV></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>#include</FONT></FONT><FONT size=2> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"itkImageFileReader.h"</DIV></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>#include</FONT></FONT><FONT size=2> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"itkImageFileWriter.h"</DIV></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>#include</FONT></FONT><FONT size=2> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"itkRescaleIntensityImageFilter.h"</DIV>
<DIV> </DIV></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<DIV>int</FONT></FONT><FONT size=2> main( </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2>)</DIV>
<DIV>{</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>float</FONT></FONT><FONT size=2> InputPixelType;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>unsigned</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>char</FONT></FONT><FONT size=2> BinaryPixelType;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>unsigned</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>char</FONT></FONT><FONT size=2> OutputPixelType; </DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>const</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>unsigned</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> Dimension = 3;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::Image< InputPixelType, Dimension > InputImageType; </DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::Image< BinaryPixelType, Dimension > BinaryImageType;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::Image< OutputPixelType, Dimension > OutputImageType;</DIV>
<DIV></DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::SimpleFuzzyConnectednessScalarImageFilter<InputImageType,BinaryImageType> FuzzySegmentationFilterType;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::VoronoiSegmentationImageFilter<InputImageType, OutputImageType,BinaryImageType> VoronoiSegmentationFilterType;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::ImageFileReader< InputImageType > ReaderType;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::ImageFileWriter< OutputImageType > WriterType;</DIV>
<DIV>FuzzySegmentationFilterType::Pointer fuzzysegmenter =FuzzySegmentationFilterType::New();</DIV>
<DIV>VoronoiSegmentationFilterType::Pointer voronoisegmenter = VoronoiSegmentationFilterType::New();</DIV>
<DIV>ReaderType::Pointer reader = ReaderType::New();</DIV>
<DIV>WriterType::Pointer writer = WriterType::New();</DIV>
<DIV>reader-SetFileName(</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"C:/ Images/BrainPart2/Brain/brainweb165a10f17.mha"</FONT></FONT><FONT size=2> );</DIV>
<DIV>writer->SetFileName(</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"C:/mages/HybridSegmentationFuzzyVoronoi.hdr"</FONT></FONT><FONT size=2>);</DIV>
<DIV></DIV>
<DIV>InputImageType::IndexType index;</DIV>
<DIV>index[0] = 123;</DIV>
<DIV>index[1] = 110;</DIV>
<DIV>index[2] = 96;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>const</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>float</FONT></FONT><FONT size=2> mean = 140;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>const</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>float</FONT></FONT><FONT size=2> variance = 30;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>const</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>float</FONT></FONT><FONT size=2> meanTolerance = 0.2;</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>const</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>float</FONT></FONT><FONT size=2> stdTolerance = 2.0;</DIV>
<DIV> </DIV>
<DIV>fuzzysegmenter->SetInput( reader->GetOutput() ); </DIV>
<DIV>fuzzysegmenter->SetObjectSeed( index );</DIV>
<DIV>fuzzysegmenter->SetMean( mean );</DIV>
<DIV>fuzzysegmenter->SetVariance( variance );</DIV>
<DIV>fuzzysegmenter->SetThreshold( 0.5 ); </DIV>
<DIV>fuzzysegmenter->Update();</DIV>
<DIV></DIV>
<DIV>voronoisegmenter->SetInput( reader->GetOutput() );</DIV>
<DIV>voronoisegmenter->TakeAPrior( fuzzysegmenter->GetOutput() ); </DIV>
<DIV>voronoisegmenter->SetMeanPercentError( meanTolerance );</DIV>
<DIV>voronoisegmenter->SetSTDPercentError( stdTolerance ); </DIV>
<DIV>voronoisegmenter->SetMinRegion( 5); </DIV>
<DIV>voronoisegmenter->Update();</DIV>
<DIV></DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> itk::RescaleIntensityImageFilter< OutputImageType,OutputImageType > ScalerFilterType;</DIV>
<DIV>ScalerFilterType::Pointer scaler = ScalerFilterType::New();</DIV>
<DIV>scaler->SetOutputMinimum( 0 );</DIV>
<DIV>scaler->SetOutputMaximum( 255 );</DIV>
<DIV>scaler->SetInput( voronoisegmenter->GetOutput() ); </DIV>
<DIV>writer->SetInput( scaler->GetOutput() );</DIV>
<DIV>writer->Update();</DIV>
<DIV></DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> 0;</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV> </DIV></FONT></FONT></td></tr></table><br>