[Insight-users] itkDeformableMesh3DFilter : the violation access

Julien Mercenier itk_julienmercenier at hotmail.com
Fri, 12 Mar 2004 19:19:39 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_002E_01C40866.F70F06A0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_002F_01C40866.F70F06A0"


------=_NextPart_001_002F_01C40866.F70F06A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Luis,

    this e-mail will be quite long....
    I haven't yet tried the exemple2 (registarion model2) you created =
with
    my example because I must format my PC... =20

    (1)  First, I found how, when using the itkDeformableMesh3DFilter =
with my own initialization, not to have a crash.

When initializing my own triangle mesh, I must associate (here by giving =
it a value) a=20
data to each triangle cell.
I found this because this was the main difference between my =
initializing and a meshSource (binary or sphere).
I put an simple example in attachment :
                    This is a tetraedra composed of triangle cells.
                    The image (100*100*100) is a sphere (I've tried with =
a radius of 40.0) created by the user-guide
                    example. Sorry, I don't push the shere.img in =
attachment (otherwise the e-mail will be refused).

But, even this example doesn't work well :=20
                    (a) variating the stiffness doesn't seem to variate =
the results (the nodes' displacements)
                    (b) if I increase the cell data, the displacements =
seem to decrease.
                        =
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!=
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!=
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                        !!!!!!!!!!! I've tried with a data cell value =
=3D 100 and the program crashed =
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                        !!!!!!!!!!! with the same access violation than =
before                            =
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                        Is this the consequence of =
itkDeformableMesh3DFilter.txx/line 279        ?
                       while (celldata !=3D myCellData->End()){
                       x =3D celldata.Value();
                       m_K[j] =3D m_StiffnessMatrix+((int) x);
                    while casting the double to an int =
???????????????????
                    (c) when I increase the force scale (that must be =
big to obtain a deformation) or the time step,
                        the deformations seem to increase
                    (d) the step number doesn' t seem to influence the =
results=20
                    (e) the step threshold have effects
Although these, the results are bad !... : )
I didn't manage to find good parameters to this example.

    (2) Can you tell me on which article you based your work to =
construct this filter...?
This could be very helpful to me to understand the stiffnessmatrix =
computing and maybe other things in the code.
I  must understand this one or create another one (this is a part of my =
"ingeneering thesis"...I don't know if this is called like that=20
in English).

    (3) Now, I have questions and remarks about the source code =
itself...(itkDeformableMesh3DFilter.txx)

                    (a) itkDeformableMesh3DFilter.txx/line 702
  InputPointDataContainerPointer    myForceData =3D =
m_Forces->GetPointData(); =20
    where is defined (in the documentation) the function GetPointData ? =
I didn't find it in the itk::mesh class.

                    (b) where is called the function=20
DeformableMesh3DFilter<TInputMesh, TOutputMesh>
                ::SetStiffnessMatrix ( vnl_matrix_fixed<double, 4, 4> =
*stiff, int i )=20
                        defined at itkDeformableMesh3DFilter.txx/line =
238             ??

                    (c) I don't understand this command
  x =3D celldata.Value();
  m_K[j] =3D m_StiffnessMatrix+((int) x);
                        defined at itkDeformableMesh3DFilter.txx/line =
280

and why do you use data associated with cell ?

                    (d) itkDeformableMesh3DFilter.txx/line 319
  m_Displacements->GetPoint (tp[0], v1_pt);=20
  m_Displacements->GetPoint (tp[1], v2_pt);=20
  m_Displacements->GetPoint (tp[2], v3_pt);

where is defined the function GetPoint (same reason as in (a)) ???

                    (e) itkDeformableMesh3DFilter.txx/line 489
 output->SetCellData(i, (PixelType)x);

why do you modify the cell data at the output ?=20

                    (f) itkDeformableMesh3DFilter.txx/line 551

 coord[0] =3D (int) vec_p[0];
 coord[1] =3D (int) vec_p[1];
 coord[2] =3D (int) vec_p[2];

are you sure there is no problem if the vec_p[0] type is double  ???

                    (g) itkDeformableMesh3DFilter.txx/line 555

 if ( m_Potential->GetPixel(coord) !=3D m_ObjectLabel )

what is m_ObjectLabel ?=20

                    (h)itkDeformableMesh3DFilter.txx/line 521

template <typename TInputMesh, typename TOutputMesh>
void
DeformableMesh3DFilter<TInputMesh, TOutputMesh>
      ::PotentialFit()=20

what is the use of this function ?   I don't see it is called anywhere.=20

                    (i) itkDeformableMesh3DFilter.txx/line 819

  coa =3D -(v1[1]*(v2[2]-v3[2]) +=20
          v2[1]*(v3[2]-v1[2]) +
          v3[1]*(v1[2]-v2[2])) ;
  cob =3D -(v1[2] * (v2[0]-v3[0]) +
          v2[2]*(v3[0]-v1[0]) +
          v3[2]*(v1[0]-v2[0])) ;
  coc =3D -(v1[0] * (v2[1]-v3[1]) +
          v2[0]*(v3[1]-v1[1]) +
          v3[0]*(v1[1]-v2[1])) ;

I don't understand these steps in the normals computing.  What is it =
based on ?

                (j) itkDeformableMesh3DFilter.txx/line 783

Remark : in this function, you compute several times the  normal at one =
point.
The value of the normal saved is the last one computed. The other =
computings are lost.
Is it right ?
So the normal at one node seems to be the consequence of only one cell =
(triangle)....


                (k) itkDeformableMesh3DFilter.txx/line 749

  vec_for[0] =3D vec_for[0] + (vec_loc[0]-coord[0])*tmp_vec_1[0]=20
    + (vec_loc[1]-coord[1])*tmp_vec_2[0] + =
(vec_loc[2]-coord[2])*tmp_vec_3[0];
  vec_for[1] =3D vec_for[1] + (vec_loc[1]-coord[1])*tmp_vec_2[1]
    + (vec_loc[0]-coord[0])*tmp_vec_1[1] + =
(vec_loc[2]-coord[2])*tmp_vec_3[1];
  vec_for[2] =3D vec_for[2] + (vec_loc[2]-coord[2])*tmp_vec_3[2]
    + (vec_loc[1]-coord[1])*tmp_vec_2[2] + =
(vec_loc[0]-coord[0])*tmp_vec_1[2];

remark : here, in the GradientFit function, using generalized Taylor =
theorem, I think you=20
                assumed the spacing to be equal to 1 in each direction.
                The voxel spacing can although be strongly different.

                (l) The last but not least.
                    itkDeformableMesh3DFilter.txx/line 761


  mag =3D vec_for[0]*vec_nor[0] + vec_for[1]*vec_nor[1]+ =
vec_for[2]*vec_nor[2];

  vec_for[0] =3D m_GradientMagnitude*mag*vec_nor[0]/*num_for*/;
  vec_for[1] =3D m_GradientMagnitude*mag*vec_nor[1]/*num_for*/;=20
  vec_for[2] =3D m_GradientMagnitude*mag*vec_nor[2]/*num_for*/;=20

  mag =3D sqrt (vec_for[0]*vec_for[0] + vec_for[1]*vec_for[1]+ =
vec_for[2]*vec_for[2]);
  if (mag > 0.5)=20
    for (int i=3D0; i<3; i++) vec_for[i] =3D (0.5 * vec_for[i])/mag;
  forces.Value() =3D vec_for;

You compute the force vector on one point  by projection of  the =
gradient vector fitted=20
on the normal vector of this point.
So, the force direction is defined by the normal and not by the gradient =
field.
Am I right ?

So, considering I'm right, using GVF field in place of the simple =
gradient field
would not conclude to better results using this =
itkDeformableMesh3DFilter...
This GVF filed would although be so helpful to recover concave =
regions....

What do you think ?
=20


I hope you will not be angry against me for writing such a long email, =
but this is
very important for my thesis...

Thanks in advance,

    Julien,BELGIUM
------=_NextPart_001_002F_01C40866.F70F06A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Luis,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; this e-mail will be =
quite=20
long....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; I haven't yet tried =
the exemple2=20
(registarion model2) you created with</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;my&nbsp;example =
because I=20
must format my PC...&nbsp; </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;(1)=20
<STRONG>&nbsp;First</STRONG>, I found how, when using the=20
itkDeformableMesh3DFilter with my own initialization, not to have a=20
crash.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When initializing my own triangle mesh, =
I must=20
associate (here by giving it a value) a </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>data to each triangle =
cell.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I found this because this was the main =
difference=20
between my initializing and a meshSource (binary or =
sphere).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I put an simple example in attachment=20
:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; This is a =
tetraedra=20
composed of triangle cells.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The image =
(100*100*100)=20
is a sphere (I've tried with a radius of 40.0) created by the=20
user-guide</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;example.=20
Sorry, I don't push the shere.img in attachment (otherwise the e-mail =
will be=20
refused).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But, even this example doesn't work =
well :=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (a) variating =
the=20
stiffness doesn't seem to variate the results (the nodes'=20
displacements)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (b) if I =
increase the=20
cell data, the displacements seem to decrease.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!=
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!=
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
!!!!!!!!!!! I've tried with a data cell value =3D 100 and the program =
crashed=20
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
!!!!!!!!!!! with the same access violation than before&nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; Is=20
this the consequence of <STRONG>itkDeformableMesh3DFilter.txx/line=20
279</STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<EM>=20
</EM></FONT><EM>&nbsp;</EM><FONT face=3DArial size=3D2><EM>&nbsp; while =
(celldata !=3D=20
myCellData-&gt;End()){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;x=20
=3D=20
celldata.Value();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
m_K[j] =3D m_StiffnessMatrix+((int) x);</EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while casting =
the=20
double to an int ???????????????????</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (c) when I =
increase the=20
force scale (that must be big to obtain a deformation) or the time=20
step,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp; the=20
deformations seem to increase</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (d) the step =
number=20
doesn' t seem to influence the results </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (e) the step =
threshold=20
have effects</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Although these, the results are bad =
!... :=20
)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I didn't manage to find good parameters =
to this=20
example.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; (2) Can you tell =
me&nbsp;on=20
which&nbsp;article you based your work to construct this =
filter...?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>This could be very helpful to me to =
understand the=20
stiffnessmatrix computing and maybe other things in the =
code.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I&nbsp; must understand this one or =
create another=20
one (this is a part of my "ingeneering thesis"...I don't know if this is =
called=20
like that </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in English).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; (3) Now, I have =
questions and=20
remarks about the source code=20
itself...(itkDeformableMesh3DFilter.txx)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (a)=20
<STRONG>itkDeformableMesh3DFilter.txx/line 702</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;=20
<EM>InputPointDataContainerPointer&nbsp;&nbsp;&nbsp; myForceData =3D=20
m_Forces-&gt;GetPointData();</EM></FONT><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; where is defined (in =
the=20
documentation) the function <EM>GetPointData ?</EM> I didn't find it in =
the=20
itk::mesh class.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (b) where is =
called the=20
function </FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2><EM>DeformableMesh3DFilter&lt;TInputMesh,=20
TOutputMesh&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; ::SetStiffnessMatrix ( vnl_matrix_fixed&lt;double, 4, =
4&gt;=20
*stiff, int i ) </EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
defined at <STRONG>itkDeformableMesh3DFilter.txx/line=20
238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
</STRONG>??</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (c) I don't =
understand=20
this command</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM>&nbsp; x =3D =
celldata.Value();<BR>&nbsp; m_K[j] =3D=20
m_StiffnessMatrix+((int) x);</EM></FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
</EM>defined at <STRONG>itkDeformableMesh3DFilter.txx/line=20
280</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and why do you use data associated with =
cell=20
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (d)=20
<STRONG>itkDeformableMesh3DFilter.txx/line 319</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>&nbsp;</STRONG><EM>=20
m_Displacements-&gt;GetPoint (tp[0], v1_pt); <BR>&nbsp;=20
m_Displacements-&gt;GetPoint (tp[1], v2_pt); <BR>&nbsp;=20
m_Displacements-&gt;GetPoint (tp[2], v3_pt);</EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>where is defined the function GetPoint =
(same reason=20
as in (a)) ???</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (e)=20
<STRONG>itkDeformableMesh3DFilter.txx/line 489</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM>&nbsp;output-&gt;SetCellData(i,=20
(PixelType)x);</EM></FONT></DIV>
<DIV><EM><FONT face=3DArial size=3D2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>why do you modify the cell data&nbsp;at =
the output=20
? </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (f)=20
<STRONG>itkDeformableMesh3DFilter.txx/line 551</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;<FONT face=3DArial size=3D2><EM>coord[0] =3D (int)=20
vec_p[0];<BR>&nbsp;coord[1] =3D (int) vec_p[1];<BR>&nbsp;coord[2] =3D =
(int)=20
vec_p[2];</EM></FONT></DIV>
<DIV><EM><FONT face=3DArial size=3D2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>are you sure there is no problem if =
<EM>the=20
vec_p[0]</EM> type is<EM> double</EM>&nbsp;<EM> ???</EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM></EM></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (g)=20
<STRONG>itkDeformableMesh3DFilter.txx/line 555</STRONG></FONT></DIV>
<DIV><STRONG><FONT face=3DArial size=3D2></FONT></STRONG>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;if<EM> ( =
m_Potential-&gt;GetPixel(coord) !=3D=20
m_ObjectLabel )</EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM></EM></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><EM>what is m_ObjectLabel ? =
</EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM></EM></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
(h)<STRONG>itkDeformableMesh3DFilter.txx/line 521</STRONG></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><STRONG></STRONG>&nbsp;</DIV>
<DIV><EM>template &lt;typename TInputMesh, typename=20
TOutputMesh&gt;<BR>void<BR>DeformableMesh3DFilter&lt;TInputMesh,=20
TOutputMesh&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
::PotentialFit()&nbsp;<BR></EM></DIV>
<DIV>what is the use of this function ?&nbsp; &nbsp;I don't see it is =
called=20
anywhere.&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; (i) <STRONG>itkDeformableMesh3DFilter.txx/line=20
819</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV><EM>&nbsp; coa =3D -(v1[1]*(v2[2]-v3[2]) +=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
v2[1]*(v3[2]-v1[2])=20
+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
v3[1]*(v1[2]-v2[2]))=20
;<BR>&nbsp; cob =3D -(v1[2] * (v2[0]-v3[0])=20
+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
v2[2]*(v3[0]-v1[0])=20
+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
v3[2]*(v1[0]-v2[0]))=20
;<BR>&nbsp; coc =3D -(v1[0] * (v2[1]-v3[1])=20
+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
v2[0]*(v3[1]-v1[1])=20
+<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
v3[0]*(v1[1]-v2[1]))=20
;</EM></DIV>
<DIV><EM></EM>&nbsp;</DIV>
<DIV>I don't understand these steps in the normals computing.&nbsp; What =
is it=20
based on ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
(j) <STRONG>itkDeformableMesh3DFilter.txx/line 783</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV>Remark : in this function, you compute several times the&nbsp; =
normal at=20
one point.</DIV>
<DIV>The value of the normal saved is the last one computed. The other=20
computings are lost.</DIV>
<DIV>Is it right ?</DIV>
<DIV>So the normal at one node seems to be the consequence of only one =
cell=20
(triangle)....</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
(k) <STRONG>itkDeformableMesh3DFilter.txx/line 749</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV><EM>&nbsp; vec_for[0] =3D vec_for[0] + =
(vec_loc[0]-coord[0])*tmp_vec_1[0]=20
<BR>&nbsp;&nbsp;&nbsp; + (vec_loc[1]-coord[1])*tmp_vec_2[0] +=20
(vec_loc[2]-coord[2])*tmp_vec_3[0];<BR>&nbsp; vec_for[1] =3D vec_for[1] =
+=20
(vec_loc[1]-coord[1])*tmp_vec_2[1]<BR>&nbsp;&nbsp;&nbsp; +=20
(vec_loc[0]-coord[0])*tmp_vec_1[1] +=20
(vec_loc[2]-coord[2])*tmp_vec_3[1];<BR>&nbsp; vec_for[2] =3D vec_for[2] =
+=20
(vec_loc[2]-coord[2])*tmp_vec_3[2]<BR>&nbsp;&nbsp;&nbsp; +=20
(vec_loc[1]-coord[1])*tmp_vec_2[2] +=20
(vec_loc[0]-coord[0])*tmp_vec_1[2];</EM></DIV>
<DIV>&nbsp;</DIV>
<DIV>remark : here, in the GradientFit function, using generalized =
Taylor=20
theorem, I think you </DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
assumed the spacing&nbsp;to be&nbsp;equal to 1 in each direction.</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
The voxel spacing can although be strongly different.<BR></DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
(l) <STRONG>The last but not least.</STRONG></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<STRONG>itkDeformableMesh3DFilter.txx/line 761</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><EM>&nbsp; mag =3D vec_for[0]*vec_nor[0] + vec_for[1]*vec_nor[1]+=20
vec_for[2]*vec_nor[2];</EM></DIV>
<DIV><EM></EM>&nbsp;</DIV>
<DIV><EM>&nbsp; vec_for[0] =3D=20
m_GradientMagnitude*mag*vec_nor[0]/*num_for*/;<BR>&nbsp; vec_for[1] =3D=20
m_GradientMagnitude*mag*vec_nor[1]/*num_for*/; <BR>&nbsp; vec_for[2] =3D =

