<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hui,<br>
    <br>
    It would be really nice if you could contribute your code to the
    community via an Insight Journal.<br>
    <br>
    &nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.insight-journal.org/">http://www.insight-journal.org/</a><br>
    <br>
    You could explain your new term, and show how to use it in one
    example.<br>
    <br>
    I am sure there are people here who would be interested in such a
    new functionality, and see how complicated it is to create a new
    level set term.<br>
    It could even end up in ITK4 ;)<br>
    <br>
    Best,<br>
    Arnaud<br>
    <br>
    <br>
    On 10/02/2011 04:20 PM, Arnaud Gelas wrote:
    <blockquote cite="mid:4E88C770.1000702@hms.harvard.edu" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      Dear Hui,<br>
      <br>
      In ITK3, the "evolution" class inherits from a ProcessObject and
      you are right this is the typical way to add one more input to a
      filter, to benefit from ITK's pipeline architecture.<br>
      <br>
      Here, LevelSetEquationChanAndVeseInternalTerm inherits from
      LevelSetEquationTermBase, which inherits from Object. Thus a term
      is not a filter, there is no input, no output.<br>
      You can also add as many internal members. You can now decide what
      is going to be inside your term.<br>
      <br>
      You can definitively add another InputImagePointer m_MeanImage.<br>
      <br>
      BTW, are you hacking itkLevelSetEquationChanAndVeseInternalTerm.*
      ? <br>
      <br>
      Arnaud<br>
      <br>
      On 10/02/2011 04:03 PM, Hui Tang wrote:
      <blockquote
