[Insight-users] NeighborhoodOperator

Joshua Cates cates at sci.utah.edu
Fri Sep 2 14:00:23 EDT 2005


Hi Franz,

In your case you would use the CreateToRadius() method and document that the 
CreateDirectional() is not valid for your operator.  You might consider throwing 
an exception if CreateDirectional() is called.

Josh.


l franz wrote:
> 
> 
> On 9/2/05, *Joshua Cates* <cates at sci.utah.edu 
> <mailto:cates at sci.utah.edu>> wrote:
> 
>     Hi Franz,
> 
>     There are, in fact, no such methods as GenerateScalarCoefficients() and
>     ScalarFill().  The documentation is in error.  You should implement
>     the methods
>     GenerateCoefficients() and Fill() instead.
> 
>     There is no requirement that the neighborhood operator be directional.
>     GenerateCoefficients() takes no input and returns a vector of the
>     coefficients
>     used in your operator.  Fill() takes that vector of coefficients as
>     the argument
>     and positions them spatially in the operator (which is, itself, a
>     neighborhood
>     data structure).
> 
>     For example, if you simply wanted to sum all of the values in a
>     neighborhood,
>     your GenerateCoefficients() method would return the vector
>     {1,1,1,1, ..., 1}.  The Fill() method would simply copy those values
>     into the
>     operator.
> 
>     Hope this helps,
> 
>     Josh.
> 
>     l franz wrote:
>      > Hi everybody,
>      >
>      > I want to create a neighborhood operator which inherits of
>      > "NeighborhoodOperator" class. My operator will weight each pixels
>     of a
>      > NDimensional neighborhood through a kind of inner product (the
>     output of
>      > this inner product will be a neighborhood with weighted pixels).
>     So my
>      > operator performs on all the neighborhood (and not in a particular
>      > direction) and its size is equal to the neighborhood size.
>      >
>      > So, my operator is not directional. In this case and if I understand
>      > well the documentation, I have to implement two methods:
>      > 1. GenerateScalarCoefficients
>      > 2. ScalarFill
>      >
>      > So, I don't need to implement the "GenerateCoefficients" and "Fill"
>      > methods (for directional operators) like in GaussianOperator or in
>      > DerivativeOperator.
>      >
>      > But, I don't know how to create the "GenerateScalarCoefficients" and
>      > "ScalarFill" methods. What do they have in input arguments? What
>     do they
>      > return? Do they have to call a particular method inherited from
>      > NeighborhoodOperator??
>      >
>      > I think that "GenerateScalarCoefficient" method is similar to
>      > "GenerateCoefficients" method. It takes no input argument and
>     return a
>      > "CoefficientVector" with the desired coefficients.
>      > But I have no ideas of how to implement the "ScalarFill" method.
>      >
>      > Does someone know about it? Or does anybody know where I can find an
>      > exemple of an non-directional neighborhood operator??
>      >
>      > Thanks,
>      > Cheers,
>      >
>      > Franz
>      >
>      >
>      >
>     ------------------------------------------------------------------------
> 
>      >
>      > _______________________________________________
>      > Insight-users mailing list
>      > Insight-users at itk.org <mailto:Insight-users at itk.org>
>      > http://www.itk.org/mailman/listinfo/insight-users
> 
>     --
>     Josh Cates
>     SCI Institute / School of Computing
>     University of Utah
>     801-595-9165
>     http:/www.sci.utah.edu/~cates
> 
> 
> 
> Thanks for your help Josh. That light me a lot.
> 
> But I still have a little question. I have implemented a 
> "GenerateCoefficients()" and Fill()" methods. If I take in exemple the 
> way a directional operator (Gaussian or Derivative Operator) is used, 
> the coefficients are computed when the "CreateDirectional()" method is 
> called. This last method is inherited form the "NeighborhoodOperator" class.
> 
> In fact, the "CreateDirectional()" method will call the 
> "GenerateCoefficients()" and "Fill()" method that have been implemented. 
> But this "CreateDirectional()" method needs the "m_Direction" variable 
> (see NeighborhoodOperator.txx line 64). This last variable can be set by 
> the "SetDirection(unsigned int)" method.
> 
> In my case, I don't have a directional operator. So it's not 
> representative to set a direction.
> 
> So, have I the obligation to use the "CreateDirectional()" method to 
> generate the coefficients? Or perhaps another method (perhaps 
> "CreateToRadius" method).
> 
> And if I have to use the "CreateDirectional()" method, what would the 
> direction to set? Can I simply "forget" to set the direction? (I think 
> no...)
> 
> Thanks for your help,
> 
> Cheers,
> 
> Franz 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

-- 
Josh Cates
SCI Institute / School of Computing
University of Utah
801-595-9165
http:/www.sci.utah.edu/~cates


More information about the Insight-users mailing list