Question about vector field directions / Jacobians

93 views
Skip to first unread message

John K

unread,
Jun 2, 2012, 6:49:16 PM6/2/12
to Plastimatch
Hi all, I've recently installed plastimatch and am aiming to use this
program to perform 4D-CT lung registration. It seems very convenient
to use so far.

I have some questions in terms of understanding the outputs - perhaps
someone here could help?

(i) My understanding that is that in ITK, the deformation vector
fields point from the fixed image to the moving image. Is this the
same for the Plastimatch implementation as well?

(ii) Part of my work requires calculation of the vf Jacobians at every
point in the image. What I'd really like is to have a volume of the
input image dimensions, but containing the Jacobian at every point.
Was there a tool for doing this in Plastimatch? I have been attempting
to do this using the DeformationFieldJacobian example in ITK 3.2, but
it is possible to use different filters (itkDisplacementFieldJacobian
and itkDeformationFieldJacobian) and I'm not sure which approach is
best.

(iii) With regards to questions (i) and (ii), are the vector fields
defined in the same way for both B-spline and Demons transformations?
Or do I have to apply different procedures to obtain the Jacobian
determinant for these two cases?

Many thanks!
John

Greg Sharp

unread,
Jun 7, 2012, 9:37:29 PM6/7/12
to plast...@googlegroups.com, kipro...@gmail.com

Hi John,

Thanks for your kind words. For 4D work, Tony recently made some
extra tools which let you use a single command file to register all
phases. Either he or I will post again after we can update the
documentation.

> I have some questions in terms of understanding the outputs - perhaps
> someone here could help?
>
> (i) My understanding that is that in ITK, the deformation vector
> fields point from the fixed image to the moving image. Is this the
> same for the Plastimatch implementation as well?

Absolutely the same. You should be able to write a vector field
from plastimatch and load in ITK. Displacements are in mm from
fixed to moving, defined on fixed grid.

> (ii) Part of my work requires calculation of the vf Jacobians at every
> point in the image. What I'd really like is to have a volume of the
> input image dimensions, but containing the Jacobian at every point.
> Was there a tool for doing this in Plastimatch? I have been attempting
> to do this using the DeformationFieldJacobian example in ITK 3.2, but
> it is possible to use different filters (itkDisplacementFieldJacobian
> and itkDeformationFieldJacobian) and I'm not sure which approach is
> best.

I wish we had this, but we don't. Instead we only print out a
summary ("plastimatch stats vf.mha") which has min and max values.
If you are willing to modify the source code, you could modify
vf_analyze_jacobian() in base/vf_stats.cxx to save these to a file.
But for permanent solution, we should add this feature to plastimatch.

> (iii) With regards to questions (i) and (ii), are the vector fields
> defined in the same way for both B-spline and Demons transformations?
> Or do I have to apply different procedures to obtain the Jacobian
> determinant for these two cases?

For B-spline, I suggest to convert to vector field
("plastimatch xf-convert"), then compute jacobian. We don't have
a method to compute Jacobian directly from B-spline coefficients.

-Greg

Marta Peroni

unread,
Jun 8, 2012, 8:23:55 AM6/8/12
to plast...@googlegroups.com
HI!

About saving the Jacobian...I do have the code for doing what John was asking...would you like me to add it? if so, where should I add it exactly?

thanks
Marta
--
*******************************************************************
Marta Peroni, PhD
Bioengineering department - Politecnico di Milano (IT)

contacts:
mail: marta....@mail.polimi.it , m.pe...@gmail.com
mobile: +393488202136 (IT) 
office: +39 02 2399 9022

********************************************************************

Greg Sharp

unread,
Jun 8, 2012, 9:44:55 PM6/8/12
to plast...@googlegroups.com, m.pe...@gmail.com

Hi Marta, that is very generous of you. Roughly speaking, here is
how I would do it.

(1) Make a new command "plastimatch jacobian". This is done by
copying a similar existing command (a good example would be
pcmd_thumbnail.cxx), and editing appropriately.

(2) Generalize vf_analyze_jacobian into three separate functions
(2a) a function that computes the jacobian volume from an input vf
(2b) a function which uses (2a) to compute and display the stats
(2c) a function which uses (2a) to write the volume

(3) Finally, write a regression test. :)

Maybe that is too much work, no prob I know you are busy.
Just add into the standalone directory.

-Greg

Marta Peroni

unread,
Jun 9, 2012, 5:48:14 AM6/9/12
to Greg Sharp, plast...@googlegroups.com
Hi!
I can probably do this in a couple of weeks :)
M.

John K

unread,
Jul 11, 2012, 1:58:29 AM7/11/12
to plast...@googlegroups.com
Hi everyone, apologies for my (very) slow reply! Thanks for answering my questions, it's great to see so much discussion happening on here, it's all very instructive. :)

Cheers,
John
Reply all
Reply to author
Forward
0 new messages