cite="mid:CAEz0C-54fPrah3ytBv5f-zAXnoAh1txZOydNY3qf3U4P2MCx3g@mail.gmail.com"
        type="cite">
        <div><font color="#000000">Dear Arnaud,</font></div>
        <div>&nbsp;</div>
        <div><font color="#000000">thanks for the quick reply!!!</font></div>
        <div>&nbsp;</div>
        <div><font color="#000000">Yes you are very right, I need to do
            that by m_Mean = m_MeanImage-&gt;GetPixel( iP ).</font></div>
        <div>&nbsp;</div>
        <div><font color="#000000">By the way in ITK3 I used <font
              size="2"><font size="2">this-&gt;ProcessObject::SetNthInput(1,InputImageType*

                image) to add one more image as input, but in ITK 4, it
                seems that ProcessObject is not a member function of <font
                  size="2"><font size="2">itkLevelSetEquationChanAndVeseInternalTerm

                    or <font color="#010001" size="2"><font
                        color="#010001" size="2">
                        <p>LevelSetEquationTermBase.</p>
                        <p>I guess I can add one more&nbsp; class member
                          InputImageType* m_MeanImage?</p>
                        <p>Thanks again for the reply.</p>
                        <p>&nbsp;</p>
                        <p>Best,</p>
                        <p>&nbsp;</p>
                        <p>Hui</p>
                      </font></font></font></font></font></font></font><font
            color="#000000"><br>
          </font></div>
        <div><font color="#000000">Please, let us know if it works.</font></div>
        <div><font color="#000000"><br>
            <br>
          </font></div>
        <div class="gmail_quote"><font color="#000000">On Sun, Oct 2,
            2011 at 9:21 PM, Arnaud Gelas <span dir="ltr">&lt;<a
                moz-do-not-send="true"
                href="mailto:Arnaud_Gelas@hms.harvard.edu">Arnaud_Gelas@hms.harvard.edu</a>&gt;</span>
            wrote:<br>
          </font>
          <blockquote style="border-left: 1px solid rgb(204, 204, 204);
            margin: 0px 0px 0px 0.8ex; padding-left: 1ex;"
            class="gmail_quote">
            <div style="word-wrap: break-word;"><font color="#000000">Hi
                Hui, </font>
              <div><br>
              </div>
              <div><font color="#000000">The principle of Chan and Vese
                  formulation is to assume there are two parts in your
                  image: background and foreground and each of them are
                  represented by a constant mean value.</font></div>
              <div><font color="#000000">In the implementation, we did
                  follow the same principle, e.g. the mean is a scalar
                  if you are working with scalar images, a vector if you
                  are working with vector images, etc.</font></div>
              <div><font color="#000000"><br>
                </font></div>
              <div><font color="#000000">So, now you want to create a
                  new term / formulation (there might be a specific name
                  for that, but I am not aware of it).</font></div>
              <div><font color="#000000">Once you provide the mean
                  image, you need to replace m_Mean by the pixel value
                  for the given input location iP. In your special case,
                  most likely you would only need to change m_Mean by
                  m_MeanImage-&gt;GetPixel( iP )</font></div>
              <div><font color="#000000"><br>
                </font></div>
              <div><font color="#000000">Please, let us know if it
                  works.</font></div>
              <div><font color="#000000"><br>
                </font></div>
              <div><font color="#000000">Best,</font></div>
              <div><font color="#000000">Arnaud</font></div>
              <div>
                <div class="h5">
                  <div><font color="#000000"><br>
                    </font></div>
                  <div><font color="#000000">&nbsp;</font></div>
                  <div>
                    <div>
                      <div><font color="#000000">On Oct 2, 2011, at 1:55
                          PM, Hui Tang wrote:</font></div>
                      <br>
                      <blockquote type="cite">
                        <div><font color="#000000">Dear Arnaud,</font></div>
                        <div><font color="#000000">&nbsp;</font></div>
                        <div><font color="#000000">That works!!Thanks!</font></div>
                        <div><font color="#000000">Now&nbsp;may I&nbsp;ask if my
                            mean intensity is a constant over time but
                            varies in the image, so I will have a mean
                            intensity image, how can I add that to
                            interal term? I know how to get and set
                            image to get the mean intensity image, but
                            in update(), it seems that this-&gt;mean can
                            only be a scalar.......</font></div>
                        <div><font color="#000000">&nbsp;</font></div>
                        <div><font color="#000000">Do you have any idea
                            on solve this?</font></div>
                        <div><font color="#000000">&nbsp;</font></div>
                        <div><font color="#000000">thanks,</font></div>
                        <div><font color="#000000">&nbsp;</font></div>
                        <div><font color="#000000">Best,</font></div>
                        <div><font color="#000000">&nbsp;</font></div>
                        <div><font color="#000000">Hui</font></div>
                        <div><br>
                          <br>
                          <font color="#000000">&nbsp;</font></div>
                        <div class="gmail_quote"><font color="#000000">On

                            Fri, Sep 30, 2011 at 3:14 PM, Arnaud Gelas <span
                              dir="ltr">&lt;<a moz-do-not-send="true"
                                href="mailto:arnaud_gelas@hms.harvard.edu"
                                target="_blank">arnaud_gelas@hms.harvard.edu</a>&gt;</span>
                            wrote:<br>
                          </font>
                          <blockquote style="border-left: 1px solid
                            rgb(204, 204, 204); margin: 0px 0px 0px
                            0.8ex; padding-left: 1ex;"
                            class="gmail_quote">
                            <div text="#000000" bgcolor="#ffffff"><font
                                color="#000000">Hi Hui,<br>
                                <br>
                                Sorry, there was a typo in my previous
                                email :-/...<br>
                                <br>
                                Here you go:<br>
                                <br>
                                &nbsp;&nbsp;&nbsp; $ git checkout -t origin/v4.0b01<br>
                                <br>
                                Here are the *.h you are looking for<br>
                                <br>
                                $ find . | grep
                                itkBinaryImageToWhitakerSparseLevelSetAdaptor.h<br>
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.hxx<br>
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.h<br>
                                <br>
                                To be able to use the LevelSetsv4, you
                                should either build ITK with all
                                modules, or explicitly turn on the
                                LevelSetsv4 one (which is part of the
                                Segmentation group).<br>
                                <br>
                                Please keep the conversation on the
                                mailing list, other users may have the
                                same problem.<br>
                                <br>
                                Best,<br>
                                Arnaud </font>
                              <div>
                                <div><br>
                                  <br>
                                  <font color="#000000">On 09/30/2011
                                    09:06 AM, Hui Tang wrote: </font>
                                  <blockquote type="cite">
                                    <div><font color="#000000">Dear
                                        Arnaud, </font></div>
                                    <div><font color="#000000">&nbsp;</font></div>
                                    <div><font color="#000000">Thanks
                                        for your help. &nbsp;I still can not
                                        find
                                        itkBinaryImageToWhitakerSparseLevelSetAdaptor.h
                                        in v4.0b1. </font></div>
                                    <div><font color="#000000">git shows
                                        the version number, so it should
                                        be right.....</font></div>
                                    <div><font color="#000000">Best,</font></div>
                                    <div><font color="#000000">&nbsp;</font></div>
                                    <div><font color="#000000">Hui</font></div>
                                    <div class="gmail_quote"><font
                                        color="#000000">On Thu, Sep 29,
                                        2011 at 7:05 PM, Hui Tang <span
                                          dir="ltr">&lt;<a
                                            moz-do-not-send="true"
                                            href="mailto:tanghui.seu@gmail.com"
                                            target="_blank">tanghui.seu@gmail.com</a>&gt;</span>
                                        wrote:<br>
                                      </font>
                                      <blockquote style="border-left:
                                        1px solid rgb(204, 204, 204);
                                        margin: 0px 0px 0px 0.8ex;
                                        padding-left: 1ex;"
                                        class="gmail_quote">
                                        <p><font color="#000000">Hi
                                            arnaud thanks a loooooot for
                                            this! I will try, I will let
                                            you know how it works:) best
                                            hui </font></p>
                                        <div class="gmail_quote"><font
                                            color="#000000">Op 29 sep.
                                            2011 18:55 schreef "Gelas,
                                            Arnaud Joel Florent" &lt;</font><a
                                            moz-do-not-send="true"
                                            href="mailto:Arnaud_Gelas@hms.harvard.edu"
                                            target="_blank"><font
                                              color="#000000">Arnaud_Gelas@hms.harvard.edu</font></a><font
                                            color="#000000">&gt; het
                                            volgende: </font>
                                          <div>
                                            <div><br type="attribution">
                                              <font color="#000000">&gt;
                                                Hi Hui Tang,<br>
                                                &gt; <br>
                                                &gt; I am really happy
                                                to see you are
                                                interested and are
                                                testing the new level
                                                set infrastructure!<br>
                                                &gt; <br>
                                                &gt; If you get this
                                                error, I can only assume
                                                that you are now using
                                                the git master version
                                                of ITK, this file has
                                                been remove recently
                                                from the repository...<br>
                                                &gt; I would strongly
                                                recommend to stick to
                                                ITK tags, since API
                                                keeps on changing all
                                                around the place in the
                                                toolkit.<br>
                                                &gt; <br>
                                                &gt; Here is how you'd
                                                get the last tagged
                                                version:<br>
                                                &gt; <br>
                                                &gt; $ git fetch --all<br>
                                                &gt; $ git checkout -t
                                                origin/v4.0b1<br>
                                                &gt; <br>
                                                &gt; With this version,
                                                you should be able to
                                                find
