Error in population template

Just to add one more option: Your data is upsampled to 1mm isotropic but the actual spatial resolution is a lot coarser. I would, therefore, start with a smaller scale factor (-linear_scale) of 0.2 or even 0.1.
I just tried -linear_scale 0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1 -linear_lmax 4,4,4,4,6,6,6,6,6,6 which works for the test data you sent me.

Hi max,

thanks for taking time.
i am not so fan of your first proposition, which mean I should estimate the FOD without the mask option … this increase the computation time and the size of the data, (why to use a mask if you need to compute FOD outside the mask)

I will test first the -linear_lmax option and the other branch. I guess you want me to test on the all population ?

Just to start I test on the 3 selected subjects I send you, without the -mask_dir option : it seems to works much better even though the FOD are masked (ie zero outside the mask). As I said on the begining of this thread the script seems to work well for the all population when I do not put the -mask_dir option.

I do not realy understand what the -mask_dir option changes (since the FOD I use are already masked by the same mask I put in the mask_dir)

this may be a quick solution to solve the problem :
do not use the -mask_dir for the first linear registration step and use it for the non-linear registration ?

Cheers

Romain

Hi Romain,

The size of the data should be the same as it is independent of the values stored in the voxels. The reasoning for not setting the FOD images to zero outside the mask is that the population template has smoother transitions where images end (more important if your population is small). Also, zeroing the input images alters the image intensity gradients at the boundary of the mask. I doubt that this is the main problem, though, as I also tried an eroded version of your masks.

Yes, if possible.

In the unmasked case, the cost is calculated over all voxels. The default cost function to mrregister is mean squared differences. Even if one input image to mrregister is zeroed outside the mask, the cost function values (and gradients) from those voxels are not zero if the other image is not also zero.

I suspect the voxels outside the brain of the input images regularise the gradient descent step. I’ll have to look into that in detail to be sure.

Yes, if that works for you but I would give the higher liner_lmax setting and lower spatial resolution a go first. Also, you could try a rigid registration first, save the transformations and apply them to the input images (but not regridding them to avoid interpolation) before running population_template with the affine option on the transformed input images.

Cheers,
Max

I also encountered this same error (ie mrregister: [ERROR] registration failed: encountered NaN in parameters) and realised it was because I hadn’t input the correct (normalised) dwi set into <input_dwi> Step 1 of the Fixel-Based Analysis.

Somehow I had input the corrected dwi data set (from the DWI Pre-Processing steps) rather than the normalised data. After making sure that the upsampled images were taken from the normalised dwi data set mrregsiter ran smoothly.