Mrtrix configuration file

Hi all,

I built the most recent mrtrix release from Github within my own Linux environment. I would like to change the NiftiUsesSform setting in the configuration file. However, I have no clue where I can find the configuration file. The documentation says it is stored at 2 locations and I cannot find it at either location.

Best,

Jord

It doesn’t exist by default. If you can’t find it, just create it. This one-liner ought to do the trick for you:

echo "NiftiUsesSform: 1" >> ~/.mrtrix.conf

@jdtournier quick follow up question - I’m trying to do the same thing. When I run this command, I’m still getting errors like “[WARNING] qform and sform are inconsistent in NIfTI image … - using qform”
Is there something I need to do to point MRTRIX towards this new config file?
Thanks!

Odd… Try running your command with the -debug flag: you should see something like this at the beginning (this is what my Windows laptop reports):

$ mrinfo -debug someimage.nii
mrinfo: [DEBUG] No config file found at "/etc/mrtrix.conf"
mrinfo: [INFO] reading config file "C:\Users\donald/.mrtrix.conf"...
mrinfo: [DEBUG] reading key/value file "C:\Users\donald/.mrtrix.conf"...
...

This is basically reporting that it’s looked for a system-wide config file in /etc/mrtrix.conf, but didn’t find one, then looked in my home directory, found one, and read its contents.

If it looks like your config file is being found and read, then post the contents of the file here, maybe there’s an issue with the formatting or something…

Thanks a lot for your quick reply!
Yes, it looks like it is seeing my config file:

/media/nir/SharedDrive2/Dec21_parent/Dec21/MDD2_Pre$ mrinfo -debug binLeftMDthal.nii.gz 
mrinfo: [DEBUG] No config file found at "/etc/mrtrix.conf"
mrinfo: [INFO] reading config file "/home/nir/.mrtrix.conf"...
mrinfo: [DEBUG] reading key/value file "/home/nir/.mrtrix.conf"...
mrinfo: [INFO] opening image "binLeftMDthal.nii.gz"...
mrinfo: [DEBUG] transforms_match: FOV difference in scanner coordinates: 290.24127893874777
mrinfo: [WARNING] qform and sform are inconsistent in NIfTI image "binLeftMDthal.nii.gz" - using qform
mrinfo: [DEBUG] sanitising image information...
mrinfo: [INFO] Axes and transform of image "binLeftMDthal.nii.gz" altered to approximate RAS coordinate system
mrinfo: [DEBUG] searching for suitable phase encoding data...
mrinfo: [INFO] image "binLeftMDthal.nii.gz" opened with dimensions 91x109x91, voxel spacing 2x2x2, datatype Float32LE
************************************************
Image:               "binLeftMDthal.nii.gz"
************************************************
  Dimensions:        91 x 109 x 91
  Voxel size:        2 x 2 x 2
  Data strides:      [ -1 2 3 ]
  Format:            NIfTI-1.1 (GZip compressed)
  Data type:         32 bit float (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1           0          -0         -90
                               -0           1          -0           0
                               -0           0           1           0
  comments:          6.0.0

Looks like perhaps there’s a different type of problem here?
My config file (I must’ve made it twice) looks like this:

nir@nir-ThinkStation-P410:~$ cat .mrtrix.conf
NiftiUsesSform: 1
NiftiUsesSform: 1

Darn, you’re right, that was my mistake… There’s one ‘s’ too many in there, that should be NiftiUseSform

oh okay great thanks for catching that!