Guo-Stone / MambaMorph

MambaMorph: a Mamba-based Framework for Medical MR-CT Deformable Registration
MIT License
63 stars 8 forks source link

程序报错 #4

Closed xing1313 closed 5 months ago

xing1313 commented 5 months ago

作者您好,非常感谢您的工作,我在复现您的工作的时候出现维度无法拼接的问题如上图所示,可以问一下您是如何解决的吗? 微信图片_20240412165924 微信图片_20240412165936

Guo-Stone commented 5 months ago

As far as I know, the problem is from your volume size. Q: Why? A: MambaMorph utilizes the framework of TransMorph. Given a volume, this framework will divide it into lots of pathces of size [4, 4, 4] and downsample this volume sequence. If your volume size can't be divided exactly by 16, you may encounter this problem.

Q: How to solve it? A: Please make sure that your volume size can be divided by 16 exactly. For instance, the volume size in my SR-Reg dataset is [176, 192, 208], 176 / 16 = 11, 192 / 16 = 12, 208 / 16 = 13.

I hope that my suggestion can help.

xing1313 commented 5 months ago

作者您好,谢谢您的回答,我用的是您的数据集 [176, 192, 208],但是在图中红框标注的地方:最后一层Mamba输出为[6,7,6]up1上采样后为[12,14,12],在和 skip(f1)[11,13,12] 进行up1时无法拼接,请问您有什么办法可以解决吗? ceb8cdead80af738e17635de14ba5eb d5180325b60d6a8d0b0b68c78d8d8ac

Guo-Stone commented 5 months ago

Your error is likely attributed to the number of downsampling operation. Have you ever modified the setting of MambaMorph? The length of 'config.depths' can't be larger than 3, or it may downsample excessively and encounter your error. My setting: 'config.depths = (2, 2, 4)'. If you set 'config.depths = (2, 2, 4, 2)', the bug your mentioned may appear.

xing1313 commented 5 months ago

Thank you very much for the patient answers! This helps a lot!

Guo-Stone commented 5 months ago

Thx for your recognition. By the way, if you want to set 'config.depths = (2, 2, 4, 2)', your volume size must be divided by 32 exactly. For example, [160, 160, 192]. Could you give a star for this repository? orz

xing1313 commented 5 months ago

Thank you , I have given it one star.