m_GradientMagnitude*mag*vec_nor[2]/*num_for*/; </EM></DIV>
<DIV><EM></EM>&nbsp;</DIV>
<DIV><EM>&nbsp; mag =3D sqrt (vec_for[0]*vec_for[0] + =
vec_for[1]*vec_for[1]+=20
vec_for[2]*vec_for[2]);<BR>&nbsp; if (mag &gt; 0.5) =
<BR>&nbsp;&nbsp;&nbsp; for=20
(int i=3D0; i&lt;3; i++) vec_for[i] =3D (0.5 * =
vec_for[i])/mag;<BR>&nbsp;=20
forces.Value() =3D vec_for;</EM><BR></DIV>
<DIV>You compute the force vector on one point &nbsp;by projection =
of&nbsp; the=20
gradient vector fitted </DIV>
<DIV>on the normal vector of this point.</DIV>
<DIV>So, the force direction is defined by the normal and not by the =
gradient=20
field.</DIV>
<DIV>Am I right ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>So,&nbsp;considering I'm right, using GVF field in place of the =
simple=20
gradient field</DIV>
<DIV>would not conclude to better results using this=20
itkDeformableMesh3DFilter...</DIV>
<DIV>This GVF filed would although be so helpful to recover concave=20
regions....</DIV>
<DIV>&nbsp;</DIV>
<DIV>What do you think ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>I hope you will not be angry against me for writing such a long =
email, but=20
this is</DIV>
<DIV>very important for my thesis...</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks in advance,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Julien,BELGIUM</FONT></DIV></BODY></HTML>

