<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Richard,<br>
      <br>
      I don't have other staining.<br>
      <br>
      Thanks for your suggestion of a procedure.  I will have to study
      it and understand it, before I can comment on it.<br>
      <br>
      Gib<br>
      <br>
      On 23/05/2013 12:25 p.m., Richard Beare wrote:<br>
    </div>
    <blockquote
cite="mid:CA+V7QS_9HkJTPF_rNmNgbq2fMm-zsUjiNpg018Xwt1_n2-m1xw@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>
          <div>
            <div>Hi,<br>
            </div>
            I'm not sure I understand completely, but here's my
            suggestion of an approach. It may turn out to be easier if
            you have other staining too. <br>
            <br>
          </div>
          1) Segment the entire tissue - i.e generate one large object
          that contains all your small vessels and a boundary on your
          layer that you need to peel. More on how this might be
          achieved later.<br>
          <br>
        </div>
        2) Erode this object and use the eroded version to mask out the
        accidental staining - i.e. do the peeling. Then apply your
        normal segmentation to what is left.<br>
        <div><br>
           If you have another channel where all the tissue has contrast
          then segmenting the tissue will be relatively easy. Otherwise
          it will be a bit more of a challenge. My first guess if the
          latter is the case is to use 2 markers in a watershed. One
          marker will be the image border (definitely outside the
          tissue). Create the marker image as follows. <br>
        </div>
        <div>   a) Apply a large closing, say about 15% of the tissue
          size. This will connect your interior objects together.
          Threshold the result, choose the largest connected component,
          then erode that component a little to make sure it stays
          inside the tissue and use the result as your foreground
          marker. Use rectangular structuring elements for the closing
          so you can take advantage of fast operations.<br>
        </div>
        <div>   b) put the two markers together in an image such that
          they have different voxel values - i.e. image border has value
          2, inside marker from step a has value 1.<br>
          <br>
        </div>
        <div>Use the combined image as the marker image for the
          morphological markers filter, use the original as the control.
          You may need to smooth the original to close boundary gaps in
          faint areas. You shouldn't need to take a gradient because the
          staining forms a line which the watershed should find. <br>
          <br>
        </div>
        <div>Select the foreground label from the watershed result.
          Erode it a bit (you'll need to look to confirm how much).<br>
          <br>
        </div>
        <div>If there is a gap then the watershed will leak through, but
          this won't matter as you are going to erode the mask and areas
          with gaps don't need to be corrected anyway.<br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Thu, May 23, 2013 at 7:47 AM, Gib
          Bogle <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>I didn't think there would be a stock filter, but
                maybe somebody else has addressed this.<br>
                <br>
                I have attached a typical frame.  I can't show the
                wanted result, but I think it's obvious when you know
                that the interior of this piece of tissue has the blood
                vessels stained, while the faint rim is clearly not
                blood vessel.  The problem is that there will in general
                be many vessels stained to a similar intensity as this
                rim.<span class="HOEnZb"><font color="#888888"><br>
                    <br>
                    Gib</font></span>
                <div>
                  <div class="h5"><br>
                    <br>
                    On 23/05/2013 8:53 a.m., Dženan Zukić wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div class="gmail_default"
                        style="font-family:verdana,sans-serif;font-size:small">I
                        don't think there is any stock filter which does
                        what you want. And I still don't understand your
                        situation. Can you show us an example slice and
                        wanted result?</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On Wed, May 22, 2013 at
                        10:50 PM, Gib Bogle <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:g.bogle@auckland.ac.nz"
                            target="_blank">g.bogle@auckland.ac.nz</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000">
                            <div>The reason why I don't think erode will
                              work is that the part of the image that
                              contains the information of interest is
                              made up of many disconnected pieces, not
                              very different from the boundary layer
                              that I want to remove.  The only thing
                              that I can use to distinguish the pixels
                              that need to be removed is that they are
                              near the outside of the region.  If I
                              apply erosion I will remove many small but
                              important features (this is labelled
                              vasculature, and I do not want to lose
                              fine capillaries).<br>
                              <br>
                              Gib
                              <div>
                                <div><br>
                                  <br>
                                  On 22/05/2013 11:12 p.m., Dženan Zukić
                                  wrote:<br>
                                </div>
                              </div>
                            </div>
                            <div>
                              <div>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div class="gmail_default"
                                      style="font-family:verdana,sans-serif;font-size:small"><a
                                        moz-do-not-send="true"
href="http://www.itk.org/Doxygen/html/group__MathematicalMorphologyImageFilters.html"
                                        target="_blank">http://www.itk.org/Doxygen/html/group__MathematicalMorphologyImageFilters.html</a><br>
                                    </div>
                                    <div class="gmail_default"
                                      style="font-family:verdana,sans-serif;font-size:small"><br>
                                    </div>
                                    <div class="gmail_default"
                                      style="font-family:verdana,sans-serif;font-size:small">What


                                      you probably want to do is
                                      BinaryErode and BinaryDilate.</div>
                                  </div>
                                  <div class="gmail_extra"><br>
                                    <br>
                                    <div class="gmail_quote">On Wed, May
                                      22, 2013 at 7:04 AM, gib <span
                                        dir="ltr">&lt;<a
                                          moz-do-not-send="true"
                                          href="mailto:g.bogle@auckland.ac.nz"
                                          target="_blank">g.bogle@auckland.ac.nz</a>&gt;</span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote"
                                        style="margin:0 0 0
                                        .8ex;border-left:1px #ccc
                                        solid;padding-left:1ex">It's
                                        hard to know what to call the
                                        processing I want to apply.  I
                                        have a set<br>
                                        of biological images (actually a
                                        3D image, but for now I'm happy
                                        to process<br>
                                        the frames one-by-one) in which
                                        the region of interest has an
                                        irregular and<br>
                                        incomplete labelled layer around
                                        the boundary.  The staining of
                                        the layer<br>
                                        was unintended, and its presence
                                        interferes with the segmentation
                                        that I am<br>
                                        doing.  The part of the image
                                        that I want to extract is made
                                        up of many<br>
                                        disconnected objects, and there
                                        is not much difference in the
                                        intensity<br>
                                        ranges of the objects of
                                        interest and the unwanted edge.
                                         I am willing to<br>
                                        trim a few pixels off the
                                        boundary all the way around -
                                        this will not cause<br>
                                        much loss of information.  What
                                        I need is way to determine a
                                        sequence of<br>
                                        pixels that in some sense
                                        defines the extent of the
                                        labelled region in the<br>
                                        image, rather like a 2D shrink
                                        wrapping.  I could then use this
                                        to shave or<br>
                                        peel off the outer layer of
                                        pixels.<br>
                                        <br>
                                        Does this process have a name?
                                         Are there any existing filters
                                        or code to do<br>
                                        this?  Any clever suggestions (I
                                        have some ideas)?<br>
                                        <br>
                                        Thanks<br>
                                        Gib<br>
                                        <br>
                                        <br>
                                        <br>
                                        --<br>
                                        View this message in context: <a
                                          moz-do-not-send="true"
href="http://itk-insight-users.2283740.n2.nabble.com/Peel-an-image-tp7583137.html"
                                          target="_blank">http://itk-insight-users.2283740.n2.nabble.com/Peel-an-image-tp7583137.html</a><br>
                                        Sent from the ITK Insight Users
                                        mailing list archive at
                                        Nabble.com.<br>
_____________________________________<br>
                                        Powered by <a
                                          moz-do-not-send="true"
                                          href="http://www.kitware.com"
                                          target="_blank">www.kitware.com</a><br>
                                        <br>
                                        Visit other Kitware open-source
                                        projects at<br>
                                        <a moz-do-not-send="true"
                                          href="http://www.kitware.com/opensource/opensource.html"
                                          target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
                                        <br>
                                        Kitware offers ITK Training
                                        Courses, for more information
                                        visit:<br>
                                        <a moz-do-not-send="true"
                                          href="http://www.kitware.com/products/protraining.php"
                                          target="_blank">http://www.kitware.com/products/protraining.php</a><br>
                                        <br>
                                        Please keep messages on-topic
                                        and check the ITK FAQ at:<br>
                                        <a moz-do-not-send="true"
                                          href="http://www.itk.org/Wiki/ITK_FAQ"
                                          target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
                                        <br>
                                        Follow this link to
                                        subscribe/unsubscribe:<br>
                                        <a moz-do-not-send="true"
                                          href="http://www.itk.org/mailman/listinfo/insight-users"
                                          target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                                <br>
                                <br>
                              </div>
                            </div>
                            <span><font color="#888888">
                                <pre cols="80">-- 
Dr. Gib Bogle
Senior Research Fellow
Auckland Bioengineering Institute
University of Auckland
New Zealand

<a moz-do-not-send="true" href="http://www.bioeng.auckland.ac.nz" target="_blank">http://www.bioeng.auckland.ac.nz</a>

<a moz-do-not-send="true" href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>
(64-9) 373-7599 Ext. 87030
</pre>
                              </font></span></div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                  <br>
                  <pre cols="80">-- 
Dr. Gib Bogle
Senior Research Fellow
Auckland Bioengineering Institute
University of Auckland
New Zealand

<a moz-do-not-send="true" href="http://www.bioeng.auckland.ac.nz" target="_blank">http://www.bioeng.auckland.ac.nz</a>

<a moz-do-not-send="true" href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>
(64-9) 373-7599 Ext. 87030
</pre>
                </div>
              </div>
            </div>
            <br>
            _____________________________________<br>
            Powered by <a moz-do-not-send="true"
              href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
            <br>
            Visit other Kitware open-source projects at<br>
            <a moz-do-not-send="true"
              href="http://www.kitware.com/opensource/opensource.html"
              target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
            <br>
            Kitware offers ITK Training Courses, for more information
            visit:<br>
            <a moz-do-not-send="true"
              href="http://www.kitware.com/products/protraining.php"
              target="_blank">http://www.kitware.com/products/protraining.php</a><br>
            <br>
            Please keep messages on-topic and check the ITK FAQ at:<br>
            <a moz-do-not-send="true"
              href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
            <br>
            Follow this link to subscribe/unsubscribe:<br>
            <a moz-do-not-send="true"
              href="http://www.itk.org/mailman/listinfo/insight-users"
              target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="80">-- 
Dr. Gib Bogle
Senior Research Fellow
Auckland Bioengineering Institute
University of Auckland
New Zealand

<a class="moz-txt-link-freetext" href="http://www.bioeng.auckland.ac.nz">http://www.bioeng.auckland.ac.nz</a>

<a class="moz-txt-link-abbreviated" href="mailto:g.bogle@auckland.ac.nz">g.bogle@auckland.ac.nz</a>
(64-9) 373-7599 Ext. 87030
</pre>
  </body>
</html>