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>
&nbsp; <br>&nbsp; typedef unsigned char&nbsp;&nbsp; InputPixelType;<br>&nbsp; typedef unsigned char&nbsp;&nbsp; OutputPixelType;<br><br>&nbsp; typedef itk::Image&lt; InputPixelType,&nbsp; Dimension &gt;&nbsp;&nbsp; InputImageType;<br>&nbsp; typedef itk::Image&lt; OutputPixelType, Dimension &gt;&nbsp;&nbsp; OutputImageType;<br>
&nbsp; <br>&nbsp; typedef itk::ImageFileReader&lt; InputImageType&nbsp; &gt;&nbsp; ReaderType;<br>&nbsp; typedef itk::ImageFileWriter&lt; OutputImageType &gt;&nbsp; WriterType;<br>&nbsp; <br>&nbsp; typedef itk::BinaryBallStructuringElement&lt; InputPixelType,Dimension&nbsp; &gt; StructuringElementType;<br>
&nbsp; <br>&nbsp; typedef itk::GrayscaleDilateImageFilter&lt;InputImageType, OutputImageType, StructuringElementType &gt;&nbsp; DilateFilterType;<br>&nbsp; <br>&nbsp; ReaderType::Pointer reader = ReaderType::New();<br>&nbsp; WriterType::Pointer writerDilation = WriterType::New();<br>
&nbsp;&nbsp;&nbsp; DilateFilterType::Pointer grayscaleDilate = DilateFilterType::New();<br>&nbsp; <br>&nbsp; StructuringElementType&nbsp; structuringElement;<br>&nbsp; structuringElement.SetRadius( 1 );&nbsp; <br>&nbsp; structuringElement.CreateStructuringElement();<br>
<br>&nbsp; reader-&gt;SetFileName( argv[1] );&nbsp;&nbsp; <br>&nbsp; <br>&nbsp; grayscaleDilate-&gt;SetKernel( structuringElement );<br>&nbsp; grayscaleDilate-&gt;SetInput( reader-&gt;GetOutput() );<br>&nbsp; grayscaleDilate-&gt;Update();<br>&nbsp; <br>&nbsp; writerDilation-&gt;SetFileName( argv[2] );<br>
&nbsp; writerDilation-&gt;SetInput( grayscaleDilate-&gt;GetOutput() );<br>&nbsp; writerDilation-&gt;Update();<br>&nbsp; <br><br>Is there any example how to do it?<br>Best regards<br>Albert<br>