[slicer-users] Apply Deformable BSpline Registration tfm on other images

Andriy Fedorov fedorov at bwh.harvard.edu
Wed Apr 14 17:09:26 EDT 2010


Hi Francois,

Thank you so much for looking into this issue!

Still, I am quite confused. We have linear+bspline transform, and two
different tools give different results. How can this not be a bug?

The transformation is usually obtained as a result of registration.
Registration is using some metric, which is using some transform,
which in turn should be evaluated very deterministically. When we do
registration with affine+bspline transform, as far as I know there are
only two options:

(1) to resample the image first with affine, and then do registration, or

(2) to specify affine transform as bulk transform of the bspline transform.

In my opinion, the second approach is clearly preferred as more
accurate. "Bulk transform" is not a feature of BRAINSFit, it is a
(very nice) feature of ITK. When one needs to resample an image with
affine+bspline, the process is quite similar -- specify bulk transform
for bspline, and pass the whole thing to ResampleImageFilter. All that
bulk transform does, it adds additional transformation for the input
point before bspline evaluation (see
Code/Common/itkBSplineDeformableTransform.txx:713).

To understand what is the source of the difference, I investigated
this a bit. Please correct me if I am wrong, but briefly looking at
ResampleVolume2.cxx, I see something like this in Rotate() function:

  transformsList = ReadTransformsFromFile() // == { affine, bspline }
in our case
  image = inputImage
  foreach T in TransformsList do
     image = resample(image, T)
  done

Based on this last observation, it seems quite clear what is the
source of the difference. When you resample, you lose accuracy due to
the unnecessary intermediate conversion of point to voxel after the
first affine transform T_1. When you apply bspline transform T_2 after
this, instead of using T_1(input point) as the input to T_2(), you use
VoxelToPoint(PointToVoxel(T_1(input point))), which picks the center
of the voxel.

In my opinion, this is clearly a bug, since it introduces unnecessary
loss of precision. Please let me know why this is not a bug in your
opinion. Maybe I am totally missing something, I apologize if this is
the case. Please correct me.

I cc this to slicer-devel, this is out of place in slicer-user.

Thanks

AF




On Wed, Apr 14, 2010 at 15:47, Francois Budin <budin at bwh.harvard.edu> wrote:
> Hi everyone,
>
> Resample Scalar/DTI Volume should actually work with BSpline
> transforms. The problem described in this bug report is actually not a
> bug, but an incompatibility between two software which do not read the
> same way the file containing the transforms. For more details, please
> refer to http://na-mic.org/Mantis/view.php?id=709
> However, as Dominik said, use the latest version of Resample
> Scalar/DTI since a couple bugs have been resolved in the last months.
> Sincerely,
>
> Francois
>
> On Tue, Apr 13, 2010 at 17:35, Andriy Fedorov <fedorov at bwh.harvard.edu> wrote:
>> Frances,
>>
>> You need to be careful if you use "Resample Scalar/DTI Volume" module
>> for resampling with bspline transform.
>>
>> Please see unresolved bug http://na-mic.org/Mantis/view.php?id=709.
>> The bug report describes the problem, and provides some alternative
>> solutions within NA-MIC kit.
>>
>> Let us know about your experience.
>>
>> AF
>>
>>
>>
>>
>> On Tue, Apr 13, 2010 at 17:22, Dominik Meier <meier at bwh.harvard.edu> wrote:
>>> Hi Frances
>>> The "Harden Transform" function currently only works for linear (affine)
>>> transforms, not (yet) for non-rigid BSplines.
>>> The module to use is the "Resample Scalar/DTI Volume".  Note that this
>>> module has been subject to changes/fixes in 3.5, so if your version does not
>>> what expected consider downloading the latest nightly build.
>>> http://www.slicer.org/slicerWiki/index.php/Modules:ResampleScalarVectorDWIVolume-Documentation-3.6
>>> Best,
>>> Dominik
>>>
>>>
>>>
>>> On Apr 13, 2010, at 5:13 PM, Frances L. kiM Pik wrote:
>>>
>>> Hi,
>>> I am trying to apply the resulting transformation matrix (.tfm) from
>>> 'Deformable BSpline Registration' onto another images. I have tried to do
>>> that through the Data Module with the Harden Transform feature. However, the
>>> transformation does not seem to be applied.
>>> I am wondering if this is the correct way to use the tfm result.
>>> Regards,
>>> Frances
>>> ________________________________
>>> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
>>> Get started.
>>> _______________________________________________
>>> slicer-users mailing list
>>> slicer-users at bwh.harvard.edu
>>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>>> To unsubscribe: send email to slicer-users-request at massmail.spl.harvard.edu
>>> with unsubscribe as the subject
>>>
>>> _______________________________________________
>>> slicer-users mailing list
>>> slicer-users at bwh.harvard.edu
>>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>>> To unsubscribe: send email to slicer-users-request at massmail.spl.harvard.edu
>>> with unsubscribe as the subject
>>>
>> _______________________________________________
>> slicer-users mailing list
>> slicer-users at bwh.harvard.edu
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>> To unsubscribe: send email to slicer-users-request at massmail.spl.harvard.edu with unsubscribe as the subject
>



More information about the slicer-users mailing list