[Insight-users] DeformableMesh3DFilter example doesn't change input

Benjamin Klimczak klimczaks at gmx.de
Tue Aug 18 09:32:49 EDT 2009


Hi Luis,

I have just found the solution for the problem with the DeformableMesh3DFilter example. As mentioned here

http://www.itk.org/Doxygen314/html/classDeformableMesh3D.html

all points are assumed to lie in index space. I.e. you need to transform the mesh coordinates into index space coordinates of the gradient image.

If I apply the following transform to the  meshSource output coordinates before the deformable model update I get reasonable results:

------------------------------------------------------------------
// TEST: Transform the world coordinates of the input mesh to index coordinates of the gradient image
  typedef itk::PointSet<PixelType, Dimension> PointSetType;
  PointSetType::PointsContainerPointer inputPoints = meshSource->GetOutput()->GetPoints();
  PointSetType::PointsContainerIterator inIt = inputPoints->Begin();
  PointSetType::PointsContainerIterator inputEnd = inputPoints->End();

  ImageType::IndexType pixelIndex;
  bool inside;

  while(inIt != inputEnd){
    inside = gradientMagnitudeFilter->GetOutput()->TransformPhysicalPointToIndex(inIt.Value(), pixelIndex);
    if(inside){
      // Set the coordinates of the mesh points to index coordinates
      inIt.Value()[0] = pixelIndex[0]; inIt.Value()[1] = pixelIndex[1]; inIt.Value()[2] = pixelIndex[2];
    }else{
      // The vertex coordinates seem to be outside of the image coordinates
      std::cout << "Vertex coordinate outside of image" << std::endl << "-> mesh and image don't seem to be aligned correctly!" << std::endl;
    }
    inIt++;
  }
------------------------------------------------------------------

If that's really the cause of the trouble it would be great if the example code and the ItkSoftwareGuide would be updated accordingly so that others may not get stuck with this problem. Should I post a bug report?


I have still no idea how to solve The problems with the itkDeformableSimplexMesh3DGradientConstraintForceFilter (as mentioned in my last email), which is probably more the deformable model I am looking for. So any idea would be really great.

Best regards,
Benjamin



--------------------------------------------------------------------------------------------
Hi Benjamin,

Please find attached the modified DeformableRegistration example
that uses the filter

    itkDeformableSimplexMesh3DGradientConstraintForceFilter

This attached file compiles fine.


     Regards,


            Luis


--------------------------------------------------------------------------------------------
On Sun, Aug 16, 2009 at 8:13 AM, Benjamin Klimczak <klimczaks at gmx.de> wrote:

> Hi Luis,
>
> thanks for looking into my problem.
>
> I have also tried to use the
> itkDeformableSimplexMesh3DGradientConstraintForceFilter.h but I ran into
> strange template compiler errors when I created a simplex mesh, i.e. when I
> used the TriangleMeshToSimplexMeshFilter. The code of this test is attached.
>
> Thanks again and best regards,
> Benjamin
>
> Luis Ibanez schrieb:
>
>>
>> Hi Benjamin,
>>
>> Thanks for sharing the images.
>>
>> Please find attached a modified version of the deformable model
>> example that will read your mask, extract an isosurface from it and
>> pass the data to the deformable model filter.
>>
>> With this code we have reproduced your observation that the
>> surface doesn't propagate with the current parameters.
>>
>> We are now trying with the filter
>> itkDeformableSimplexMesh3DGradientConstraintForceFilter.h
>>
>> which is more commonly used...
>>
>>
>>
>>    Regards,
>>
>>
>>         Luis,
>>
>>
>> -----------------------------------------
>> On Thu, Aug 13, 2009 at 9:05 AM, Benjamin Klimczak <klimczaks at gmx.de<mailto:
>> klimczaks at gmx.de>> wrote:
>>
>>    Hi Luis,
>>
>>    thank you for the answer and I'm sorry for the late reply.
>>    I tried the suggested values from DeformableModel2.cxx in
>>    DeformableModel1.cxx, but still nothing is changed by the filter.
>>    I have uploaded the data I use here (image and segmentation):
>>
>>    http://www.lfb.rwth-aachen.de/public/aorta_img.vtk
>>    http://www.lfb.rwth-aachen.de/public/aorta_seg.vtk
>>
>>    I'm working with the MITK btw. and have created the segmentation
>>    with its GUI application.
>>
>>    Any hint why this isn't working would be welcome.
>>
>>    Thanks a lot,
>>    Benjamin
>>
>>
>>    -------- Original-Nachricht --------
>>    > Datum: Sat, 8 Aug 2009 11:13:23 -0400
>>    > Von: Luis Ibanez <luis.ibanez at kitware.com
>>    <mailto:luis.ibanez at kitware.com>>
>>    > An: Benjamin Klimczak <klimczaks at gmx.de <mailto:klimczaks at gmx.de>>
>>    > CC: insight-users at itk.org <mailto:insight-users at itk.org>
>>    > Betreff: Re: [Insight-users] DeformableMesh3DFilter example
>>    doesn\'t change   input
>>
>>    > Hi Benjamin,
>>    >
>>    > Please look at the suggested values in DeformableModel2.cxx
>>    >
>>    > If that still doesn't work for you, we may need to have access to
>>    > the image that you are using to give you more guidance.
>>    >
>>    >
>>    >      Regards,
>>    >
>>    >
>>    >            Luis
>>    >
>>    >
>>    >
>>
>>  
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser


More information about the Insight-users mailing list