<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div id="yiv7152313506"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">Hi Richard,<br clear="none"><br clear="none"> Thank you for your reply. That works. My dilema was which member variable allows me to set a radius and which one allows me to set the dimension. Dimension is inherent for flat structural type. Your reply clarifies that.<br><br>thanks,<br>Emma<br clear="none"><br clear="none"><br clear="none"><div id="yiv7152313506yui_3_13_0_ym1_7_1392840705659_11"><span><br clear="none"></span></div><div class="yiv7152313506yqt4015508266" id="yiv7152313506yqt86336"><div class="yiv7152313506yahoo_quoted" id="yiv7152313506yui_3_13_0_ym1_7_1392840705659_13" style="display: block;"> <br
clear="none"> <br clear="none"> <div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3461" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3462" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Tuesday, February 11, 2014 5:16 PM, Richard Beare <richard.beare@gmail.com> wrote:<br clear="none"> </font> </div> <div class="yiv7152313506y_msg_container"><div id="yiv7152313506"><div><div dir="ltr">Hi,<div>Assuming that you want a line parallel to one of the axis, then your best bet is probably to start with the box element, as you have. I think it is meant to fall through the zero dimensions. You'll need to confirm this.</div>
<div><br clear="none"></div><div>The polygon structuring element and box structuring elements both use line structuring elements internally.</div><div><br clear="none"></div><div>Structuring element code can look something like this:</div><div><br clear="none">
</div><div><div> typedef itk::FlatStructuringElement< 2 > SRType;</div><div><br clear="none"></div><div> // rad will be length 2</div><div> SRType::RadiusType rad ;</div><div><br clear="none"></div><div> // individually set elements - .Fill will set them all</div>
<div> rad[0]=5;</div><div> rad[1]=0;</div><div><br clear="none"></div><div> // now create a box element with these sizes</div><div> SRType kernel;</div><div><br clear="none"></div><div> kernel = SRType::Box(rad);</div></div><div><br clear="none"></div><div>
// use it with a filter</div><div><div> typedef typename itk::GrayscaleErodeImageFilter<TImage, TImage, SRType> FiltType;</div><div> typename FiltType::Pointer filt = FiltType::New();</div><div> filt->SetInput(input);</div>
<div> filt->SetKernel(kernel);</div><div><br clear="none"></div><div> filt->SetAlgorithm(FiltType::VHGW);</div><div><br clear="none"></div></div></div><div class="yiv7152313506gmail_extra"><br clear="none"><br clear="none"><div class="yiv7152313506gmail_quote">On Wed, Feb 12, 2014 at 11:42 AM, Emma Ryan <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:eryanvtk@yahoo.com" target="_blank" href="mailto:eryanvtk@yahoo.com">eryanvtk@yahoo.com</a>></span> wrote:<br clear="none">
<blockquote class="yiv7152313506gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv7152313506yqt8427133361" id="yiv7152313506yqt56247"><div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3465" style="font-size:12pt;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><div>
Hi,</div><div><br clear="none"></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3466" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"> How does one create a line structuring element. I would like to create a [1, 5] size vector so to speak and use that as a structuring element.</div>
<div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3467" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;">I guess I have to use itk::FlatStructuringElement<2> <span> and StructuringElementType::Box(..)</span></div>
<div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3468" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><br clear="none"><span></span></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3469" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;">
<span>But beyond that, how does one set the size ? From a default radius of 1 (3 x 3) I would like a (1 x 5) or should it be (0 x 5) size structural element.</span></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3470" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;">
<br clear="none"></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3471" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;">The following does not work. It gives a syntax error on SetSize and frankly I
dont think syntax is the only issue.<br clear="none"></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3472" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><br clear="none"></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3473" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;">
<br clear="none"><span></span></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3474" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><span>unsigned int radius = 2;<br clear="none"> typedefe itk::Size<2> SizeType;<br clear="none">
SizeType strelSize;<br clear="none"> strelSize[0] = 1;<br clear="none"> strelSize[1] = 5;<br clear="none"><br clear="none"> typedef itk::FlatStructuringElement<2>
StructuringElementType;<br clear="none"> StructuringElementType::RadiusType elementRadius;<br clear="none"> elementRadius.Fill(2);<br clear="none"> elementRadius.SetSize(strelSize);<br clear="none"> StructuringElementType strel = StructuringElementType::Box(elementRadius);<br clear="none">
</span></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3475" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><span><br clear="none"></span></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3476" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;">
<br clear="none"><span></span></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3477" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><span>thank
you,</span></div><div class="yiv7152313506yui_3_13_0_ym1_1_1392840705659_3478" style="font-style:normal;font-size:16px;background-color:transparent;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><span>Emma<br clear="none"></span></div></div></div></div><br clear="none">_____________________________________<br clear="none">
Powered by <a rel="nofollow" shape="rect" target="_blank" href="http://www.kitware.com/">www.kitware.com</a><br clear="none">
<br clear="none">
Visit other Kitware open-source projects at<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br clear="none">
<br clear="none">
Kitware offers ITK Training Courses, for more information visit:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a><br clear="none">
<br clear="none">
Please keep messages on-topic and check the ITK FAQ at:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br clear="none">
<br clear="none">
Follow this link to subscribe/unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br clear="none"><br clear="none"></div> </div> </div> </div></div> </div></div></div></div></body></html>