[Insight-users] itkDeformableMesh3DFilter : the violation access

Julien Mercenier itk_julienmercenier at hotmail.com
Wed, 17 Mar 2004 10:15:19 +0100


This is a multi-part message in MIME format.

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

Hi Luis,

    I was wondering if you had the time to look at my questions.

I know it is a very long e-mail...but it is so important.

    Regards,
            Julien
  ----- Original Message -----=20
  From: Julien Mercenier=20
  To: insight-users at itk.org=20
  Cc: Luis Ibanez=20
  Sent: Friday, March 12, 2004 7:19 PM
  Subject: [Insight-users] itkDeformableMesh3DFilter : the violation =
access


  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 ?



  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_000_00FC_01C40C08.C01BB710
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; I was wondering if =
you had the=20
time to look at my questions.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I know it is a very long e-mail...but =
it is so=20
important.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; Julien</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Ditk_julienmercenier at hotmail.com=20
  href=3D"mailto:itk_julienmercenier at hotmail.com">Julien Mercenier</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dinsight-users at itk.org=20
  href=3D"mailto:insight-users at itk.org">insight-users at itk.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Cc:</B> <A =
title=3Dluis.ibanez at kitware.com=20
  href=3D"mailto:luis.ibanez at kitware.com">Luis Ibanez</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, March 12, 2004 =
7:19=20
PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Insight-users]=20
  itkDeformableMesh3DFilter : the violation access</DIV>
  <DIV><BR></DIV>
  <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=20
  exemple2 (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 =

  :</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

  &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; =

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; The image=20
  (100*100*100) 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; =

  &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; =

  &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; =

  &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; =

  &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; =

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
  !!!!!!!!!!! with the same access violation than =
before&nbsp;&nbsp;&nbsp;=20
  &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; =

  &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; =

  &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=20
  !=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; =

  &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; =

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (c) when I =
increase=20
  the force scale (that must be big to obtain a deformation) or the time =

  step,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
  the deformations seem to increase</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

  &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; =

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (e) the step=20
  threshold 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=20
  filter...?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>This could be very helpful to me to =
understand=20
  the 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=20
  another one (this is a part of my "ingeneering thesis"...I don't know =
if this=20
  is called 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; =

  &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; =

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (b) where is =
called=20
  the 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; =

  &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; =

  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (c) I don't=20
  understand this command</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><EM>&nbsp; x =3D =
celldata.Value();<BR>&nbsp; m_K[j]=20
  =3D 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; =

  &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=20
  reason 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; =

  &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=20
  output ? </FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

  &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; =

  &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; =

  &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;=20
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (i)=20
  <STRONG>itkDeformableMesh3DFilter.txx/line 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;=20
  v3[1]*(v1[2]-v2[2])) ;<BR>&nbsp; cob =3D -(v1[2] * (v2[0]-v3[0])=20
  +<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  v2[2]*(v3[0]-v1[0])=20
  +<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  v3[2]*(v1[0]-v2[0])) ;<BR>&nbsp; coc =3D -(v1[0] * (v2[1]-v3[1])=20
  +<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  v2[0]*(v3[1]-v1[1])=20
  +<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  v3[0]*(v1[1]-v2[1])) ;</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;=20
  &nbsp;&nbsp;&nbsp; (j) <STRONG>itkDeformableMesh3DFilter.txx/line=20
  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 =

  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;=20
  &nbsp;&nbsp;&nbsp; (k) <STRONG>itkDeformableMesh3DFilter.txx/line=20
  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;=20
  &nbsp;&nbsp;&nbsp; assumed the spacing&nbsp;to be&nbsp;equal to 1 in =
each=20
  direction.</DIV>
  <DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
  &nbsp;&nbsp;&nbsp; The voxel spacing can although be strongly=20
  different.<BR></DIV>
  <DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
  &nbsp;&nbsp;&nbsp; (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]+ =

  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=20
  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;=20
  the 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,=20
  but 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></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00FC_01C40C08.C01BB710--