[Insight-users] Very Basic ITK Question
Luis Ibanez
luis.ibanez at kitware.com
Sun Jan 27 08:45:02 EST 2008
Hi Rashdek,
1) You should have posted in your email the typedefs that you
used for declaring the GaussianDerivativeImageFunction
type...
If you want to have consistent types, you must use the
traits of the classes.
In your particular case, instead of declaring the PointType
on your own, you should use the PointType trait, like in the
following code:
typedef itk::Image< char, 3 > ImageType;
typedef itk::GaussianDerivativeImageFunction<
ImageType, double > GaussianDerivativeFunctiontType;
GaussianDerivativeFunctiontType::Pointer function =
GaussianDerivativeFunctiontType::New();
function->SetImage( reader->GetOutput() );
function->SetSigma( 1.8 );
typedef GaussianDerivativeFunctiontType::PointType PointType;
PointType point;
point[0] = 10.9;
point[1] = 20.7;
point[2] = 30.2;
typedef GaussianDerivativeFunctiontType::VectorType VectorType;
VectorType gradient = function->Evaluate( point );
Since the types PointType and VectorType were taken
directly from the GradientDerivativeFunction type
this ensures that all types will be consistent.
2) In order to compute the Hessian of an image you need the
Second derivatives. The GaussianDerivativeImageFunction
class will only compute the first derivatives. You may
have to modify the code of this class...
Regards,
Luis
-------------
rashedk wrote:
> Hi everyone,
>
> I am trying to Evaluate the Hessian at a 3D point. I am looking at these
> functions of GaussianDerivativeImageFunction
>
> virtual OutputType Evaluate (const InputType &input) const=0
> virtual TOutput Evaluate (const PointType &point) const=0
> virtual OutputType Evaluate (const PointType &point) const
>
> How do I use Evaluate?? I tried creating a 3D point using:
> typedef itk::Point< int, Dimension > PointType;
> PointType point;
> point[0] = 5; // x coordinate
> point[1] = 5; // y coordinate
> point[2] = 5; // z coordinate
>
> But when i feed this into Evaluate, it doesnt compile. It expects a
> PointType& and i can't seem to be able to convert PointType to PointType&
>
> Thanks,
> Rashed
>
>
More information about the Insight-users
mailing list