<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ks_c_5601-1987">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>Gradient Anisotropic Diffusion Filter with 3D Ultrasound data</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<BR>
<P><SPAN LANG="ko"><FONT COLOR="#0000FF" SIZE=2 FACE="±¼¸²"></FONT> <FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Hello, everyone,</FONT></SPAN>
</P>
<P><SPAN LANG="ko"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> I test Gradient Anisotropic Diffusion Filter with our 3D Ultrasound data, but there was not any change in 3D Ultrasound data.</FONT></SPAN></P>
<P><SPAN LANG="ko"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> What's wrong? Could you check following code, please?</FONT></SPAN>
</P>
<P><SPAN LANG="ko"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> Thank you.</FONT></SPAN>
<BR><SPAN LANG="ko"><FONT COLOR="#0000FF" SIZE=2 FACE="Arial"> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</FONT></SPAN></P>
<P><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial"> /* pVolData : Pointer of 8bit Volume Data Buffer ( ex: size - 312 x 84 x 44 ) </FONT></SPAN>
<BR><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial"> pOutoutData : Pointer of 8bit Output Data Buffer (same size of pVolData buffer)</FONT></SPAN>
<BR><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial">*/</FONT></SPAN>
<BR><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial">void DiffusionFilter( unsigned char *pVolData, unsigned char *pOutputData, int xsize, int ysize, int zsize )</FONT></SPAN>
<BR><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial">{</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">const unsigned int volume_size = xsize * ysize * zsize;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">typedef unsigned char PixelType;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">const unsigned int Dimension = 3;</FONT></SPAN>
<BR><SPAN LANG="ko"> </SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">typedef itk::Image< PixelType, Dimension > ImageType;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">typedef itk::ImportImageFilter< PixelType, Dimension > ImportFilterType;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">/*-------- Set Input Data with ImportFilter --------*/</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">ImportFilterType::Pointer importFilter = ImportFilterType::New();</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">ImportFiterType::SizeType size; </FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">size[0] = xsize;</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">size[1] = ysize;</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">size[2] = zsize;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">ImportFilterType::IndexType start; </FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">start.Fill(0); </FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">ImportFIlterType::RegionType region;</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">region.SetIndex( start );</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">region.SetSize( size );</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">importFilter->SetRegion( region );</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">double origin[ Dimension ];</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">origin[0] = 0.0; origin[1] = 0.0; origin[2] = 0.0;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">importFilter->SetOrigin( origin );</FONT></SPAN>
<BR><SPAN LANG="ko"> </SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">double spacing[ Dimension ];</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">spacing[0] = 1.0; spacing[1] = 1.0; spacing[2] = 1.0;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">importFilter->SetSpacing( spacing );</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">importFilter->SetImportPointer( pVolData, volume_size, false );</FONT></SPAN>
</P>
<P><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial"> /*------------Apply Gradient Anisotropic Diffusion Filter to Input Data ---------------*/</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">typedef itk::Image< PixelType, Dimension > InputImageType;</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">typedef itk::Image< PixelType, Dimension > OutputImageType;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">typedef itk::GradientAnisotropicDiffusionImageFilter< InputImageType, OutputImageType > FilterType;</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">FilterType::Pointer filter = FilterType::New(); </FONT></SPAN>
</P>
<P><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial"> filter->SetInput( importFilter->GetOutput() );</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">const unsigned int numberOfIterations = 4;</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">const double timeStep = 0.125;</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">const double conductance = 1.0; </FONT></SPAN>
<BR><SPAN LANG="ko"> </SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">filter->SetNumberOfIterations( numberOfIterations );</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">filter->SetTimeStep( timeStep );</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">filter->SetConductanceParameter( conductance );</FONT></SPAN>
<BR><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial"> </FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">filter->Update(); /* take so long time....*/</FONT></SPAN>
</P>
<P><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial">/*</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">typedef itk::RescaleIntensityImageFilter<PixelType, PixelType > RescaleFilterType;</FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial"> RescaleFilterType::Pointer rescaler = RescaleFilterType::New();</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial"> rescaler->SetOutputMinimum( 0 );</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial"> rescaler->SetOutputMaximum( 255 ); </FONT></SPAN>
</P>
<P><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">rescaler->SetInput( filter->GetOutput() );</FONT></SPAN>
<BR><SPAN LANG="ko"><FONT SIZE=2 FACE="Arial">*/</FONT></SPAN>
<BR><SPAN LANG="ko"> <FONT SIZE=2 FACE="Arial">memcpy( pOutputData, filter->GetOutput()->GetBufferPointer(), sizeof(unsigned char)*volume_size ); </FONT></SPAN>
<BR><SPAN LANG="ko"><FONT SIZE=2 FACE="±¼¸²">}</FONT></SPAN>
</P>
</BODY>
</HTML>