------=_NextPart_001_002F_01C40866.F70F06A0--

------=_NextPart_000_002E_01C40866.F70F06A0
Content-Type: application/x-zip-compressed;
	name="Verif.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="Verif.zip"

UEsDBBQAAgAIAOWJazDfkDegogAAAOUAAAAOAAAAQ01ha2VMaXN0cy50eHRdjcEOgjAQRM826T9w
8AAX/6G0C1lpCilt4q0HgkpCxYAaEuO/Wzihl82bndlZSipdHoGb+NWO3Xnq/L1vE0ooyVAJVzFe
sBxiNEVYYraAy0qrRJA7VFxaAfH+bWtwq4USPsECJf7ClDAhHJyAW8NSCdt/0YYPzTxHIW+YzsE4
iaoII9VMI9Q/R6GdD94Pt4VYfxnG7nH106LU04dgszKWyRdQSwMEFAACAAgAFoxsMDz3FJsfBgAA
4hcAAA8AAAB2ZXJpZnNpbXBsZS5jeHiVWG1v2zYQ/qwC/Q9XFxiU1nMsqds62wmwJVmRD22KJuuX
YShYiba5yJIg0U2Lov99xzdRL5TsOEBr8Z577o48He/8nK0TuoZPb28vPn28+vD0yfOiJJsdgQdS
ZizbgA8Jq8jnlMICXv32+lc4QQzNErZ++kT9PWdZnO4TCiuWV7ykZHfuNVYnjN+/pdV2tp10Vu9K
RrJNSi9omkppR35J13m5E7aFfnT5F0s5LREJp6cPLE0hkQDgWwosY5yRFHaI7BG9KU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