Dear insight-users,<br><br>I would like to create a 3D Binary Cross Structuring Element, with size = 3x3x1 (i.e. radius = 1x1x0)<br><br>1) I tried to define different radius with this code:<br><br>// typedef itk::BinaryCrossStructuringElement<unsigned char,3> KernelType;<br>
//<br>// KernelType cross;<br>// KernelType::RadiusType crossRadius;<br>// crossRadius[0] = 1;<br>// crossRadius[1] = 1;<br>// crossRadius[2] = 0;<br>// cross.CreateStructuringElement();<br>
//<br>
// typedef itk::BinaryDilateImageFilter < InputImageType , OutputImageType , KernelType > DilateFilterType;<br>// DilateFilterType::Pointer binaryDilate = DilateFilterType::New( );<br>// binaryDilate->SetInput ( inputImage -> GetOutput( ) );<br>
// binaryDilate->SetKernel ( cross);<br>// binaryDilate->SetDilateValue ( 255 );<br><br clear="all">I tried also other radius, or to change the size with:<br><br>// KernelType::SizeType crossSize;<br>
// crossSize[0] = 3;<br>// crossSize[1] = 3;<br>// crossSize[2] = 1;<br><br>but I always obtain a dilation with size = 3x3x3 (i.e. radius = 1x1x1)<br><br>2) I also tried to create my structuring element from an image (as it was advised in a precedent message in this mailing list) which is an image 3x3x1 whom pixels are =1 for (x=1) OR (y=1)<br>
<br>imageKernal is the image 3x3x1 of my structuring element.<br><br>// typedef itk::FlatStructuringElement<3> SEType;<br>// SEType K;<br>// K = SEType::FromImage < InputImageType > ( imageKernel->GetOutput( ) );<br>
// InputImageType ::Pointer kernelImage = K.GetImage < InputImageType > ( );<br>//<br>// binaryDilate->SetInput(unsignedCharImageContour->GetOutput());<br>// binaryDilate->SetKernel(kernelImage);<br>
// binaryDilate->SetDilateValue( 255 );<br><br>but FromImage is not a member of itk::FlatStructuringElement.<br><br>So, is it possible to create our own 3D structuring element, directly in ITK or from an image?<br>
<br>Any help will be greatly appreciated,<br><br>Best regards,<br><br>Cyril.<br><br><br><br><br><br><br>