[Insight-users] Deformable registration using FEM: Visualize Mesh

Steve Lancey steve.lancey at gmail.com
Sun Mar 7 17:03:57 EST 2010


Thanks for your answer, Luis.

I am currently looking at option (B).
I generated the grid and use the WarpImageFilter.



 typedef itk::WarpImageFilter<MovingImageType,
MovingImageType,DeformationFieldType  >     WarperType;
    typedef itk::LinearInterpolateImageFunction<MovingImageType, double  >
 InterpolatorType;
    WarperType::Pointer warper = WarperType::New();
    InterpolatorType::Pointer interpolator = InterpolatorType::New();
    FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput();


    warper->SetInput( movingImageReader->GetOutput() );
    warper->SetInterpolator( interpolator );
    warper->SetOutputSpacing( fixedImage->GetSpacing() );
    warper->SetOutputOrigin( fixedImage->GetOrigin() );

    warper->SetDeformationField( fieldReader->GetOutput() );


    typedef  float  OutputPixelType;
    typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
    typedef itk::CastImageFilter< MovingImageType, OutputImageType >
CastFilterType;
    typedef itk::ImageFileWriter< OutputImageType >  WriterType;


    WriterType::Pointer writer =  WriterType::New();

With the original image as fixed image, the grid as moving image and the
'registrationFilter->WriteDisplacementFieldMultiComponent()' as input for
the VectorDisplacementField.

Somehow the resulting image doesn't show the output as expected. As a sanity
check I used the fixed image / moving image and VectorDeformationField
obtained through the FEM registration hoping to get to the same result as
when calling

registrationFilter->WriteWarpedImage(
        (registrationFilter->GetResultsFileName()).c_str());

But the result is different. Any ideas / help is highly appreciated.

Thanks,

S.

On Tue, Feb 23, 2010 at 5:23 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

> Hi Steve,
>
> Option (A)
>
> The original FEM code in ITK has a compile flag:
>
>          FEM_BUILD_VISUALIZATION
>
> but, given that Visualization was not in the scope of
> ITK, this code has probably never been exercised.    :-(
>
>
> Option (B)
>
> You could use the filters that overlap a grid on an
> image, and resample that grid image through the
> deformation field computed by the FEM registration
> method.
>
> See
>             Insight/Code/Review/
>                           itkGridImageSource.h
>
> and its explanation in the Insight Journal paper
>
>            "Gridding Graphic Graticules"
>            Tustison N., Avants B., Gee J.
>            University of Pennsylvania
>            http://hdl.handle.net/1926/475
> http://www.insight-journal.org/browse/publication/140
>
>
> -----
>
> Regarding the process of creating a customized
> Mesh:
>
>        We don't have such functionality in ITK.
>
> Mesh Generation is outside of the scope of ITK.
>
> You will find very useful to look at:
>
>
> http://www.na-mic.org/Wiki/index.php/NA-MIC_NCBC_Collaboration:Automated_FE_Mesh_Development
>
> as a possible solution.
>
> This is an Open Source application based
> on ITK and VTK
>
>
>
>     Regards,
>
>
>               Luis
>
>
>
> -------------------------------------------------------
> On Mon, Feb 22, 2010 at 9:52 PM, Steve Lancey <steve.lancey at gmail.com>
> wrote:
> > Hi,
> >
> > I have two questions:
> >
> > 1) I would like to store the generated mesh after every iteration of the
> > energy minimization procedure and visualize them later (as a binary
> images
> > or paths).
> > What is the best way to achieve this?
> >
> > 2) What is the best tool to create a mesh manually, including the
> assignment
> > of mesh element properties?
> >
> > Thanks for taking your time,
> >
> > Steve Lancey
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100307/e8b6f6fa/attachment.htm>


More information about the Insight-users mailing list