[Insight-users] FastMarchingImageFilter: alternate solution

Lydia Ng lng at insightful . com
Wed, 30 Jul 2003 10:04:43 -0700


Hi Mathias,

I am not sure when the fixes for the FastMarchingImageFilter can be
made, but if all you want is to generate a signed distance from a
circle/sphere then a SphereSignedDistanceFunction and
SpatialFunctionImageEvaluatorFilter could serve that purpose. Example
code below:
 =20
typedef
itk::SpatialFunctionImageEvaluatorFilter<ShapeFunctionType,InternalImage
Type,InternalImageType>
    EvaluatorType;
  EvaluatorType::Pointer evaluator =3D EvaluatorType::New();

  typedef
itk::SphereSignedDistanceFunction<double,Dimension,InternalImageType>
ShapeFunctionType;
  ShapeFunctionType::Pointer shape =3D ShapeFunctionType::New();

  ShapeFunctionType::Parameters parameters(
shape->GetNumberOfParameters() );
  parameters[0] =3D 5; // the radius
  parameters[1] =3D 50; // sphere center
  parameters[2] =3D 50; // sphere center
 =20
  shape->SetParameters( parameters );
  shape->Initialize();

  // the input image doesn't do anything expect to provide meta
information:
  // spacing, origin and largestpossible region
  evaluator->SetInput( geodesicActiveContour->GetFeatureImage() );=20

  // connect up the shape function
  evaluator->SetFunction( shape );

 =20
  evaluator->Update();


Hope this helps.
- Lydia

> -----Original Message-----
> From: Lydia Ng
> Sent: Wednesday, July 30, 2003 9:52 AM
> To: Mathias Seitel; ITK Mailing List
> Subject: RE: [Insight-users] FastMarchingImageFilter
>=20
> Hi Mathias,
>=20
> You are correct in your summation that the FastMarchingImageFilter
does
> not have methods for
> - specifying the output origin or spacing
> - specifying the starting index of the output region
>=20
> Thanks for the bug report and we'll look into it.
>=20
> Thanks,
> Lydia
>=20
> > -----Original Message-----
> > From: Mathias Seitel [mailto:mathias . seitel at igd . fhg . de]
> > Sent: Wednesday, July 30, 2003 6:07 AM
> > To: ITK Mailing List
> > Subject: [Insight-users] FastMarchingImageFilter
> >
> > Hi all,
> >
> > FastMarchingImageFilter produces an initial level set, the size of
> which
> > can be set manually. When using it as input for e.g.
> > GeodesicActiveContoursImageFilter, along with a feature image of the
> > same size a problem seems to occur if
> > 1) the feature image has an image index !=3D (0, 0, 0) in 3D or,
> > 2) the feature image origin and spacing are not (0.0, 0.0, 0.0) and
> > (1.0, 1.0, 1.0), respectively.
> >
> > In particular, there are no methods in FastMarchingImageFilter for
> > setting index, origin and spacing of the output image manually. The
> > output of FastMarchingImageFilter could be corrected accordingly, by
> > explicitly setting the missing values. However, this does not work
> when
> > Update() is called on a subsequent filter in the filter pipeline,
> since
> > in this case the output of the filter is only an intermediate step
and
> > cannot be intercepted by the user.
> >
> > Am I missing something?
> >
> > Thanks,
> > Mathias
> >
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk . org
> > http://www . itk . org/mailman/listinfo/insight-users
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users