itkBinaryImageToWhitakerSparseLevelSetAdaptor.h<br>
                                                &gt; <br>
                                                &gt; If you are more
                                                adventurous, and want to
                                                be part of the
                                                development, you can use
                                                master, but expect API /
                                                files / class name to
                                                change.<br>
                                                &gt; You can also create
                                                a gerrit account to
                                                review patches
                                                (instructions are on the
                                                wiki). Note that all
                                                contributions / inputs
                                                on this effort are
                                                welcome!!<br>
                                                &gt; <br>
                                                &gt; Now regarding your
                                                question, this is really
                                                easy to make it happened
                                                in the v4
                                                infrastructure. You have
                                                two possibilities:<br>
                                                &gt; <br>
                                                &gt; 1- grab the code
                                                from iternal or external
                                                term (depending on your
                                                case); copy the code;
                                                you modify and remove
                                                the part in which the
                                                mean gets updated.<br>
                                                &gt; and you add
                                                itkSetMacro to set the
                                                mean at the beginning.<br>
                                                &gt; <br>
                                                &gt; 2- you inherit,
                                                might need to change
                                                some method to virtual
                                                (if needed, let me know
                                                that'd be easy to fix).<br>
                                                &gt; <br>
                                                &gt; If you need more
                                                details on how to
                                                proceed for 1 or 2, just
                                                let me know, we can
                                                definitively give you
                                                some more details on how
                                                to proceed.<br>
                                                &gt; <br>
                                                &gt; Thanks,<br>
                                                &gt; <br>
                                                &gt; Best,<br>
                                                &gt; Arnaud<br>
                                                &gt; <br>
                                                &gt;
                                                ________________________________________<br>
                                                &gt; From: Hui Tang [</font><a
                                                moz-do-not-send="true"
                                                href="mailto:tanghui.seu@gmail.com"
                                                target="_blank"><font
                                                  color="#000000">tanghui.seu@gmail.com</font></a><font
                                                color="#000000">]<br>
                                                &gt; Sent: Thursday,
                                                September 29, 2011 12:20
                                                PM<br>
                                                &gt; To: Gelas, Arnaud
                                                Joel Florent<br>
                                                &gt; Subject: Questions
                                                about ITK4<br>
                                                &gt; <br>
                                                &gt; Dear Arnaud,<br>
                                                &gt; <br>
                                                &gt; How are you?<br>
                                                &gt; I am using ITK4,
                                                but this headfile
                                                "itkBinaryImageToWhitakerSparseLevelSetAdaptor.h"
                                                can not be found in
                                                ITK4. Did I do anything
                                                wrong?<br>
                                                &gt; And maybe you could
                                                help me with another
                                                question:) in chanvase
                                                model, if my I would
                                                like to have a fixed
                                                average intensity ("c1")
                                                for the foreground how
                                                can I implement that
                                                using ITK4?<br>
                                                &gt; <br>
                                                &gt; Thanks so much.<br>
                                                &gt; <br>
                                                &gt; Looking forward to
                                                your reply.<br>
                                                &gt; <br>
                                                &gt; Best,<br>
                                                &gt; <br>
                                                &gt; Hui Tang<br>
                                              </font></div>
                                          </div>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </blockquote>
                                  <br>
                                </div>
                              </div>
                            </div>
                          </blockquote>
                        </div>
                        <br>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
  </body>
</html>