[Insight-users] Problems using FEM Registration with my own mesh

Nicholas Tustison ntustison at gmail.com
Thu Jan 25 10:18:01 EST 2007


Hi Jonathan,

The error code that is being returned indicates that your sparse  
matrix is
'full' and, therefore, can't be added to with values from additional  
elements.
You're going to have to modify the class itkFEMRegistrationFilter.txx
(about line 152) to accommodate the number of non-zero entries
that you predict to have.  The lines of code in question are as follows:

unsigned int nzelts;
if (!m_ReadMeshFile)
    {
    nzelts=numnodesperelt*ndofpernode*ndof;
    }
else
    {
    nzelts=((2*numnodesperelt*ndofpernode*ndof > 25*ndof) ?  
2*numnodesperelt*ndofpernode*ndof : 25*ndof);
    }
LinearSystemWrapperItpack itpackWrapper;
itpackWrapper.SetMaximumNonZeroValuesInMatrix(nzelts);

The bad news:  I believe that Itpack (the primary solver used to solve
the linear system) is no longer distributed with ITK due to licensing
issues.  This presents a severe difficulty since the vnl sparse matrix
solver is much more limited than Itpack in the size of matrices that it
can handle.  This translates into a relatively small limit on the size
of meshes that can be used to solve FEM problems.

As regards your second question---it is possible however you have
to assign adequate boundary conditions to ensure that your linear
system is well-conditioned.  For example, the current implementation
found in the class itkFEMRegistrationFilter fixes the nodes of the mesh
located in the corner of the image.

Good luck,
Nick



On Jan 25, 2007, at 8:51 AM, Jonathan Orban wrote:

> Hi,
>
> I'm currently working on FEM Registration (Image is 90*90*80 and has
> only pixel dimensions => the range of the image is [0->89, 0->89,
> 0->79]). I'm trying to use my own mesh (687 nodes for 3447  
> elements) to
> do this. My mesh has the same range than the image [0->89, 0->89,
> 0->79]. Thanks to N. Tustison, I managed to transform my .vtk file in
> a .fem file that looks just like the examples proposed in the
> itk->Testing->Data->Input->FEM. I tried a registration based on
> DeformableRegistration1.cxx with the
> FiniteElementRegistrationParameters1.txt with some adaptation to  
> use 3D
> images.
>
> The registration starts by loading everything and  applying loads on 3
> different nodes (is it possible to chose these nodes?). Then it
> allocates the deformation field with load sizes of [90,90,80] and  
> image
> [90,90,80] and gives me the following error:
>
>> terminate called after throwing an instance of  
>> 'itk::fem::FEMExceptionItpackSparseMatrixSbsij'
>>   what():  /export/itk/InsightToolkit-3.0.1/Code/Numerics/FEM/ 
>> itkFEMItpackSparseMatrix.cxx:305:
>> Error: maximumNumberOfNonZeroValuesInMatrix is too small
>> Aborted (core dumped)
>
> Does anybody know that kind of error?
>
> I have also another question related to the same topic. I have images
> where the body to be registered is surrounded by air. Is it possible
> to define a mesh only on this body and not on the entire image in  
> order
> to add elastic properties only on the body and not on the air? Or do I
> have to define a mesh on the whole image and give different properties
> on the body and on the air?
>
>
> Thanks for your answers,
>
>
> Jonathan Orban
>
> Communications and Remote Sensing Lab.
> UCL/TELE, Belgium
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070125/a7e1661c/attachment.html


More information about the Insight-users mailing list