[Insight-users] AreaOpeningImageFilter
David Pastor
david.pastor at die.upm.es
Fri Feb 27 10:24:54 EST 2009
Hello,
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).
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.
//code--------------------------
const unsigned int Dimension = 3;
typedef unsigned char InputPixelType;
typedef itk::Image< InputPixelType, Dimension > InputImageType;
typedef itk::ImageFileReader< InputImageType > ReaderType;
typedef itk::ImageFileWriter< InputImageType > WriterType;
typedef itk::AreaOpeningImageFilter< InputImageType, InputImageType > AreaOpening;
int lambda = ::atoi( argv[3]);
int conn = ::atoi(argv[4]);
// Reader/Writer instantiations
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( argv[1] );
//reader->Update();
WriterType::Pointer writer = WriterType::New();
writer->SetFileName( argv[2] );
AreaOpening::Pointer filter = AreaOpening::New();
filter->SetInput(reader->GetOutput());
filter->SetLambda( lambda );
if(conn==0) filter->SetFullyConnected( false );
else if(conn==1) filter->SetFullyConnected( true );
else return EXIT_FAILURE;
cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090227/b28c50d0/attachment.htm>
More information about the Insight-users
mailing list