[Insight-users] DeformableRegistration

Luca Nicotra nicotra at cli.di.unipi.it
Fri May 28 19:40:43 EDT 2004


Hi All,
I am trying to use the DeformableRegistration1.cxx for 3D images.
The 2D case works fine, except for the fact that it is not able to
handle very long file names, and when I call
X->SetConfigFileName(paramname) I get a segmentation fault.
But this can be easily fixed just calling movingfilter->SetFileName
directly with the string name of the file, and just leaving some
non-existing name in the config file. It's not nice but it works.
The problem is when I try to use the example in 3D. 
I change the ElementType, ImageType and fileImageType from 2D to 3D and
I add X->WriteDisplacementFiled(2) as suggested. 
I also modify the FiniteElementParameters1.txt file with the right voxel
dimension [512,512,19].

When I do these modifications (actually just changing the typedef),
instead of getting:


Example configured. E 10000 rho 10000
 reading moving /non_existing
 reading fixed /non_existing
 beginning level 0
 scaling 1
 scaling 1
 ElementsPerDim 32 32
 init interpolation grid : im sz 129 129 MeshSize 128 128
 done initializing interpolation grid
 applying loads
 which node 1
 edge coord 4 0
 which node 1
 edge coord 4 0
 which node 3
 edge coord 0 4
 which node 3
 edge coord 0 4
 node 1
 allocating deformation field
 load sizes [128, 128]  image [128, 128]
 load sizes [128, 128]  image [128, 128]
 energy 523905
 interpolating vector field of size [128, 128] interpolation done
 min E 0 delt E -523905 iter 1
 load sizes [128, 128]  image [128, 128]
 energy 468093
 interpolating vector field of size [128, 128] interpolation done
 min E 523905 delt E 55812.4 iter 2
 load sizes [128, 128]  image [128, 128]
 energy 403147
 interpolating vector field of size [128, 128] interpolation done
 min E 468093 delt E 64946 iter 3
 load sizes [128, 128]  image [128, 128]
 energy 327912
 interpolating vector field of size [128, 128] interpolation done
 min E 403147 delt E 75234.5 iter 4
 load sizes [128, 128]  image [128, 128]
 energy 298890
 interpolating vector field of size [128, 128] interpolation done
 min E 327912 delt E 29022.6 iter 5
 load sizes [128, 128]  image [128, 128]
 energy 278490
 interpolating vector field of size [128, 128] interpolation done
 min E 298890 delt E 20399.5 iter 6
 load sizes [128, 128]  image [128, 128]
 energy 266782
 interpolating vector field of size [128, 128] interpolation done
 min E 278490 delt E 11707.7 iter 7
 load sizes [128, 128]  image [128, 128]
 energy 255536
 interpolating vector field of size [128, 128] interpolation done
 min E 266782 delt E 11246.4 iter 8
 load sizes [128, 128]  image [128, 128]
 energy 248015
 interpolating vector field of size [128, 128] interpolation done
 min E 255536 delt E 7521.35 iter 9
 load sizes [128, 128]  image [128, 128]
 energy 242721
 interpolating vector field of size [128, 128] interpolation done
 min E 248015 delt E 5293.49 iter 10
 load sizes [128, 128]  image [128, 128]
 energy 245278
 interpolating vector field of size [128, 128] interpolation done
 min E 242721 delt E -2556.45 iter 11
 load sizes [128, 128]  image [128, 128]
 energy 249401
 interpolating vector field of size [128, 128] interpolation done
 min E 245278 delt E -4123.13 iter 12
 load sizes [128, 128]  image [128, 128]
 energy 253226
 interpolating vector field of size [128, 128] interpolation done
 min E 249401 delt E -3824.88 iter 13
 load sizes [128, 128]  image [128, 128]
 energy 256950
 interpolating vector field of size [128, 128] interpolation done
 min E 253226 delt E -3724.81 iter 14
 load sizes [128, 128]  image [128, 128]
 energy 258256
 interpolating vector field of size [128, 128] interpolation done
 min E 256950 delt E -1305.73 iter 15
 load sizes [128, 128]  image [128, 128]
 energy 260205
 interpolating vector field of size [128, 128] interpolation done
 min E 258256 delt E -1948.84 iter 16
 load sizes [128, 128]  image [128, 128]
 energy 260957
 interpolating vector field of size [128, 128] interpolation done
 min E 260205 delt E -752.023 iter 17
 load sizes [128, 128]  image [128, 128]
 energy 262971
 interpolating vector field of size [128, 128] interpolation done
 min E 260957 delt E -2014.32 iter 18
 load sizes [128, 128]  image [128, 128]
 energy 262291
 interpolating vector field of size [128, 128] interpolation done
 min E 262971 delt E 680.297 iter 19
 load sizes [128, 128]  image [128, 128]
 energy 260355
 interpolating vector field of size [128, 128] interpolation done
 min E 262291 delt E 1935.8 iter 20
 field pix -0.146211  -0.00637049
 max  vec 3.89539
 field size [128, 128]
 end level 0 allocating m_FloatImage
 get jacobian
 min Jacobian 0.246258
Warping image
Writing displacements to ./RatLung_dispxvec.hdr  ...done
Writing displacements to ./RatLung_dispyvec.hdr  ...done
Writing multi-component displacement vector field...done

I GET:

Example configured. E 0 rho 0
 reading moving
 reading fixed
 beginning level 0
 scaling 1
 scaling 1
 scaling 1
 ElementsPerDim 512 512 19
File  not found!
 applying loads
 
no landmark file specified.
 num of LM loads 0
 landmarks done
 allocating deformation field
 load sizes [512, 512, 19]  image [512, 512, 19]
 load sizes [512, 512, 19]  image [512, 512, 19]
 energy 0
Aborted

It seems like it is interpreting the parameter file in a wrong way.
Whatever I write on that file E and rho are always 0 and also the two
file names (which should be /non_existing) are not loaded properly.
Is there something I need to change in the parameter file or in he cxx
file ?
Thank you in advance.

-luca-


More information about the Insight-users mailing list