Integration of Fuzzy Mathematical Morphology and Fuzzy Spatial Relationships into ITK

. The aim of this paper is to present the integration of new (cid:12)l-ters computing fuzzy mathematical morphology and spatial relationships into ITK and to share our experience with the Open source community. Our implementation architecture follows the essential system concepts of ITK. An illustrative application is provided to help ITK users and developers to evaluate the capabilities of these (cid:12)lters.


Introduction
Imprecision is often inherent to images, and its causes can be found at several levels.It is related to image objects, their spatial relationships, as well as generic knowledge used for their recognition (for instance anatomical textbooks describe the caudate nucleus as "an internal brain structure which is very close to the lateral ventricles").The fuzzy set theory framework offers many interesting features to represent spatial imprecision, imprecision in knowledge description and to define vague relationships.It offers also a large set of fusion operators and decision making tools.All these features constitute the main ingredients of a recognition or spatial reasoning system.In some previous works, several tools dealing with fuzzy spatial objects have been defined, based on fuzzy mathematical morphology [1] and information fusion [2].A review of the main developments on fuzzy spatial relationships can be found in [3].
Medical image processing constitutes a particularly fertile field for the development of open-source libraries and free software tools because of the constant demand from the community of clinical users, who use these tools to integrate newly developed imaging modalities for their research.Examples include the fast development of functional MRI via the FSL and the SPM software tools, routinely used in clinical institutions worldwide.In 1999 the US National Library of Medicine of the National Institute of Health initiated the development of the open-source Insight Toolkit (ITK) for registration and segmentation of medical images.Current major foundation libraries for open-source development include Itk, Fltk, Vtk, Cmake, CVS and Cygwin.
However, only few computational tools dealing with imprecision have been incorporated into open-source software until now.In this paper, we present an implementation of fuzzy mathematical morphology, fuzzy fusion, and some fuzzy spatial relationships into ITK, along with an illustrative application.

Fuzzy mathematical morphology and spatial relations
An imprecise image object can be modeled as a fuzzy object, i.e. as a fuzzy set defined on the considered space.The membership value of each point represents the degree to which the point belongs to the fuzzy object.Defining spatial relations between such objects becomes then a matter of degree.Additionnally, some relations (such as "close to") are intrinsically vague and are appropriately defined in a fuzzy framework, even between crisp objects.
Several definitions of mathematical morphology operators on fuzzy sets with fuzzy structuring elements have been proposed in the literature.Here we use the approach using t-norms and t-conorms as fuzzy intersection and fuzzy union rules [1].Erosion and dilation of a fuzzy set µ by a fuzzy structuring element ν, both defined in a space S, are respectively defined as where is a t-norm, c a fuzzy complementation, and ⊥ is the t-conorm associated to with respect to c.These definitions guarantee that most properties of morphological operators are preserved.
Two types of questions are raised when dealing with spatial relationships: (i) given two objects (possibly fuzzy), assess the degree to which a relation is satisfied; (ii) given one reference object, define the area of space in which a relation with respect to this reference object is satisfied (to some degree).The proposed fuzzy mathematical morphology operators can answer both types of questions.In particular, fuzzy dilation allows us to define in an elegant and consistent way topological relations (set theoretical relationships, adjacency), and metric relations such as distances and relative directional direction.For instance, the area being on the "right" of a reference object is defined as a fuzzy dilation of this object by a directional fuzzy structuring element modeling the intrinsic vagueness attached to the relation.Formal definitions and properties are ommitted here, but can be found in [3] and in the references mentioned therein.

New ITK fuzzy filters
Our implementation follows essential system concepts of ITK: Generic programming, smart pointers, objects factories, event management, and multithreading [4].Using Object Oriented Programming (OOP) paradigms such as "inheritance", all the operators presented above are implemented as filters according to ITK filter development philosophy and specialized superclasses already defined in ITK (cf.Fig. 1, 2).
Fuzzy mathematical morphology operators can be implemented in a similar fashion as classical mathematical morphology.In OOP, this observation could be modeled using the inheritance paradigm.ITK implements mathematical morphology filters using NeighborhoodIterators.The toolkit contains two types of image morphology filters, operating on binary images or grayscale images.Mathematical morphology operations are implemented by applying an operator (or rule) over the neighborhood of each pixel.The implementation of fuzzy mathematical morphology operators follows the same philosophy with two main differences: (1) the structuring element is implemented as a NeighborhoodOperator which contains float data representing membership values; (2) the classical min and max rules are generalized with t-norm or t-conorm operations (cf.Fig. 1).This is achieved by exploiting the "template" generic programming concept: the rule was implemented as a template function which was instanciated at compilation.
Fusion operators has been integrated into itk::Functor namespace, and their corresponding filters have been implemented as itk::BinaryFunctorImageFilter.This approach allows the user to choose the appropriate fusion operation, for instance for combining several spatial relations to a reference object.Directional relations can be defined and implemented as fuzzy dilation.However this implementation can be very time consuming, especially in 3D.To overcome this limitation, an approximate method using a fast propagation algorithm can be used [5].This algorithm has been implemented as an itk::ImageToImageFilter (cf.Fig. 2), to compute the "fuzzy landscape" associated with a given direction.The method consists in looking at the angle from which a background point is seen from an object point in a direction which is the closest to the given direction.The direction is defined with two angles in 3D.
The fuzzy distance relationship to a binary object is obtained by combining a fuzzy membership function (representing the imprecision in the distance knowledge) to a distance map.We used the Danielsson distance implemented in ITK.Different fuzzy membership functions were obtained using the itk::FuzzyMembershipGenerator.

Illustrative application
Fuzzy mathematical morphology and spatial relationships are powerful tools for image understanding and structural shape recognition.We present an application which summarizes all the concepts we developed and integrated into ITK.It is related to the segmentation of internal brain structures following the methode introduced in [6].The scope here is not to provide a segmentation of these structures but to show how spatial relationships can be used under ITK to constrain a deformable model based segmentation framework.Given a reference object we can build a fuzzy landscape corresponding to the area of space satisfying some specific spatial relations to it.This fuzzy landscape can then define: (1) a speed term which is combined to an advection term in a geodesic level set framework; (2) an external force added to the external force field applied to a parametric deformable model; (3) or a mask for selecting a region of interest.Figure 3 illustrates this computational paradigm.

Conclusion and perspectives
We have shown in this paper how to introduce new computational tools based on fuzzy set theory into ITK and illustrated their usefulness.Current work focuses on Java based ITK development and the connexion of Java-ITK to the open source graph manipulation library JUNG to perform dynamic graph-based segmentation tools.

Fig. 3 .
Fig. 3. (a) Brain data (a slice of 3D MRI).(b) The right ventricle: reference object.(c) Fuzzy landscape representing the relation "the right caudate nucleus is to the right of the right ventricle".(d) Fuzzy landscape representing the relation "the right caudate nucleus is close to the right ventricule".(e) Fusion of the two relations "to the right of" and "close to".(f) Initialization of the level set computed from thresholding the fuzzy landscape of Figure (e).(g) Speed image computed from the combination of the speed fuzzy landscape image and the sigmoid of the initial image.(h) The right caudate nucleus segmentation using a geodesic level set algorithm, constrainted by spatial relations.(i) Superimposition of the segmentation results.