Hi Julien
I was trying to create an atlas using msct_multiatlas_seg. It always ended up in an NaN error when trying to calculate the PCA in the end.
I was using the following command:
msct_multiatlas_seg -path-data test -o testAtlas -sq-size 30 -axial-res 0.1333
I digged a little deeper and I have seen that the problem lies within the co-registration in coregister_model_data
. After
im_slice_reg, fname_src2dest, fname_dest2src = register_data(im_src=im_slice, im_dest=im_mean, param_reg=self.param_data.register_param, path_copy_warp=warp_dir)
the image im_slice_reg
only consists of the upper left quarter and everything else is cropped to 0.
I also digged into that and have seen that the warping fields of the registration steps are not properly concatenated together using sct_register_multimodal
> sct_concat_transfo
> isct_ComposeMultiTransform
.
At line
sct.run(['sct_concat_transfo', '-w', ','.join(warp_forward), '-d', 'dest.nii', '-o', 'warp_src2dest.nii.gz'], verbose)
warp_forward
is ['warp_forward_0.nii.gz', 'warp_forward_1.nii.gz', 'warp_forward_2.nii.gz']
and each 'warp_forward_*.nii.gz'
in my case was a 0-vector field (probably because I already preregistered them, but there might also be a problem),
but 'warp_src2dest.nii.gz'
consisted of 0s in the upper left quarter and everything else had the value of 3.4028235e+38.
The anterior-posterior and left-right dimension sizes of 'warp_src2dest.nii.gz'
and 'warp_forward_*.nii.gz'
were the same. So it did not just concatenate the image domains. But I wonder what happens inside isct_ComposeMultiTransform
.
I tested it with 2 different SCT versions:
- the current dev version (Fri Feb 8 17:36:15 2019 -0500)
- 3.2.7
Together with numpy 1.12.0.
Is there an easy fix to this problem?
Best,
Antal