<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
<br>
On 04/01/2012 12:59 PM, tomtom wrote:
<blockquote cite="mid:1333277973821-7426557.post@n2.nabble.com"
type="cite">
<pre wrap="">Hello everyone,
I am trying to implement an own level set term.
The evolution equation that I have looks like: phi_t = A(x,y) * N,
where A(x,y) is real and N is the inwards directed unit normal vector.</pre>
</blockquote>
<br>
cool :)<br>
<br>
<blockquote cite="mid:1333277973821-7426557.post@n2.nabble.com"
type="cite">
<pre wrap="">
So, as far as I understood things, I can use the backwardGradient, which
should be N, if I normalize it with its length.</pre>
</blockquote>
<br>
You can, indeed, use backward gradient, forward...<br>
<blockquote cite="mid:1333277973821-7426557.post@n2.nabble.com"
type="cite">
<pre wrap="">
Is it right that the Value()-method should look like:
....Value(const LevelSetInputIndexType& iP)
{
LevelSetOutputRealType outputValue = itk::NumericTraits<
LevelSetOutputRealType >::Zero;
LevelSetOutputRealType AValue = ComputeA(x,y);
LevelSetGradientType backwardGradient =
this->m_CurrentLevelSetPointer->EvaluateBackwardGradient( iP );
double lengthBackwardGradient = ...;
for(unsigned int dim = 0; dim < ImageDimension; dim++)
outputValue+=backwardGradient[dim] * AValue / lengthBackwardGradient;
return outputValue;
}</pre>
</blockquote>
The code seems alright, but just make sure lengthBackwardGradient is
non null...
<blockquote cite="mid:1333277973821-7426557.post@n2.nabble.com"
type="cite">
<pre wrap="">
Or am I doing something wrong.</pre>
</blockquote>
<br>
Here let me explain quickly how new term has to be implemented. I'll
take your term as an example.<br>
<br>
<ul>
<li>The first thing is to gather all characteristics you need from
level-set functions, i.e. in your case you would only need the
BackwardGradient.</li>
</ul>
<ul>
<li>In the constructor</li>
<ul>
<li>you should first name your term as follows:</li>
</ul>
</ul>
this->m_TermName = "My awesome term"; // it
is useful if you want to access a term by its name in the term
container<br>
<ul>
<ul>
<li>the list all the required characteristics you need from the
level set</li>
</ul>
</ul>
<p> this->m_RequiredData.insert(
"BackwardGradient" ); // This is mandatory!! In the term container
(before computing any update) we first compute all required
characteristics to avoid computing twice the same characteristic<br>
</p>
<ul>
<li>Implement InitializeParameters (in case you want to cast your
image A)</li>
<li>Your must implement Value( const LevelSetInputIndexType&
iP, const LevelSetDataType& iData ). This method makes use
of the required characteristics (and is used when evolving)</li>
<li>You can implement Value( const LevelSetInputIndexType& iP
); it is mainly for debugging / testing purpose to make sure the
term value is as expected.<br>
<br>
</li>
</ul>
I invite you to have a look at
itkLevelSetEquationPropagationTerm.hxx which implements a very close
term to the one you are tying to implement.<br>
<br>
Finally, I invite you to share with the rest of the community your
new term by the means of an Insight Journal ;)<br>
<br>
Best,<br>
Arnaud<br>
<br>
<blockquote cite="mid:1333277973821-7426557.post@n2.nabble.com"
type="cite">
<pre wrap="">
Thanks for any remarks or hints.
--
View this message in context: <a class="moz-txt-link-freetext" href="http://itk-insight-users.2283740.n2.nabble.com/Question-concerning-level-set-term-tp7426557p7426557.html">http://itk-insight-users.2283740.n2.nabble.com/Question-concerning-level-set-term-tp7426557p7426557.html</a>
Sent from the ITK Insight Users mailing list archive at Nabble.com.
_____________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a>
Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
</blockquote>
<br>
</body>
</html>