Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.
-
date post
22-Dec-2015 -
Category
Documents
-
view
219 -
download
3
Transcript of Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.
![Page 1: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/1.jpg)
Integration of ITK IntoSCIRun
Yarden Livnat
Darby Van Uitert
Joshua Cates
![Page 2: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/2.jpg)
Aims
Integrate ITK into SCIRun No changes to ITK Minimal changes to SCIRun Easy to apply to all old and new ITK
filters
![Page 3: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/3.jpg)
The Players
SCIRun
![Page 4: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/4.jpg)
The Players
Anisotropic DiffusionFilter Parameters
SCIRun ITK
Filter
Filter
Watershed Filter
![Page 5: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/5.jpg)
Proposed Solution
ITK Filter
Automated as much as possible
GUI
![Page 6: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/6.jpg)
XML
itk_filter.xml XSL sci_filter.h sci_filter.cc
sci_filter.tcl sci_filter.xml
![Page 7: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/7.jpg)
XML
itk_filter.xml XSL sci_filter.h sci_filter.cc
sci_filter_gui.xml XSL
sci_filter.tcl
sci_filter.tcl sci_filter.xml
![Page 8: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/8.jpg)
XML
itk_filter.xml XSL sci_filter.h sci_filter.cc
sci_filter_gui.xml XSL
sci_filter.tcl
sci_filter.tcl sci_filter.xml
sci_filter_gui.xmlsci_filter_gui.xml
sci_filter_gui.xmlsci_filter_gui.xml
GUIGUI
GUIGUI
![Page 9: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/9.jpg)
XML
itk_filter.xml XSL sci_filter.h sci_filter.cc
sci_filter_gui.xml XSL
sci_filter.tcl
sci_filter.tcl sci_filter.xml
sci_filter.xml XSL:
include files, more instantiation information
![Page 10: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/10.jpg)
Templated Filters
1) One module per instantiation
Trivial
2) Switch statement
Instantiation information in an XML file to be used during code generation
3) Dynamic Compilation Non-templated base classes
![Page 11: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/11.jpg)
Summary
XML Files – 3 per filter
itk_filter.xml created by ITK developers
sci_filter.xml created by developer/ITK user
sci_filter_gui.xml created by developer/ITK user
Validated with DTD !
![Page 12: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/12.jpg)
Summary
XML Files – 3 per filter
itk_filter.xml created by ITK developers
sci_filter.xml created by developer/ITK user
sci_filter_gui.xml created by developer/ITK user
Validated with DTD !
![Page 13: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/13.jpg)
Summary
XML Files – 3 per filter
itk_filter.xml created by ITK developers
sci_filter.xml created by developer/ITK user
sci_filter_gui.xml created by developer/ITK user
XSL Files – 3 per system
GenerateCC.xsl created by us for
GenerateTCL.xsl generating our
GenerateXML.xsl specific code
Validated with DTD !
![Page 14: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/14.jpg)
Adding a New Filter
ReflectImageFilter
Steps: Write itk_ReflectImageFilter.xml Write basic sci_ReflectImageFilter.xml Generate module Write gui_ReflectImageFilter.xml
![Page 15: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/15.jpg)
Example – itk_filter.xml<filter-itk name=“itk::ReflectImageFilter”>
<description> Reflects an image along a selected direction. </description>
<templated> … </templated>
<inputs> … </inputs>
<outputs> … </outputs> <parameters> … </parameters>
<includes> … </includes></filter-itk>
![Page 16: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/16.jpg)
Example – itk_filter.xml<filter-itk name=“itk::ReflectImageFilter”>
<description> Reflects an image along a selected direction. </description>
<templated> … </templated>
<inputs> … </inputs>
<outputs> … </outputs> <parameters> … </parameters>
<includes> … </includes></filter-itk>
<templated>
<template>InputImageType</template>
<template>OutputImageType</template>
<defaults>
<default> itk::Image< float, 2> </default>
<default> itk::Image< float, 2> </default>
</defaults>
</templated>
![Page 17: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/17.jpg)
Example – itk_filter.xml<filter-itk name=“itk::ReflectImageFilter”>
<description> Reflects an image along a selected direction. </description>
<templated> … </templated>
<inputs> … </inputs>
<outputs> … </outputs> <parameters> … </parameters>
<includes> … </includes></filter-itk>
<inputs>
<input name=“SourceImage” >
<type> InputImageType </type>
<call> SetInput </call>
</input>
</inputs>
![Page 18: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/18.jpg)
Example – itk_filter.xml<filter-itk name=“itk::ReflectImageFilter”>
<description> Reflects an image along a selected direction. </description>
<templated> … </templated>
<inputs> … </inputs>
<outputs> … </outputs> <parameters> … </parameters>
<includes> … </includes></filter-itk>
<parameters>
<param>
<name> direction </name>
<type> int </type>
<call> SetDirection </call>
</param>
</parameters>
![Page 19: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/19.jpg)
Example – itk_filter.xml<filter-itk name=“itk::ReflectImageFilter”>
<description> Reflects an image along a selected direction. </description>
<templated> … </templated>
<inputs> … </inputs>
<outputs> … </outputs> <parameters> … </parameters>
<includes> … </includes></filter-itk>
<includes>
<file> itkReflectImageFilter.h </file>
</includes>
![Page 20: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/20.jpg)
Example – sci_filter.xml
<filter name=“ReflectImageFilter”>
<include href=“” />
<filter-sci> … </filter-sci>
</filter>
![Page 21: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/21.jpg)
Example – sci_filter.xml
<filter name=“ReflectImageFilter”>
<include href=“” />
<filter-sci> … </filter-sci>
</filter>
<include href=“ITK/itk_ReflectImageFilter.xml”/>
![Page 22: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/22.jpg)
Example – sci_filter.xml
<filter name=“ReflectImageFilter”>
<include href=“” />
<filter-sci> … </filter-sci>
</filter>
<filter-sci name=“ReflectImageFilter”>
<package> Insight </package>
<category> Filters </category>
<instantiations use-defaults=“yes”/>
<includes>
<file>Packages/Insight/Dataflow/
Ports/ITKDatatypePort.h </file>
</includes>
</filter-sci>
![Page 23: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/23.jpg)
Generate Process
Steps for module generation Add to Dataflow/Modules/Filters/sub.mk Add to Dataflow/GUI/sub.mk
Module sub.mk
XMLS := \
sci_DiscreteGaussianImageFilter.xml \
sci_ReflectImageFilter.xml \
GUI sub.mk
$(SRCDIR)/tclIndex: \
$(SRCDIR)/Switch.tcl \
$(SRCDIR)/ReflectImageFilter.tcl \
![Page 24: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/24.jpg)
Sample Network
![Page 25: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/25.jpg)
Sample Network
Default GUI
![Page 26: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/26.jpg)
gui_ReflectImageFilter.xml
<filter-gui name=“ReflectImageFilterGUI”>
<parameters>
<param> … </param> <param> … </param>
</parameters>
</filter-gui>
![Page 27: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/27.jpg)
gui_ReflectImageFilter.xml
<filter-gui name=“ReflectImageFilterGUI”>
<parameters>
<param> … </param>
<param> … </param>
</parameters>
</filter-gui>
<param name= “direction” >
<gui> radiobutton </gui>
<values>
<val> 0 </val>
<val> 1 </val>
</values>
<default> 1 </default>
</param>
![Page 28: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/28.jpg)
Add GUI to sci_filter.xml
<filter name=“ReflectImageFilter”>
<include href=“” />
<filter-sci> … </filter-sci>
</filter>
<include href=“ITK/itk_ReflectImageFilter.xml”/>
sci_filter.xml
itk_filter.xml
![Page 29: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/29.jpg)
Add GUI to sci_filter.xml
<filter name=“ReflectImageFilter”>
<include href=“” />
<filter-sci> … </filter-sci>
</filter>
<include href=“ITK/itk_ReflectImageFilter.xml”/>
<include href=“Dataflow/Modules/Filters/XML/
gui_ReflectImageFilter.xml”/>
sci_filter.xml
itk_filter.xml
gui_filter.xml
![Page 30: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/30.jpg)
Sample Network
Defined GUI
![Page 31: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/31.jpg)
ITKDatatypeclass ITKDatatype : public Datatype
{
public:
string fname;
itk::Object::Pointer data_;
ITKDatatype():
ITKDatatype(const ITKDatatype);
~ITKDatatype();
virtual void io(Piostream&);
static PersistentTypeID type_id;
};
![Page 32: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/32.jpg)
Field and Image Conversion
SCIRun ITK
ITKField wrap Image
ITKField unwrap Image
Field copy data Image
ITKField wrap Image
![Page 33: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/33.jpg)
ITKLatVolField.htemplate<class Data>
class ITKLatVolField : public GenericField< LatVolMesh, ITKFData3d< Data > >
{
public:
ITKLatVolField();
ITKLatVolField(Field::data_location data_at);
ITKLatVolField(LatVolMeshHandle mesh, Field::data_location data_at);
ITKLatVolField(LatVolMeshHandle mesh, Field::data_location data_at, itk::Object* image);
void SetImage(itk::Object* image);.
.
.
private:
static Persistent* maker();
};
![Page 34: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/34.jpg)
ITKLatVolField.htemplate <class Data>class ITKFData3d {public:
typedef Data value_type;typedef itk::Image< Data, 3 > image_type;typedef ITKIterator< Data > iterator;typedef ITKConstIterator< Data > const_iterator;
iterator *begin_, *end_;const_iterator *const_begin_, *const_end_;
const iterator & begin() { return *begin_; }const iterator & end() { return *end_; }…const value_type &operator[]( LatVolMesh::Node::index_type idx) const;…void set_image(itk::Image< Data, 3 >* img);
private:typename image_type::Pointer image_;
};
![Page 35: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/35.jpg)
ITKLatVolField.htemplate <class Data>class ITKFData3d {public:
typedef Data value_type;typedef itk::Image< Data, 3 > image_type;typedef ITKIterator< Data > iterator;typedef ITKConstIterator< Data > const_iterator;
iterator *begin_, *end_;const_iterator *const_begin_, *const_end_;
const iterator & begin() { return *begin_; }const iterator & end() { return *end_; }…const value_type &operator[]( LatVolMesh::Node::index_type idx) const;…void set_image(itk::Image< Data, 3 >* img);
private:typename image_type::Pointer image_;
};
void set_image(itk::Image< Data, 3 >* img) {
image_ = img;
begin_ = new iterator(image_,
image_->GetRequestedRegion());
begin_->GoToBegin();
…
}
![Page 36: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/36.jpg)
Current ITK Filters
DiscreteGaussianImageFilter
GradientAnisotropicDiffusionImageFilter
CannySegmentationLevelSetImageFilter
GradientMagnitudeImageFilter
ReflectImageFilter
WatershedRelabeler
WatershedSegmenter
WatershedSegmentTreeGenerator
There are almost 200 filters
![Page 37: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/37.jpg)
Example Network
![Page 38: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/38.jpg)
Example Network
![Page 39: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/39.jpg)
Example Network
![Page 40: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/40.jpg)
Example Network
![Page 41: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/41.jpg)
Example Images
Source Image
Diffused Image
Segmented Image
![Page 42: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/42.jpg)
What’s Left to Do Finish recursive filters for ITK mini
pipeline
Enable complex GUI’s Have: Slider, Check and Radio ButtonNeed: Layout Manager
Port Issue – all are of type ITKDatatypeSame base class issue
Write DocumentationWrite more ITK filters
Filter
Filter
Watershed Filter
![Page 43: Integration of ITK Into SCIRun Yarden Livnat Darby Van Uitert Joshua Cates.](https://reader035.fdocuments.in/reader035/viewer/2022062516/56649d795503460f94a5c088/html5/thumbnails/43.jpg)
Issues
• Object base class (e.g. ImageReader )• SCIRun2
– Common Component Architecture (CCA)– Separable GUIs
• GTK• XML description
• Dynamic Compilation– TypeDescription– Compile_info
• Const pipes