The ITK filter description XML file describes a filter's inputs, outputs, parameters, parameter modifying member functions, templated data types, and other filter information. This file contains no SCIRun specific information.
ITK filter description files are located in directory SCIRun/src/Packages/Insight/ITK. ITK filter description files follow the naming convention:
for example:
The following XML code illustrates the overall content of an ITK filter description file:
Each element is discussed below.
Element <filter-itk> is the top-level element. All other elements are enclosed in element <filter-itk>. The value of the required ``name'' attribute is the qualified C++ filter name.
For example:
Element <description> should provide a short (several sentences) filter description.
For example:
ITK filters are templated (parameterized) C++ classes and generally support one or two template parameters. The <templated> element describes a filter's template information. Specifically, <templated> contains elements that name a filter's template parameters and list suitable data types for filter instantiations.
Each <template> element declares and names a template parameter. Template parameter names may be used in subsequent <input> and <output> elements--see below.
Each <defaults> element corresponds to one filter class instantiation. Each <default> element names a type that corresponds (in order) with previous <template> elements.
For example, the following <templated> element:
corresponds to filter class template:
and filter type instantiation:
Note that characters ``<'' and ``>'' cannot be typed literally into an XML file. The character entities '<' and '>', respectively, must be used.
A <template> element and its corresponding <default> element can describe a parameterized built-in value. In this case, a <template> element's ``type'' attribute specifies a C++ built-in type, and a corresponding <default> element specifies the type's value:
A SCIRun filter module knows all possible filter instantiations. When executed at runtime, a module uses the filter instantiation with data input and output types matching data types passing through the module's input and output ports.
Element <datatypes> declares filter parameter data types that are not C++ built-in types. Names of declared data types are used in <parameter> elements that describe filter parameters (see Element). <parameters>). Element <datatypes> is optional, it is needed only when a parameter is not a C++ built-in type.
The structure of the <datatypes> element follows:
where data_type_element is the name of a data type element.
Each <data_type_element> describes the properties of one data type. Element <datatypes> enclose one or more data type elements.
At this time, element <array> is the only supported data type element. The array-like type described by element <array> is subject to the following conditions:
The structure of element <array> follows:
Attribute name specifies the name of an array-like data type. ``FilterType'' is a pseudo qualifier. It represents the full templated type of the current filter. FilterType is used in place of the full template name, for example, itk::MeanImageFilter<InputType,OutputType>. Data_type_name is the name of a type declared or typedef'ed in the filter's class declaration.
Element <elem-type> specifies the array's element type. Built-in_type is a C++ built-in type.
Element <size-call> specifies the name of a member function that returns the number of elements in the array.
An example <datatypes> element with an <array> sub-element follows:
FilterType::InputSizeType can be used in a subsequent <param> element.
The <inputs> element describes data types accepted by a filter's input ports, and member functions used to establish input port connections:
For example:
Element <input> declares one filter input. The name attribute names an input. The value of name names the corresponding SCIRun module input port. The value of name must be unique among all inputs.
Element <type> specifies the data type accepted by a filter's input port. Data_type_name can be a name declared in a <template> element (as shown above), or a parameterized data type with parameter names declared in a <template> element. For example, the following template element associates type float with name ScalarType:
and ScalarType is used as a template parameter in the following <inputs> element:
Element <call> specifies a member function (commonly SetInput) that establishes an input port connection.
The <outputs> element describes data types transmitted on a filter's output ports, and the member functions used to establish output port connections:
For example:
The name attribute names an output. The value of name names the corresponding SCIRun module output port. The value of name must be unique among all outputs.
Element <type> specifies the data type transmitted on a filter's output port. Data_type_name can be a name declared in a <template> element (as shown above), or a parameterized data type with parameter names declared in a <template> element.
Element <call> specifies the member function (commonly GetOutput) that establishes an output port connection. If <call> element's value is a member function returning a constant pointer, <call>'s const attribute must be set to the value ``yes'', for example:
A filter's parameters determine its behavior. Filter member functions change parameter values. The <parameters> element describes a filter's parameters:
Each <param> element describes one parameter with sub-elements <name>, <type>, <call>, and optional <default> providing the parameter's name, data type, corresponding member function, and optional initial value.
For example:
The content of element <type> is either a C++ built-in type or type declared in a <datatypes> element. Element <default> is optional.
If the ITK filter class macro itkBooleanMacro is used to create a boolean parameter, two <call> elements are needed; one for setting a true value, and one for setting a false value:
For example:
To modify the parameter, each parameter requires a GUI. If a GUI description file is not created, a default GUI is generated that associates a text entry widget with each filter parameter. SCIRun GUI Description illustrates writing a GUI description for a filter module. When writing a GUI description file, note that the value of the <name> element above must match the value of a corresponding <param> element's name attribute in the GUI description file.
Element <includes> lists ITK include files declaring filter classes and data types:
For example:
Ted Dustman 2005-06-22