Thanks for your answer, Luis.<div><br></div><div>I am currently looking at option (B).</div><div>I generated the grid and use the WarpImageFilter.</div><div><br></div><div><br></div><div><br></div><div><div> typedef itk::WarpImageFilter<MovingImageType, MovingImageType,DeformationFieldType > WarperType;</div>
<div> typedef itk::LinearInterpolateImageFunction<MovingImageType, double > InterpolatorType;</div><div> WarperType::Pointer warper = WarperType::New();</div><div> InterpolatorType::Pointer interpolator = InterpolatorType::New();</div>
<div> FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput();</div><div><br></div><div> </div><div> warper->SetInput( movingImageReader->GetOutput() );</div><div> warper->SetInterpolator( interpolator );</div>
<div> warper->SetOutputSpacing( fixedImage->GetSpacing() );</div><div> warper->SetOutputOrigin( fixedImage->GetOrigin() );</div><div><br></div><div> warper->SetDeformationField( fieldReader->GetOutput() ); </div>
<div><br></div><div> </div><div> typedef float OutputPixelType;</div><div> typedef itk::Image< OutputPixelType, Dimension > OutputImageType;</div><div> typedef itk::CastImageFilter< MovingImageType, OutputImageType > CastFilterType;</div>
<div> typedef itk::ImageFileWriter< OutputImageType > WriterType;</div><div><br></div><div> </div><div> WriterType::Pointer writer = WriterType::New();</div></div><div><br></div><div>With the original image as fixed image, the grid as moving image and the 'registrationFilter->WriteDisplacementFieldMultiComponent()' as input for the VectorDisplacementField.</div>
<div><br></div><div>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</div>
<div><br></div><div><div>registrationFilter->WriteWarpedImage(</div><div> (registrationFilter->GetResultsFileName()).c_str());</div></div><div><br></div><div>But the result is different. Any ideas / help is highly appreciated.</div>
<div><br></div><div>Thanks,</div><div><br></div><div>S.</div><div><br><div class="gmail_quote">On Tue, Feb 23, 2010 at 5:23 PM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Steve,<br>
<br>
Option (A)<br>
<br>
The original FEM code in ITK has a compile flag:<br>
<br>
FEM_BUILD_VISUALIZATION<br>
<br>
but, given that Visualization was not in the scope of<br>
ITK, this code has probably never been exercised. :-(<br>
<br>
<br>
Option (B)<br>
<br>
You could use the filters that overlap a grid on an<br>
image, and resample that grid image through the<br>
deformation field computed by the FEM registration<br>
method.<br>
<br>
See<br>
Insight/Code/Review/<br>
itkGridImageSource.h<br>
<br>
and its explanation in the Insight Journal paper<br>
<br>
"Gridding Graphic Graticules"<br>
Tustison N., Avants B., Gee J.<br>
University of Pennsylvania<br>
<a href="http://hdl.handle.net/1926/475" target="_blank">http://hdl.handle.net/1926/475</a><br>
<a href="http://www.insight-journal.org/browse/publication/140" target="_blank">http://www.insight-journal.org/browse/publication/140</a><br>
<br>
<br>
-----<br>
<br>
Regarding the process of creating a customized<br>
Mesh:<br>
<br>
We don't have such functionality in ITK.<br>
<br>
Mesh Generation is outside of the scope of ITK.<br>
<br>
You will find very useful to look at:<br>
<br>
<a href="http://www.na-mic.org/Wiki/index.php/NA-MIC_NCBC_Collaboration:Automated_FE_Mesh_Development" target="_blank">http://www.na-mic.org/Wiki/index.php/NA-MIC_NCBC_Collaboration:Automated_FE_Mesh_Development</a><br>
<br>
as a possible solution.<br>
<br>
This is an Open Source application based<br>
on ITK and VTK<br>
<br>
<br>
<br>
Regards,<br>
<br>
<br>
Luis<br>
<br>
<br>
<br>
-------------------------------------------------------<br>
<div><div></div><div class="h5">On Mon, Feb 22, 2010 at 9:52 PM, Steve Lancey <<a href="mailto:steve.lancey@gmail.com">steve.lancey@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I have two questions:<br>
><br>
> 1) I would like to store the generated mesh after every iteration of the<br>
> energy minimization procedure and visualize them later (as a binary images<br>
> or paths).<br>
> What is the best way to achieve this?<br>
><br>
> 2) What is the best tool to create a mesh manually, including the assignment<br>
> of mesh element properties?<br>
><br>
> Thanks for taking your time,<br>
><br>
> Steve Lancey<br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br>
</blockquote></div><br></div>