[Insight-users] FEMRegistrationFilter: multi-resolution techniques
Brian B Avants
avants at grasp.cis.upenn.edu
Wed, 14 Jan 2004 12:50:59 -0500 (EST)
Jens * glad to hear you're having some success already. Your approach is
the correct one. Level by level optimization is the most efficient. You
will find, also, that the parameters from previous levels are usually
inherited fairly well. As for looking at the output from a single (low)
level registration, what you have found might qualify as a bug. Your
intuition about what's happening is likely correct in that the size of the
deformation field and the image is mismatched. Without changing any code,
you can look at your output by setting the number of iterations at the
higher levels to 1 (as in your code below) but with large material
parameters, enforcing zero change in the field. The filter will then
expand the fem domain and deformation fields so that they should be
matched to the full resolution image.
as for diagnosing the mismatch problem, one thing you can try is this:
run the registration at the low resolution
create a deformation field pointer in your app and get the output field
field = femregistration->GetDeformationField();
check the size and spacing of the field
std::cout << " spacing " << field->GetSpacing() << " size " <<
field->GetLargestPossibleRegion().GetSize() << std::endl;
these values should be the same as the fixed image.
if they are not, it could be because of something in the
VectorExpandImageFilter. my local copy did not set spacings correctly in
some cases. the code i changed was in generateoutputinformation
outputSpacing[i] = inputSpacing[i] / (float)((long)((float)
m_ExpandFactors[i]+0.5));
i'm not sure what the state of the release/cvs code is.
you can also monitor the progress of the image registration by adding :
WarpImage(m_Load->GetMovingImage());
WriteWarpedImage(m_ResultsFileName.c_str());
at the end of the iterativesolve() loop in the femregistrationfilter. you
can do this every nth iteration if you like.
let us know if you have other questions and if you have luck fixing the
problem.
Brian
On Wed, 14 Jan 2004, Jens Fisseler wrote:
> Hi everybody!
>
> I'm quite new to ITK and I'm currently using the FEMRegistrationFilter
> to register two MRI liver volume datasets. The results this far are
> quite promising, but I've a question regarding the use of the
> multi-resolution technique.
>
> My datasets have the resolution 512x384x64 and I'm using a three level
> pyramid:
>
> ===================
> level resolution
> -------------------
> 0 128x96x16
> 1 256x192x32
> 2 512x384x64
> ===================
>
> As Luis Ibanez wrote in
> http://www.itk.org/pipermail/insight-users/2003-November/005704.html :
> "If a level has not converged, there are few chances that the next level
> will compensate.", I'm trying to optimise the parameters for each level
> before going up to the next. But this is where my problems start. I
> don't quite know how to get access to the deformed volume at a lower
> level in order to assess the registration. Let me explain: If I want to
> assess the deformation at level 0, I would make the registration filter
> stop after this level by setting the second line in my parameter file to
> "1". When I write the deformed image to a file it has the expected
> dimensions but is all black, probably because a small portion of the
> original volume gets deformed, which is black in this area because the
> liver has been segmented.
>
> Has anybody an idea how I can get access to downsampled deformed volume?
> Is my approach a good idea anyway?
>
> This is a part of the parameter file I'm using:
>
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> %
> % Parameters for the single- or multi-resolution techniques
> %
>
> 3 % Number of levels in the multi-res pyramid (1 = single-res)
> 1 % Highest level to use in the pyramid
> 4 4 4 % Scaling at lowest level of pyramid
> 4 4 4 % Number of pixels per element
> 1.e5 1.e4 1.e4 % Elasticity (E)
> 1.e4 1.e4 1.e4 % Density x capacity (RhoC)
> 1 1 1 % Image energy scaling (gamma) - sets gradient step size
> 2 2 2 % NumberOfIntegrationPoints
> 4 4 4 % WidthOfMetricRegion
> 10 1 1 % MaximumIterations
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> %
> % Parameters for the registration
> %
>
> 0 0.99 % Similarity metric (0=mean sq, 1 = ncc, 2=pattern int, 3=MI,
> 5=demons)
> 1.0 % Alpha
> 0 % DescentDirection (1 = max, 0 = min)
> 0 % DoLineSearch (0=never, 1=always, 2=if needed)
> 1.e1 % TimeStep
> 0.5 % Landmark variance
> 0 % Employ regridding / enforce diffeomorphism ( >= 1 -> true)
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> %
> % Information about the image inputs
> %
>
> 512 % Nx (image x dimension)
> 384 % Ny (image y dimension)
> 64 % Nz (image z dimension - not used if 2D)
> ./liver_1.mhd % ReferenceFileName
> ./liver_2.mhd % TargetFileName
>
>
> Regards,
>
> Jens
>
> --
> ==================================================================
> Institute for Robotics and Cognitive Systems -- University Luebeck
> ------------------------------------------------------------------
> Jens Fisseler tel: +49 451 500 3724
> Research Assistant secretary: +49 451 500 3720
> University Luebeck fax: +49 451 500 3722
> Ratzeburger Allee 160 mail: fisseler at rob.uni-luebeck.de
> D-23538 Luebeck, Germany www: http://www.rob.uni-luebeck.de
> ==================================================================
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>