<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I am a new learner of ITK.I compiled ItkMFC.I want to add some 
function&nbsp;for segmentation referring the examples.The function as 
follows:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>void CItkMFCView::ConnectedThresholdImageFilter(int seedx, int 
seedy,int lower,int upper, CString inPath, CString 
outPath)<BR>{<BR>&nbsp;typedef&nbsp;&nbsp; unsigned 
short&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
InternalPixelType;<BR>&nbsp;const&nbsp;&nbsp;&nbsp;&nbsp; unsigned 
int&nbsp;&nbsp;&nbsp; Dimension = 2;<BR>&nbsp;typedef itk::Image&lt; 
InternalPixelType, Dimension &gt;&nbsp; InternalImageType;<BR>&nbsp;// Software 
Guide : EndCodeSnippet<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;typedef unsigned char 
OutputPixelType;<BR>&nbsp;typedef itk::Image&lt; OutputPixelType, Dimension &gt; 
OutputImageType;<BR>&nbsp;typedef itk::CastImageFilter&lt; InternalImageType, 
OutputImageType 
&gt;<BR>&nbsp;&nbsp;CastingFilterType;<BR>&nbsp;CastingFilterType::Pointer 
caster = CastingFilterType::New();<BR>&nbsp;<BR>&nbsp;// We instantiate reader 
and writer types<BR>&nbsp;//<BR>&nbsp;typedef&nbsp; itk::ImageFileReader&lt; 
InternalImageType &gt; ReaderType;<BR>&nbsp;typedef&nbsp; 
itk::ImageFileWriter&lt;&nbsp; OutputImageType&nbsp; &gt; 
WriterType;<BR>&nbsp;<BR>&nbsp;ReaderType::Pointer reader = 
ReaderType::New();<BR>&nbsp;WriterType::Pointer writer = 
WriterType::New();<BR>&nbsp;<BR>&nbsp;reader-&gt;SetFileName( inPath 
);<BR>&nbsp;writer-&gt;SetFileName( outPath 
);<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;typedef 
itk::CurvatureFlowImageFilter&lt; InternalImageType, InternalImageType 
&gt;<BR>&nbsp;&nbsp;CurvatureFlowImageFilterType;<BR>&nbsp;<BR>&nbsp;CurvatureFlowImageFilterType::Pointer 
smoothing = 
<BR>&nbsp;&nbsp;CurvatureFlowImageFilterType::New();<BR>&nbsp;<BR>&nbsp;typedef 
itk::ConnectedThresholdImageFilter&lt; InternalImageType, 
<BR>&nbsp;&nbsp;InternalImageType &gt; 
ConnectedFilterType;<BR>&nbsp;<BR>&nbsp;ConnectedFilterType::Pointer 
connectedThreshold = 
ConnectedFilterType::New();<BR>&nbsp;<BR>&nbsp;smoothing-&gt;SetInput( 
reader-&gt;GetOutput() );<BR>&nbsp;connectedThreshold-&gt;SetInput( 
smoothing-&gt;GetOutput() );<BR>&nbsp;caster-&gt;SetInput( 
connectedThreshold-&gt;GetOutput() );<BR>&nbsp;writer-&gt;SetInput( 
caster-&gt;GetOutput() 
);<BR>&nbsp;<BR>&nbsp;smoothing-&gt;SetNumberOfIterations( 5 
);<BR>&nbsp;smoothing-&gt;SetTimeStep( 0.125 );<BR>&nbsp;<BR>&nbsp;//const 
InternalPixelType lowerThreshold = atof(&nbsp; );<BR>&nbsp;//const 
InternalPixelType upperThreshold = atof(&nbsp; );<BR>&nbsp;<BR>&nbsp;// Software 
Guide : BeginCodeSnippet<BR>&nbsp;connectedThreshold-&gt;SetLower(&nbsp; lower 
);<BR>&nbsp;connectedThreshold-&gt;SetUpper(&nbsp; upper&nbsp; 
);<BR>&nbsp;<BR>&nbsp;connectedThreshold-&gt;SetReplaceValue(255);<BR>&nbsp;<BR>&nbsp;InternalImageType::IndexType&nbsp; 
index;<BR>&nbsp;<BR>&nbsp;//index[0] = atoi( argv[3] );<BR>&nbsp;//index[1] = 
atoi( argv[4] 
);<BR>&nbsp;index[0]=seedx;<BR>&nbsp;index[1]=seedy;<BR>&nbsp;<BR>&nbsp;// 
Software Guide : BeginCodeSnippet<BR>&nbsp;connectedThreshold-&gt;SetSeed( index 
);<BR>&nbsp;<BR>&nbsp;try<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;writer-&gt;Update();<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;catch( 
itk::ExceptionObject &amp; excep )<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;std::cerr &lt;&lt; "Exception caught !" &lt;&lt; 
std::endl;<BR>&nbsp;&nbsp;std::cerr &lt;&lt; excep &lt;&lt; 
std::endl;<BR>&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2><BR>Every thing is OK.But the writed image is all black.I 
can't find the bug.Can help me?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>In addition,I&nbsp;have a series DICOM images&nbsp;of 
head&nbsp;.What&nbsp;I want to do is to display the image in 3D.From the 
image&nbsp;I&nbsp;want to segment the cochlea.Display the cochlea and measure 
the length of cochlea.</FONT></DIV>
<DIV><FONT size=2>Now I know combining VTK and ITK can get that.</FONT></DIV>
<DIV><FONT size=2>I have learned VTK for a time and I already&nbsp;visualized 
the image in 3D,but don't know how to segment the cochlea.Is there somebody 
could tell me what I should do.Which classes of ITK should I read 
particularly,or a general progress to achieve segment and 3D 
visualization?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></BODY></HTML>