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

Joshua Cates cates at sci . utah . edu
Fri, 13 Jun 2003 10:04:59 -0600 (MDT)


Hi R=E9mi,

Glad to hear the NeighborhoodOperator is working out.

In order to sort and merge watershed basins based on size you will have to
modify the itkWatershedSegmenter algorithm to keep track of basin sizes. =
=20
The initial size would need to be computed in the gradient descent step of
itkWatershedSegmenter and then updated and maintained during basin merge
operations.

An alternate approach of a one-time suppression of small basins in the
initial output might be interesting (but will result in a different
algorithm and I can't guarantee you won't get some undesirable grouping of
basins).  You could calculate the basin sizes from the the initial
segmentation (zero merge level output) of the WatershedSegmenter and then
use some of the existing code for basin merges (in
itkWatershedSegmentTreeGenerator, for example) to pre-merge the smaller
basins in the segment tree.

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


On Fri, 13 Jun 2003, SERIOT R=E9mi        DEC/SPUA/LTEC wrote:

>=20
> Thanks for your help Josh, I have my NeighborhoodOperator working fine no=
w.
> But I still need some help about Watershed Image Filter, because my
> segmentation is quite perfect and I just need to supress some small
> catchement bassin. As I already told you I try the Threshold parameter bu=
t I
> lost too much low contrast edges with this parameter.
>=20
> I think that with SegmentTree class I could sort those bassin by size but=
 I
> don't know how.
>=20
> I'm still a novice in itk so any suggestions will be appreciate
>=20
> Thanks for your help
>=20
> R=E9mi
>=20
> > -----Message d'origine-----
> > De : Joshua Cates [mailto:cates at sci . utah . edu]
> > Envoy=E9 : jeudi 12 juin 2003 18:30
> > =C0 : SERIOT R=E9mi DEC/SPUA/LTEC
> > Cc : 'insight-users at public . kitware . com'
> > Objet : Re: [Insight-users] How to create my own=20
> > NeighborhoodOperator ?
> >=20
> >=20
> > Hi R=E9mi,
> >=20
> > The SetOperator method of this filter will accept any=20
> > itkNeighborhood or
> > subclass of itkNeighborhood.  The simplest solution is just=20
> > to create a
> > 3x3 itkNeighborhood and fill it with your values. =20
> > Alternately you could
> > create a new itkNeighborhoodOperator subclass (see=20
> > itkDerivativeOperator,
> > et al.).   Because the NeighborhoodOperator filter is doing=20
> > inner products
> > you will need to flip the axes of your operator (kernel) to=20
> > do convolution
> > filtering properly.
> >=20
> >=20
> > Josh.
> >=20
> > ______________________________
> >  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
> >=20
> >=20
> > On Thu, 12 Jun 2003, SERIOT R=E9mi        DEC/SPUA/LTEC wrote:
> >=20
> > > Hi all
> > >
> > > I would like to apply my own 3x3 operator with
> > > NeighborhoodOperatorImageFilter, but I don't how I can=20
> > create this operator.
> > >
> > >  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,=20
> > ImageType>::Pointer =3D
> > > filter
> > >      itk::NeighborhoodOperatorImageFilter<ImageType,=20
> > 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
> > >
> >=20
>=20