Transform from template space to subject space

Dear all,

I generated the FD, FC, and FDC images using multi-tissue CSD according to the pipeline. https://mrtrix.readthedocs.io/en/3.0.2/fixel_based_analysis/mt_fibre_density_cross-section.html

However, I would like to transform the data from template space to subject space, so I can compare the results with other images using VOIs in subject space. Therefore, in step 10, I added the -nl_warp_full option to get the full warping.

Now, I tried the following commands, but sadly without success:
• mrtransform –warp_full Subj001_1_full_warp_FOD.mih -template …/template/wmfod_template.nii –from 2 Subj001_1_FD.nii Subj001_1_FD_native.nii
• mrtransform –warp_full Subj001_1_full_warp_FOD.mih -template …/template/wmfod_template.nii –inverse Subj001_1_FD.nii Subj001_1_FD_native.nii

Does anyone has some suggestions what I am doing wrong here?

Greetings,
Chris

Hi Chris,

Could you be more specific about what ‘without success’ looks like? Does the command fail to run, or does it run but produce unusable results?

Looking at your commands, the first thing that jumps out at me is the use of a non-ASCII long dash in the –warp_full option. This has caused lots of problems in the past, see e.g. this post. If that’s the issue, I’d expect to see an error related to an invalid number of arguments or something like that. But it’s at least easy to fix…

Are the data you are transforming images in template space or fixel contrast files?

Starting with

mrregister subj_odf.mif template_odf.mif -mask1 subj_mask.mif -nl_warp_full warp_full_s2t.mih

you’d transform the template ODF image to subject space with

mrtransform template_odf.mif -warp_full warp_full_s2t.mih -from 2 -template subj_odf.mif template_odf_in_subj_space.mif  -reorient yes

Dear Daniel,

With without success, I meant having images devoid of any information. I did not get any errors while producing the images.
I checked whether the long dash infront “warp_full” was the problem, but it seems to be correct on my Linux desktop. Probably it got changed when copying from my Linux desktop to my Windows desktop.
I attached a screenshot that displays the result of the transformation.

Greetings,
Chris

Dear Max,

The data that I want to transform, the FD, FC, and FDC, are indeed in template space. With fixel contrast files, do you mean the data format? I produced the images in nifty, since I planned to open them in other software packages to do VOI comparisons with other images. I was planning to re-do the analysis using the images in .mif format. Does that maybe solve the problem? And then in the end converting from .mif to .nii.

According to your example for transforming the template ODF image to subject space, I adjusted it to the following:
mrtransform ./Subj001_1_fixel_in_template_space/Subj001_1_fd.nii –warp_full Subj001_1_full_warp_FOD.mih –from 2 –template Subj001_1_wmfod_norm.nii Subj001_1_FD_native4.nii –reorient yes

However, then, I received the following error:
[error] Apodised PSF reorrientation requires SH series images

Removing the -reorient option, produced an image without error, but again devoid of any information.

Greetings,
Chris

I think it’d be best if you could elaborate on what you want to achieve with the template fixel contrasts in subject-space. AFAIK, warping fixel files directly is not possible due to their nature but there might be other ways to do what you want to achieve.

You can for instance convert the template fixel files to volumetric files with fixel2voxel and warp those as demonstrated above. You’d lose the fixel resolution but it is the most straight-forward.

Or you could warp the subject-specific VOIs (-interp linear or nearest) and images to template space and perform the analysis there.

Dear Max,

Many thanks for your reply!!! Together with your suggestion for fixel2voxel and discovering a mix-up in the used files, I managed to creat the images in subject space and voxel space.

Greetings,
Chris