Mrconvert: [ERROR] unknown format for image "/home/..../output_template_wm_mask"

Hi,
I was trying to execute dwiintensitynorm for 10 subjects downloaded from human connectome project but got the below error.Any hint why is this error will be very help !
Thanks
Sarbani

koushik@koushik-DQ77MK:~/HCP_Data/31-08-16$ dwiintensitynorm input_dwi input_mask output_normalised_dwi_folder output_fa_template output_template_wm_mask
dwiintensitynorm: performing global intensity normalisation on 9 input images
dwiintensitynorm: Generated temporary directory: /tmp/dwiintensitynorm-tmp-HUPNFZ/
Command: cp -r input_mask /tmp/dwiintensitynorm-tmp-HUPNFZ/input_mask
dwiintensitynorm: Changing to temporary directory (/tmp/dwiintensitynorm-tmp-HUPNFZ/)
dwiintensitynorm: Computing FA images
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/118730_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/118730_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/118730.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/117122_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/117122_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/117122.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/129028_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/129028_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/129028.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/103414_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/103414_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/103414.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/113619_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/113619_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/113619.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/118932_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/118932_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/118932.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/125525_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/125525_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/125525.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/100307_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/100307_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/100307.mif
Command: dwi2tensor /home/koushik/HCP_Data/31-08-16/input_dwi/128632_bcorrected_dwi.mif -mask /home/koushik/HCP_Data/31-08-16/input_mask/128632_nodif_brain_mask.nii.gz - | tensor2metric - -fa fa/128632.mif
dwiintensitynorm: Generating FA population template
Command: population_template fa -mask_dir /tmp/dwiintensitynorm-tmp-HUPNFZ/input_mask fa_template.mif -linear_scale 0.25,0.5,1.0,1.0 -nl_scale 0.5,0.75,1.0,1.0,1.0 -nl_niter 5,5,5,5,5 -warp_dir warps -nocleanup -tempdir population_template
Command: mrthreshold fa_template.mif -abs 0.4 template_wm_mask.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/118730.mif wm_mask_warped/118730.mif -from 2 -template fa/118730.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/118730_bcorrected_dwi.mif wm_mask_warped/118730.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/118730_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/117122.mif wm_mask_warped/117122.mif -from 2 -template fa/117122.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/117122_bcorrected_dwi.mif wm_mask_warped/117122.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/117122_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/129028.mif wm_mask_warped/129028.mif -from 2 -template fa/129028.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/129028_bcorrected_dwi.mif wm_mask_warped/129028.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/129028_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/103414.mif wm_mask_warped/103414.mif -from 2 -template fa/103414.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/103414_bcorrected_dwi.mif wm_mask_warped/103414.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/103414_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/113619.mif wm_mask_warped/113619.mif -from 2 -template fa/113619.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/113619_bcorrected_dwi.mif wm_mask_warped/113619.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/113619_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/118932.mif wm_mask_warped/118932.mif -from 2 -template fa/118932.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/118932_bcorrected_dwi.mif wm_mask_warped/118932.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/118932_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/125525.mif wm_mask_warped/125525.mif -from 2 -template fa/125525.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/125525_bcorrected_dwi.mif wm_mask_warped/125525.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/125525_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/100307.mif wm_mask_warped/100307.mif -from 2 -template fa/100307.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/100307_bcorrected_dwi.mif wm_mask_warped/100307.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/100307_bcorrected_dwi.mif
Command: mrtransform template_wm_mask.mif -interp nearest -warp_full warps/128632.mif wm_mask_warped/128632.mif -from 2 -template fa/128632.mif
Command: dwinormalise /home/koushik/HCP_Data/31-08-16/input_dwi/128632_bcorrected_dwi.mif wm_mask_warped/128632.mif /home/koushik/HCP_Data/31-08-16/output_normalised_dwi_folder/128632_bcorrected_dwi.mif
Command: mrconvert template_wm_mask.mif /home/koushik/HCP_Data/31-08-16/output_template_wm_mask
dwiintensitynorm: 
dwiintensitynorm: [ERROR] Command failed: mrconvert template_wm_mask.mif /home/koushik/HCP_Data/31-08-16/output_template_wm_mask
dwiintensitynorm: Output of failed command:
mrconvert: [ERROR] unknown format for image "/home/koushik/HCP_Data/31-08-16/output_template_wm_mask"
mrconvert: [ERROR] error creating image "/home/koushik/HCP_Data/31-08-16/output_template_wm_mask"
dwiintensitynorm: Changing back to original directory (/home/koushik/HCP_Data/31-08-16)
dwiintensitynorm: Script failed while executing the command: mrconvert template_wm_mask.mif /home/koushik/HCP_Data/31-08-16/output_template_wm_mask
dwiintensitynorm: For debugging, inspect contents of temporary directory: /tmp/dwiintensitynorm-tmp-HUPNFZ/

Hi Sarbani,

The issue is in the call you issued: the first three arguments are directories, while the last two (the generated FA template and the WM mask in template space used for normalisation) are images, and therefore you need to specify paths where you want those output images to go (e.g. “output_template_wm_mask.mif” rather than “output_template_wm_mask”).

The reported error “unknown format for image” appears because the file extension of the output path is used to determine the format in which the output image should be stored: if you don’t specify an extension, the command does not know what image format to use when generating its output, and therefore gives an error. I might be able to tweak MRtrix3 to give a slightly more verbose error message in such instances.

Cheers
Rob

Thanks Smith. That’s a help!
Cheers
Sarbani