<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
/* List Definitions */
@list l0
        {mso-list-id:73553525;
        mso-list-type:hybrid;
        mso-list-template-ids:126138518 -708933858 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Arial;
        mso-fareast-font-family:"Times New Roman";}
@list l1
        {mso-list-id:1405375105;
        mso-list-template-ids:67698725;
        mso-list-style-name:"1 \/ 1\.1 \/ 1\.1\.1";}
@list l1:level1
        {mso-level-text:%1;
        mso-level-tab-stop:.3in;
        mso-level-number-position:left;
        margin-left:.3in;
        text-indent:-.3in;
        mso-ansi-font-weight:bold;}
@list l1:level2
        {mso-level-text:"%1\.%2";
        mso-level-tab-stop:.4in;
        mso-level-number-position:left;
        margin-left:.4in;
        text-indent:-.4in;
        mso-ansi-font-weight:bold;}
@list l1:level3
        {mso-level-text:"%1\.%2\.%3";
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        margin-left:.5in;
        text-indent:-.5in;}
@list l1:level4
        {mso-level-text:"%1\.%2\.%3\.%4";
        mso-level-tab-stop:.6in;
        mso-level-number-position:left;
        margin-left:.6in;
        text-indent:-.6in;}
@list l1:level5
        {mso-level-text:"%1\.%2\.%3\.%4\.%5";
        mso-level-tab-stop:.7in;
        mso-level-number-position:left;
        margin-left:.7in;
        text-indent:-.7in;}
@list l1:level6
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6";
        mso-level-tab-stop:.8in;
        mso-level-number-position:left;
        margin-left:.8in;
        text-indent:-.8in;}
@list l1:level7
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7";
        mso-level-tab-stop:.9in;
        mso-level-number-position:left;
        margin-left:.9in;
        text-indent:-.9in;}
@list l1:level8
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8";
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        margin-left:1.0in;
        text-indent:-1.0in;}
@list l1:level9
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9";
        mso-level-tab-stop:1.1in;
        mso-level-number-position:left;
        margin-left:1.1in;
        text-indent:-1.1in;}
@list l2
        {mso-list-id:1890266351;
        mso-list-template-ids:67698719;
        mso-list-style-name:"1 \/ 1\.1 \/ 1\.1\.1";}
@list l2:level1
        {mso-level-tab-stop:.25in;
        mso-level-number-position:left;
        margin-left:.25in;
        text-indent:-.25in;}
@list l2:level2
        {mso-level-text:"%1\.%2\.";
        mso-level-tab-stop:.55in;
        mso-level-number-position:left;
        margin-left:.55in;
        text-indent:-.3in;}
@list l2:level3
        {mso-level-text:"%1\.%2\.%3\.";
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        margin-left:.85in;
        text-indent:-.35in;}
@list l2:level4
        {mso-level-text:"%1\.%2\.%3\.%4\.";
        mso-level-tab-stop:1.25in;
        mso-level-number-position:left;
        margin-left:1.2in;
        text-indent:-.45in;}
@list l2:level5
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.";
        mso-level-tab-stop:1.75in;
        mso-level-number-position:left;
        margin-left:1.55in;
        text-indent:-.55in;}
@list l2:level6
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.";
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        margin-left:1.9in;
        text-indent:-.65in;}
@list l2:level7
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.";
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        margin-left:2.25in;
        text-indent:-.75in;}
@list l2:level8
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.";
        mso-level-tab-stop:2.75in;
        mso-level-number-position:left;
        margin-left:2.6in;
        text-indent:-.85in;}
@list l2:level9
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9\.";
        mso-level-tab-stop:3.25in;
        mso-level-number-position:left;
        margin-left:3.0in;
        text-indent:-1.0in;}
@list l3
        {mso-list-id:2131971120;
        mso-list-type:hybrid;
        mso-list-template-ids:-393725334 -1699216390 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l3:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Arial;
        mso-fareast-font-family:"Times New Roman";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>Hi,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>I want to write a filter that has as input an image
and as output a spatial object. From my search, it appears that such a kind of
filter doesn’t exist. I’ve tried to written then one by
copying/modifying the ImageToMeshFilter family. I’ve have then :<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>- an itkSpatialObjectSource class<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>- an itkImageToSpatialObject class<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>The mesh family just call Update on the output which
is a mesh, and because it is derived from a pointset object the classical
triggering of region propagation region is done and the GenerateData() function
is called.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>The pb in case of SpatialObject is that Update()
simply notify a modification by calling this->Modified(), so the
GenerateData() is never called in my case. I’ve overwritten the Update()
method in my itkImageToSpatialObject class to force the GenerateData() call but
I am sure that:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>- my filter pipeline is not maintained correctly<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>- I may have memory leaks and memory release crash<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>Note that currently I do not care about the requested
region stuff, as I work in the whole image. Any reason why such a family of
filter is implemented, and there is a easy way to perfom it?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'>Thanks.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-HK style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoAutoSig><i><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-style:italic'>Best Regards,<o:p></o:p></span></font></i></p>
<p class=MsoAutoSig><i><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-style:italic'><o:p> </o:p></span></font></i></p>
<p class=MsoAutoSig><i><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-style:italic'>Jerome Schmid<o:p></o:p></span></font></i></p>
<p class=MsoAutoSig><i><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-style:italic'><o:p> </o:p></span></font></i></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-HK
style='font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>