[Insight-users] How to create my own NeighborhoodOperator ?

Joshua Cates cates at sci . utah . edu
Thu, 12 Jun 2003 10:30:08 -0600


Hi R=E9mi,

The SetOperator method of this filter will accept any itkNeighborhood or
subclass of itkNeighborhood.  The simplest solution is just to create a
3x3 itkNeighborhood and fill it with your values.  Alternately you could
create a new itkNeighborhoodOperator subclass (see itkDerivativeOperator,
et al.).   Because the NeighborhoodOperator filter is doing inner products
you will need to flip the axes of your operator (kernel) to do convolution
filtering properly.


Josh.

______________________________
 Josh Cates
 School of Computer Science
 University of Utah
 Email: cates at sci . utah . edu
 Phone: (801) 587-7697
 URL:   http://www . sci . utah . edu/~cates


On Thu, 12 Jun 2003, SERIOT R=E9mi        DEC/SPUA/LTEC wrote:

> Hi all
>
> I would like to apply my own 3x3 operator with
> NeighborhoodOperatorImageFilter, but I don't how I can create this operat=
or.
>
>  I already write this code
>
>    std::vector< double > coeff(9);
>
>    double val =3D3D -(1-alpha) / (8*alpha);
>    for(int i=3D3D0; i<9; i++)
>  =09coeff[i] =3D3D val;
>    coeff[4] =3D3D 1/alpha;
>
>    itk::NeighborhoodOperatorImageFilter<ImageType, ImageType>::Pointer =
=3D
> filter
>      itk::NeighborhoodOperatorImageFilter<ImageType, ImageType>::New();
>
>    //filter->SetOperator( oper );
>    filter->SetInput( m_image );
>    filter->Update();
>
>  So could you explain me, how I can create the Neighborhood Operator
>
>  Thanks
>
> R=E9mi
> _______________________________________________
> Insight-users mailing list
> Insight-users at www . itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>