← Back to team overview

dolfin team mailing list archive

Re: [Fwd: Re: Image to Function data structure conversion]

 

> > > > Anders Logg wrote:
> > > > > How about adding ImageFunction to SpecialFunctions.h/cpp.
> > > > >
> > > > > It would require using the ITK C++ interface (I assume there is one),
> > > > > adding a check for ITK to the build system and a flag HAS_ITK.
> > > > >
> > > >
> > > > An ITK dependency sounds a bit specialised for DOLFIN to me. A good
> > > > candidate for a fenics-apps perhaps?
> > > >
> > > Garth
> > >
> > > Yes maybe, but it would be fun to be able to do things like
> > >
> > > f = ImageFunction("dolfin.jpg")
> > >
> > > and use as a right-hand side.
> >
> > I guess the data structure conversion will be much more comprehensive
> > than the discussed prototype sample for real world applications.
> > Having the itk-dolfin interface as a wrapitk module, and encapsulating
> > the itk dependencies as much as possible, would make life easier.
> > Don't forget that itk, and the family, are cmake-based, hopefully that
> > wouldn't be a problem for scons-oriented dolfin?
>
> That shouldn't be a problem as the two are built separately.

The interface includes headers from both libraries and has to be
linked to both. It seems configuring dolfin in cmake for itk is easier
than configuring itk in scons for dolfin, as the latter will require
setting many parameters already implemented in cmake. Once this is
compiled as a python module, you can have something like

f = itk.ImageToDolfinFunction("dolfin.jpg")

as you mentioned previously. Obviously, it you want to call this from
c++ you will need linking to both libraries again. It would be helpful
if you could have a look at my dofmap question.


Follow ups

References