<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.1830" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I encountered some problems using this filter.
First, the output image even when it is templated to be unsigned char has a size
twice the input image (seems that it uses short as pixel type).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Also, the result does not look very consistent. The
opened image has brighter elements than the original one, which is weird as the
opened image should remove small bright peaks flattening the image.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>//code--------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT color=#0000ff size=2>
<P>const</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>int</FONT><FONT size=2> Dimension = 3;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff
size=2>char</FONT><FONT size=2> InputPixelType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::Image<
InputPixelType, Dimension > InputImageType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2>
itk::ImageFileReader< InputImageType > ReaderType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2>
itk::ImageFileWriter< InputImageType > WriterType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2>
itk::AreaOpeningImageFilter< InputImageType, InputImageType >
AreaOpening;</P>
<P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> lambda = ::atoi(
argv[3]);</P>
<P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> conn =
::atoi(argv[4]);</P>
<P></FONT><FONT color=#008000 size=2>// Reader/Writer
instantiations</P></FONT><FONT size=2>
<P>ReaderType::Pointer reader = ReaderType::New();</P>
<P>reader->SetFileName( argv[1] );</P>
<P></FONT><FONT color=#008000 size=2>//reader->Update();</P></FONT><FONT
size=2>
<P>WriterType::Pointer writer = WriterType::New();</P>
<P>writer->SetFileName( argv[2] );</P>
<P></P>
<P>AreaOpening::Pointer filter = AreaOpening::New();</P>
<P>filter->SetInput(reader->GetOutput());</P>
<P>filter->SetLambda( lambda );</P>
<P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>(conn==0)
filter->SetFullyConnected( </FONT><FONT color=#0000ff
size=2>false</FONT><FONT size=2> );</P>
<P></FONT><FONT color=#0000ff size=2>else</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>if</FONT><FONT size=2>(conn==1)
filter->SetFullyConnected( </FONT><FONT color=#0000ff size=2>true</FONT><FONT
size=2> );</P>
<P></FONT><FONT color=#0000ff size=2>else</FONT><FONT size=2> </FONT><FONT
color=#0000ff size=2>return</FONT><FONT size=2> EXIT_FAILURE;</FONT></P>
<P><FONT size=2></FONT> </P>
<P><FONT size=2>cheers</P></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>