Dear all, <br>I would like to know how to create a funtion that can make a dilatation when I call it. THe input parameter is an image and the output parameter is also an image.This is the code:<br><br>const unsigned int Dimension = 3;<br>
<br> typedef unsigned char InputPixelType;<br> typedef unsigned char OutputPixelType;<br><br> typedef itk::Image< InputPixelType, Dimension > InputImageType;<br> typedef itk::Image< OutputPixelType, Dimension > OutputImageType;<br>
<br> typedef itk::ImageFileReader< InputImageType > ReaderType;<br> typedef itk::ImageFileWriter< OutputImageType > WriterType;<br> <br> typedef itk::BinaryBallStructuringElement< InputPixelType,Dimension > StructuringElementType;<br>
<br> typedef itk::GrayscaleDilateImageFilter<InputImageType, OutputImageType, StructuringElementType > DilateFilterType;<br> <br> ReaderType::Pointer reader = ReaderType::New();<br> WriterType::Pointer writerDilation = WriterType::New();<br>
DilateFilterType::Pointer grayscaleDilate = DilateFilterType::New();<br> <br> StructuringElementType structuringElement;<br> structuringElement.SetRadius( 1 ); <br> structuringElement.CreateStructuringElement();<br>
<br> reader->SetFileName( argv[1] ); <br> <br> grayscaleDilate->SetKernel( structuringElement );<br> grayscaleDilate->SetInput( reader->GetOutput() );<br> grayscaleDilate->Update();<br> <br> writerDilation->SetFileName( argv[2] );<br>
writerDilation->SetInput( grayscaleDilate->GetOutput() );<br> writerDilation->Update();<br> <br><br>Is there any example how to do it?<br>Best regards<br>Albert<br>