Deterministic Atlas

275 views
Skip to first unread message

Isaac Engel

unread,
Apr 14, 2020, 1:54:08 PM4/14/20
to Deformetrica
Hello,

First of all, thanks to the developers for making this amazing piece of software!
I have a some questions regarding the Deterministic Atlas.

1. The documentation says that a template is calculated as the mean of the objects. Then, what is the purpose of providing a template object (e.g. the 'round' skull in the 2D atlas example)? If I set the "freeze template" parameter to 'off', is the template still used for something, e.g. for initialization?

2. Is it good practice to use one of the objects as the template, if a 'prototype' shape is not available?

3. I tried to run the 3D atlas example and it seems that the estimated template is identical to the prototype shapes. Also, the reconstructed shapes look more similar to each other than to the targets. Is this normal? If not, what parameters should I use to get the best results? I tried increasing the max iterations from 10 to 100 but it didn't make much of a difference...

Thank you!
Isaac

Alexandre Bône

unread,
Apr 29, 2020, 6:16:25 AM4/29/20
to Deformetrica
Hello Isaac, 

Thank you for your interest. 

1). The computed template can be understood as the "geodesic" mean of the input objects, seen as points in a non-Euclidean space. In other words, it is not a trivial or classical (i.e. Euclidean) mean of the objects. This generalized notion of average cannot be computed in closed-form, and is therefore approximated with an iterative procedure, implemented as the "Deterministic Atlas" pipeline in Deformetrica. 
If in some theoretical sense the computed template should be the same irrespectively of the required initial "prototype" object that is required from the user, in practice this initial choice may weight some importance. In particular, its connectivity (i.e. the number and topological layout of edges in 2D or triangles in 3D) will be conserved throughout the computation: only the spatial locations of the corresponding extremities are updated. It is good practice for the user to check that the computed template does not change significantly (according to your own criteria) when varying the initial prototype. 
Setting the "freeze template" to "on" would block the initial user-provided template. In other words, the template is not estimated. Only the individual deformations of this template towards the provided objects are computed. This is therefore equivalent to solving several independent registration problems. 

2). It is a fair and reasonable attempt. The best practice would be to use an unbiased and, maybe more importantly, smooth prototype. 
Personally, I first register a smooth sphere or ellipsoid towards one particular example (if possible not from your data set e.g. segmented MNI atlas for neuroimaging), and choose an intermediate deformation step. This ensures a satisfying smoothness, and favors a satisfying "deterministic atlas" computation. 

3). What you are describing is not normal. Have you solved this problem? Otherwise I could have a look at your console logs. 

Best, 
Alex 

Isaac Engel

unread,
Apr 29, 2020, 7:00:00 AM4/29/20
to Deformetrica
Hi Alex,

Thanks for your reply, this is very helpful!

Unfortunately I made no progress with the 3D example. This is the console output:

(deformetrica) isaac@Isaac-HP:~/linux/examples/atlas/landmark/3d/brain_structures$ deformetrica estimate model.xml data_set.xml -p optimization_parameters.xml -v INFO
INFO:deformetrica:No output directory defined, using default: /mnt/c/users/isaac/box sync/linux/examples/atlas/landmark/3d/brain_structures/output
Logger has been set to: INFO
>> No initial CP spacing given: using diffeo kernel width of 7.0
OMP_NUM_THREADS was not found in environment variables. An automatic value will be set.
OMP_NUM_THREADS will be set to 1
>> No specified state-file. By default, Deformetrica state will by saved in file: /mnt/c/users/isaac/box sync/linux/examples/atlas/landmark/3d/brain_structures/output/deformetrica-state.p.
{'initial_step_size': 0.01, 'scale_initial_step_size': True, 'line_search_shrink': 0.5, 'line_search_expand': 1.5, 'max_line_search_iterations': 10, 'optimized_log_likelihood': 'complete', 'optimization_method_type': 'gradientascent', 'max_iterations': 10, 'convergence_tolerance': 0.0001, 'print_every_n_iters': 1, 'save_every_n_iters': 100, 'gpu_mode': <GpuMode.KERNEL: 4>, 'state_file': '/mnt/c/users/isaac/box sync/linux/examples/atlas/landmark/3d/brain_structures/output/deformetrica-state.p', 'load_state_file': False, 'memory_length': 10}
>> Set of 84 control points defined.
>> Momenta initialized to zero, for 4 subjects.
Starting multiprocess using 4 processes
INFO:core.models.abstract_statistical_model:pid=89 : PoolWorker-0
INFO:core.models.abstract_statistical_model:pid=94 : PoolWorker-1
INFO:core.models.abstract_statistical_model:pid=99 : PoolWorker-2
INFO:core.models.abstract_statistical_model:pid=104 : PoolWorker-3
Multiprocess pool started using start method "file_descriptor" in: 8.696675599999992 seconds
>> Started estimator: GradientAscent
------------------------------------- Iteration: 0 -------------------------------------
>> Log-likelihood = -1.266E+04   [ attachment = -1.266E+04 ; regularity = 0.000E+00 ]
>> Step size and gradient norm:
                9.690E-07   and   1.032E+04     [ landmark_points ]
                1.107E-05   and   9.030E+02     [ momenta ]
