关于antsMultivariateTemplateConstruction2.sh参数设置问题

关于antsMultivariateTemplateConstruction2.sh参数设置问题这是我在官方页面发布的问题,作者回答了我,但有一些细节我不是很明白,缺少图像这方面的背景知识

https://github.com/ANTsX/ANTs/discussions/1347

我问到了作者关于A maximum of 90 iterations at the coarsest level, 30 at the next coarsest, and 90 at full resolution的参数问题,关于这个参数help文件说明是:

作者在回答中有提及,但说到这个usage帮助说明有一点错误,the coarseness of the levels是由-f命令控制,最终更让我迷惑了:

-q:  Max iterations for each pairwise registration (default = 100x100x70x20)
   specified in the form ...xJxKxL where
   - J = max iterations at coarsest resolution (here, reduced by power of 2^2)
   - K = middle resolution iterations (here, reduced by power of 2)
   - L = fine resolution iterations (here, full resolution).
   - Finer resolutions take much more time per iteration than coarser resolutions.

I’m sorry the usage is a bit wrong here (copied from the older script), the coarseness of the levels is controlled by you with -f. I’ll update it.

-f: Shrink factors (default = 6x4x2x1): Also in the same form as -q max iterations. Needs to have the same number of components.
-s:  Smoothing factors (default = 3x2x1x0):  Also in the same form as -q max iterations.  Needs to have the same number of components.

In the older script, -f and -s were hidden from the user and -f was fixed at powers of 2. So if you said -m 100x100x50x20, it would use shrink factors of 8x4x2x1.

在老版本antsMultivariateTemplateConstruction.sh中,关于Max-iterations in each registration是-m命令,新版本antsMultivariateTemplateConstruction2.sh是-q命令

-m:  Max-iterations in each registration

所以,-q(新版本)或-m(旧版本)与-f之间是不是存在对应关系?
-q/-m不用默认的设置,-f是不是应该跟着变,这个关系应该怎么算,怎么理解?

作者提到So if you said -m 100x100x50x20, it would use shrink factors of 8x4x2x1,原默认设置是-q 100x100x70x20 -f 6x4x2x1,或者-q 30x20x4 -f 4x2x1

我看cookpa的意思是,如果你用的是旧版脚本,那么-f的设置是固定的。但是在新版里,-q和-f是可以独立设置的,但是要保持数目一致(component)。而cookpa所谓错误是指-q选项里的注释错误。

诶呀,我一改完你就回复了。噢噢,这一块我懂了。
还有一点是,
如果我要按照这个文献上的A maximum of 90 iterations at the coarsest level, 30 at the next coarsest, and 90 at full resolution这个参数,我应该会写成:
-q 90x30x90 -f 4x2x1 -s 2x1x0
不过默认是default = 100x100x70x20,按着说明,后三位分别是J,K,L,那第一位是代表什么意思?参数写成四位与三位有什么区别?

-q:  Max iterations for each pairwise registration (default = 100x100x70x20):
   specified in the form ...xJxKxL where
   J = max iterations at coarsest resolution (here, reduced by power of 2^2)
   K = middle resolution iterations (here, reduced by power of 2)
   L = fine resolution iteratioxns (here, full resolution).
   Finer resolutions take much more time per iteration than coarser resolutions.

-q和-f没有对应关系,但是按照cookpa的说法,旧版是没有-f选项的,所以有对应关系,这也就是cookpa所谓新版写错的地方。在新版的注释里-q选项里还是有一句 reduced by power of 2^2等等。-q就是每一个阶段中配准迭代的次数,数值越大越有收敛到最佳值。我觉得一般默认参数都是作者自己调好了的,除非结果不好,才有必要去调整。

本来我还在改上一条回复的内容。。。
诶呀,我一改完你就回复了。感谢
噢噢,这一块我懂了。
还有一点是,
他的例子当中有-f 4x2x1 -s 2x1x0vox -q 30x20x4,也有-f 6x4x2x1 -s 4x2x1x0vox -q 200x100x50x0
默认是default = 100x100x70x20,也是有四个数,按着说明,后三位分别是J,K,L,那第一位是代表什么意思?参数写成四位与三位有什么区别?
-q: Max iterations for each pairwise registration (default = 100x100x70x20):
specified in the form …xJxKxL where
J = max iterations at coarsest resolution (here, reduced by power of 2^2)
K = middle resolution iterations (here, reduced by power of 2)
L = fine resolution iteratioxns (here, full resolution).
Finer resolutions take much more time per iteration than coarser resolutions.

我的理解是,整个过程采用的是multi-resolution的策略,最开始就是最粗糙的分辨率下(比如把图像重采样到8mm),然后可能是4mm,最精细的配准是在1mm等等,在每一个分辨率下,都需要多次迭代。所以如果-f是3个数,那么就是三个分辨率阶段,如果是四个数,就是四个分辨率阶段。在每一个分辨率下的迭代次数,通过-q来控制。当然,-f里每个数字的意思可能并不是分辨率的单位,但是表达的意义应该是类似的。

理解了,非常感谢!!!