Population template

Dear Experts
I have been trying to create a population template based on 16 fod files of mice brain.
The script ran without error for over 6 days on my macbook and then finally errored out today.

I used following command:
population_template /Users/uqmalam9/Desktop/fbd_analysis/fod/ -mask /Users/uqmalam9/Desktop/fbd_analysis/mask/ fod_template_
I found following error
population_template: [ERROR] Command failed: cp linear_transforms_5/10.txt linear_transforms_5/11.txt linear_transforms_5/12.txt linear_transforms_5/13.txt linear_transforms_5/14.txt linear_transforms_5/15.txt linear_transforms_5/16.txt linear_transforms_5/17.txt linear_transforms_5/18.txt linear_transforms_5/19.txt linear_transforms_5/20.txt linear_transforms_5/21.txt linear_transforms_5/6.txt linear_transforms_5/7.txt linear_transforms_5/8.txt linear_transforms_5/9.txt linear_transforms/

It seems that the program wants to write output in the linear_transforms folder. I have checked that there are no folder name with linear_transforms. I think it should be created in the beginning. I wonder if you could help me out of this problem.

Here is the screeshot of tmp/population_template folder

Regards
Mamun Al-Amin

What version of MRtrix are you using?
mrinfo -version

You should have a linear_transforms folder if you use the latest version.

You can just create the missing folder manually and continue the script with the -continue <YourTempDiir> "linear_transforms/" option but I’d prefer to know why it is missing.

Hi Max
I have created linear_transforms folder and run

population_template /Users/uqmalam9/Desktop/fbd_analysis/fod/ -mask /Users/uqmalam9/Desktop/fbd_analysis/mask/ fod_template_ -continue /tmp/population_template-tmp-6GCYIZ/ “linear_template/”

For unknown reason it said
IOError: [Errno 2] No such file or directory: ‘linear_transforms_0/10.txtdecomp’

I checked the files in the following location and have not seen any .txt file temp/population_template-tmp-6GCYIZ/linear_transforms_0/

By the way, I am going to delete the temporary files from my Macbook. I will start creating template in the University workstation. I will contact here if I have any problem.

Thanks for help.

Regards
Mamun

This won’t work. I’d suggest you copy the files in linear_transforms_5 to linear_transforms and

try
-continue /tmp/population_template-tmp-6GCYIZ/ "linear_transforms/"

The error message you are getting is related to a bug with the -continue option in population_template that has been fixed in the upcoming version of MRtrix3.

You can replace the line

    check_linear_transformation('linear_transforms_%i/%s.txt' % (level, i.prefix), pause_on_warn=do_pause_on_warn)

in population_tempalte with

    if os.path.isfile('linear_transforms_%i/%s.txt' % (level, i.prefix)): # not true if -continue option is used
      check_linear_transformation('linear_transforms_%i/%s.txt' % (level, i.prefix), pause_on_warn=do_pause_on_warn)

to make it work in the meantime.

But given that it took 6 days for the linear registration, I’d recommend using a faster computer as the nonlinear registration is likely to take longer…

Dear Max
Well, I have been running this in our Institute’s high performance computer. It is still running. I have not seen any error, non-linear registration is ongoing. I will let you know if I find any error. ThanKs for valuable suggestions.
Regards
Mamun

Dear Max
Here I found an error.
I wrote following command
population_template /data/home/uqmalam9/Documents/mamun/FBD/fod/ -mask /data/home/uqmalam9/Documents/mamun/FBD/mask/ /data/home/uqmalam9/Documents/mamun/FBD/template/ -force

It is asking “no file extension specified”. What should I do at this moment?
Would you please guide me forward from this point?

Screenshot of working Terminal

Screenshot of tmp directory

Kind regards
Mamun

Hello Mamun,

You forgot a file extension for the template. The error occurred at the very end of population_template so you can just use nl_template15.mif that is inside your tmp directory. I’ll add a check to avoid this in future versions of MRtrix.

Cheers,
Max

Hi Max
Thank you very much
I have another question to make myself clear. What would be the input image for Fixel based analysis in step 5 given here (http://mrtrix.readthedocs.io/en/latest/workflows/fixel_based_analysis.html)?
mrregister <input_fod_image> -mask1 <input_subject_mask> <input_fod_template_image> -nl_warp <subject2template_warp> <template2subject_warp>

What would be the <input_fod image> ? Should it be the original fod or fod that I have created following step3?
What would be the <input_subject_mask? Should it be the original fod mask or mask that I have created following step2?

Kind regards
Mamun

What do you mean with original FOD? The only step creating FODs in the FBA tutorial is step 3. Use the output of dwi2fod msmt_csd - <group_average_response_text_file> <output_fod_image> -mask <input_upsampled_mask> from step 3.

In case you want to read up on the steps involved, I’d suggest having a look at this paper, especially Fig. 3.

Cheers,
Max

Thanks Max. Much appreciated.