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

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 16 11:32:23 EDT 2009


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
>>    >
>>    >
>>    >
>>
>>  -----------------------------------------------------------------------------------------
>>    > On Fri, Aug 7, 2009 at 6:01 AM, Benjamin Klimczak
>>    <klimczaks at gmx.de <mailto:klimczaks at gmx.de>>
>>    > wrote:
>>    >
>>    > > Hello everybody.
>>    > >
>>    > > I can't get the DeformableMesh3DFilter from the example
>>    > > Examples/Segmentation/DeformableModel1.cxx to change my input
>>    data.
>>    > Input
>>    > > and output mesh are identical. I have tried different input
>>    files and
>>    > > extreme settings of the parameters but nothing seems to work.
>>    > >
>>    > > Thanks for any help.
>>    > >
>>    > > Regards
>>    > > Benjamin
>>    > > --
>>    > > Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla
>>    Firefox 3
>>    > -
>>    > > sicherer, schneller und einfacher!
>>    http://portal.gmx.net/de/go/atbrowser
>>    > > _____________________________________
>>    > > Powered by www.kitware.com <http://www.kitware.com>
>>    > >
>>    > > Visit other Kitware open-source projects at
>>    > > http://www.kitware.com/opensource/opensource.html
>>    > >
>>    > > Please keep messages on-topic and check the ITK FAQ at:
>>    > > http://www.itk.org/Wiki/ITK_FAQ
>>    > >
>>    > > Follow this link to subscribe/unsubscribe:
>>    > > http://www.itk.org/mailman/listinfo/insight-users
>>    > >
>>
>>    --
>>    GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>>    Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>>
>>
>
> void QmitkTestPluginView::testItkDeformableSimplexModel()
> {
>  cout << "Test the deformable simplex model:" << endl;
>
>  const unsigned int Dimension = 3;
>  typedef double PixelType;
>  typedef itk::Image<PixelType, Dimension> ImageType;
>
>  typedef itk::Image< unsigned char, Dimension > BinaryImageType;
>
>  typedef itk::Mesh<PixelType, Dimension> MeshType;
>  typedef itk::SimplexMesh<PixelType, Dimension> SimplexMeshType;
>
>  typedef itk::CovariantVector< double, Dimension > GradientPixelType;
>  typedef itk::Image< GradientPixelType, Dimension > GradientImageType;
>
>  typedef itk::GradientRecursiveGaussianImageFilter<ImageType,
> GradientImageType> GradientFilterType;
>  typedef
> itk::GradientMagnitudeRecursiveGaussianImageFilter<ImageType,ImageType>
> GradientMagnitudeFilterType;
>
>  typedef itk::BinaryMask3DMeshSource< BinaryImageType, MeshType >
> MeshSourceType;
>
>  typedef itk::TriangleMeshToSimplexMeshFilter<MeshType, SimplexMeshType>
> TriangleToSimplexMeshFilterType;
>
>  typedef
> itk::DeformableSimplexMesh3DGradientConstraintForceFilter<SimplexMeshType,
> SimplexMeshType> DeformableModelFilterType;
>
>  typedef itk::ImageFileReader< ImageType > ReaderType;
>  typedef itk::ImageFileReader< BinaryImageType > BinaryReaderType;
>  ReaderType::Pointer imageReader = ReaderType::New();
>  BinaryReaderType::Pointer maskReader = BinaryReaderType::New();
>
>  imageReader->SetFileName( "Y:\\Data\\modified\\im7.vtk" );
>  maskReader->SetFileName( "Y:\\Data\\modified\\seg.vtk" );
>
>  GradientMagnitudeFilterType::Pointer gradientMagnitudeFilter =
> GradientMagnitudeFilterType::New();
>
>  gradientMagnitudeFilter->SetInput( imageReader->GetOutput() );
>  gradientMagnitudeFilter->SetSigma( 1.0 );
>
>  GradientFilterType::Pointer gradientMapFilter = GradientFilterType::New();
>  gradientMapFilter->SetInput( gradientMagnitudeFilter->GetOutput() );
>  gradientMapFilter->SetSigma( 1.0 );
>
>  try
>  {
>    gradientMapFilter->Update();
>  }
>  catch( itk::ExceptionObject & e )
>  {
>    std::cerr << "Exception caught while updating gradientMapFilter " <<
> std::endl;
>    std::cerr << e << std::endl;
>    return;
>  }
>  std::cout << "The gradient map was created!" << std::endl;
>
>  MeshSourceType::Pointer meshSource = MeshSourceType::New();
>  //BinaryImageType::Pointer mask = maskReader->GetOutput();
>  meshSource->SetInput( maskReader->GetOutput() );
>  meshSource->SetObjectValue( 1 );
>
>  std::cout << "Creating mesh..." << std::endl;
>  try
>  {
>    meshSource->Update();
>  }
>  catch( itk::ExceptionObject & excep )
>  {
>    std::cerr << "Exception caught while creating the start mesh!" <<
> std::endl;
>    std::cerr << excep << std::endl;
>    return;
>  }
>
>  TriangleToSimplexMeshFilterType::Pointer triangleToSimplexFilter =
> TriangleToSimplexMeshFilterType::New();
>  triangleToSimplexFilter->SetInput( meshSource->GetOutput() );
>
>  std::cout << "Converting mesh to simplex mesh..." << std::endl;
>  try
>  {
>    triangleToSimplexFilter->Update();
>  }
>  catch( itk::ExceptionObject & excep )
>  {
>    std::cerr << "Exception caught while converting the start mesh to a
> simplex mesh!" << std::endl;
>    std::cerr << excep << std::endl;
>    return;
>  }
>
>  DeformableModelFilterType::Pointer deformableModelFilter =
> DeformableModelFilterType::New();
>  deformableModelFilter->SetGradient( gradientMapFilter->GetOutput() );
>  deformableModelFilter->SetInput( triangleToSimplexFilter->GetOutput() );
>
>  std::cout << "Updating the deformable model..." << std::endl;
>  try
>  {
>    deformableModelFilter->Update();
>  }
>  catch( itk::ExceptionObject & excep )
>  {
>    std::cerr << "Exception caught while updating the deformable model!" <<
> std::endl;
>    std::cerr << excep << std::endl;
>    return;
>  }
>  std::cout << "Done." << std::endl;
> }
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090816/2bae0149/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DeformableModel4.cxx
Type: text/x-c++src
Size: 6684 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090816/2bae0149/attachment-0001.cxx>


More information about the Insight-users mailing list