<!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 for segmentation referring the examples.The function as
follows:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>void CItkMFCView::ConnectedThresholdImageFilter(int seedx, int
seedy,int lower,int upper, CString inPath, CString
outPath)<BR>{<BR> typedef unsigned
short
InternalPixelType;<BR> const unsigned
int Dimension = 2;<BR> typedef itk::Image<
InternalPixelType, Dimension > InternalImageType;<BR> // Software
Guide : EndCodeSnippet<BR> <BR> <BR> typedef unsigned char
OutputPixelType;<BR> typedef itk::Image< OutputPixelType, Dimension >
OutputImageType;<BR> typedef itk::CastImageFilter< InternalImageType,
OutputImageType
><BR> CastingFilterType;<BR> CastingFilterType::Pointer
caster = CastingFilterType::New();<BR> <BR> // We instantiate reader
and writer types<BR> //<BR> typedef itk::ImageFileReader<
InternalImageType > ReaderType;<BR> typedef
itk::ImageFileWriter< OutputImageType >
WriterType;<BR> <BR> ReaderType::Pointer reader =
ReaderType::New();<BR> WriterType::Pointer writer =
WriterType::New();<BR> <BR> reader->SetFileName( inPath
);<BR> writer->SetFileName( outPath
);<BR> <BR> <BR> <BR> typedef
itk::CurvatureFlowImageFilter< InternalImageType, InternalImageType
><BR> CurvatureFlowImageFilterType;<BR> <BR> CurvatureFlowImageFilterType::Pointer
smoothing =
<BR> CurvatureFlowImageFilterType::New();<BR> <BR> typedef
itk::ConnectedThresholdImageFilter< InternalImageType,
<BR> InternalImageType >
ConnectedFilterType;<BR> <BR> ConnectedFilterType::Pointer
connectedThreshold =
ConnectedFilterType::New();<BR> <BR> smoothing->SetInput(
reader->GetOutput() );<BR> connectedThreshold->SetInput(
smoothing->GetOutput() );<BR> caster->SetInput(
connectedThreshold->GetOutput() );<BR> writer->SetInput(
caster->GetOutput()
);<BR> <BR> smoothing->SetNumberOfIterations( 5
);<BR> smoothing->SetTimeStep( 0.125 );<BR> <BR> //const
InternalPixelType lowerThreshold = atof( );<BR> //const
InternalPixelType upperThreshold = atof( );<BR> <BR> // Software
Guide : BeginCodeSnippet<BR> connectedThreshold->SetLower( lower
);<BR> connectedThreshold->SetUpper( upper
);<BR> <BR> connectedThreshold->SetReplaceValue(255);<BR> <BR> InternalImageType::IndexType
index;<BR> <BR> //index[0] = atoi( argv[3] );<BR> //index[1] =
atoi( argv[4]
);<BR> index[0]=seedx;<BR> index[1]=seedy;<BR> <BR> //
Software Guide : BeginCodeSnippet<BR> connectedThreshold->SetSeed( index
);<BR> <BR> try<BR>
{<BR> writer->Update();<BR> }<BR> catch(
itk::ExceptionObject & excep )<BR>
{<BR> std::cerr << "Exception caught !" <<
std::endl;<BR> std::cerr << excep <<
std::endl;<BR> }</FONT></DIV>
<DIV> </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> </DIV>
<DIV><FONT size=2>In addition,I have a series DICOM images of
head .What I want to do is to display the image in 3D.From the
image I 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 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> </DIV>
<DIV> </DIV></BODY></HTML>