------------------------------------- Iteration: 1 -------------------------------------
>> Log-likelihood = -1.265E+04   [ attachment = -1.265E+04 ; regularity = -2.408E-04 ]
>> Step size and gradient norm:
                1.454E-06   and   1.031E+04     [ landmark_points ]
                1.661E-05   and   9.023E+02     [ momenta ]
------------------------------------- Iteration: 2 -------------------------------------
>> Log-likelihood = -1.263E+04   [ attachment = -1.263E+04 ; regularity = -1.504E-03 ]
>> Step size and gradient norm:
                2.180E-06   and   1.030E+04     [ landmark_points ]
                2.492E-05   and   9.012E+02     [ momenta ]
------------------------------------- Iteration: 3 -------------------------------------
>> Log-likelihood = -1.261E+04   [ attachment = -1.261E+04 ; regularity = -5.420E-03 ]
>> Step size and gradient norm:
                3.270E-06   and   1.028E+04     [ landmark_points ]
                3.738E-05   and   8.996E+02     [ momenta ]
------------------------------------- Iteration: 4 -------------------------------------
>> Log-likelihood = -1.257E+04   [ attachment = -1.257E+04 ; regularity = -1.583E-02 ]
>> Step size and gradient norm:
                4.906E-06   and   1.025E+04     [ landmark_points ]
                5.607E-05   and   8.973E+02     [ momenta ]
------------------------------------- Iteration: 5 -------------------------------------
>> Log-likelihood = -1.252E+04   [ attachment = -1.252E+04 ; regularity = -4.156E-02 ]
>> Step size and gradient norm:
                7.358E-06   and   1.021E+04     [ landmark_points ]
                8.410E-05   and   8.937E+02     [ momenta ]
------------------------------------- Iteration: 6 -------------------------------------
>> Log-likelihood = -1.244E+04   [ attachment = -1.244E+04 ; regularity = -1.027E-01 ]
>> Step size and gradient norm:
                1.104E-05   and   1.015E+04     [ landmark_points ]
                1.261E-04   and   8.885E+02     [ momenta ]
------------------------------------- Iteration: 7 -------------------------------------
>> Log-likelihood = -1.233E+04   [ attachment = -1.233E+04 ; regularity = -2.444E-01 ]
>> Step size and gradient norm:
                1.656E-05   and   1.006E+04     [ landmark_points ]
                1.892E-04   and   8.806E+02     [ momenta ]
------------------------------------- Iteration: 8 -------------------------------------
>> Log-likelihood = -1.216E+04   [ attachment = -1.216E+04 ; regularity = -5.669E-01 ]
>> Step size and gradient norm:
                2.483E-05   and   9.925E+03     [ landmark_points ]
                2.838E-04   and   8.689E+02     [ momenta ]
------------------------------------- Iteration: 9 -------------------------------------
>> Log-likelihood = -1.191E+04   [ attachment = -1.191E+04 ; regularity = -1.289E+00 ]
>> Step size and gradient norm:
                3.725E-05   and   9.725E+03     [ landmark_points ]
                4.257E-04   and   8.516E+02     [ momenta ]
------------------------------------- Iteration: 10 -------------------------------------
>> Log-likelihood = -1.155E+04   [ attachment = -1.155E+04 ; regularity = -2.882E+00 ]
>> Estimation took: 04 seconds
(deformetrica) isaac@Isaac-HP:~/linux/examples/atlas/landmark/3d/brain_structures$



Isaac Engel

unread,
Apr 29, 2020, 7:02:21 AM4/29/20
to Deformetrica
I just realised I could have attached the actual log file. Here it is!
2020-04-29-105057_info.log

Alexandre Bône

unread,
Jun 11, 2020, 2:40:21 AM6/11/20
to Deformetrica
Hello Isaac, 

Sorry for my very late answer. 

Everything seems fine in your log, except for the early stopping. Could you show me the log with, say, 200 iterations? 
Maybe try as well to set <initial-step-size>1e-1</initial-step-size>. Here the used value seems smaller, and probably a bit too small. 

Best, 
Alex 

Mykolas Imbrasas

unread,
May 24, 2022, 1:12:45 PM5/24/22
to Deformetrica
Hello Alexandre and Isaac,

Has this issue been solved? I am experiencing the same problem, even when I set the number of iterations to 200 and  <initial-step-size>1e-1</initial-step-size>.

Best,
Mykolas

Reply all
Reply to author
Forward
0 new messages