Labelsgmfix bug

Dear MRtrix team,

Congratulations on the latest release! Like many users I’ve jumped straight in and started playing with the new functions. Following the HCP connectome tutorial, I came across this bug. Running the following command:

returns this error:

mrconvert: [ERROR] unknown format for image "/vols/Scratch/ialvarez/sandbox/HCP/100307/nodes_fixSGM.mif-quiet" mrconvert: [ERROR] error creating image "/vols/Scratch/ialvarez/sandbox/HCP/100307/nodes_fixSGM.mif-quiet" labelsgmfix: [ERROR] Command failed: mrconvert result.mif /vols/Scratch/ialvarez/sandbox/HCP/100307/nodes_fixSGM.mif-quiet -quiet

which is caused by a missing space in the labelsgmfix script. Specifically, line 112 reads:

when it should read:

That seems to fix it.

Thanks for the report Ivan.

The line is actually supposed to be as follows:

runCommand('mrconvert result.mif ' + os.path.join(lib.app.workingDir, lib.app.args.output) + lib.app.mrtrixForce)

The lib.app.mrtrixForce string allows the final mrconvert call to overwrite an existing output file right at the end of the script if necessary. And it includes the preceding space to avoid this kind of scripting mishap… lib.app.mrtrixQuiet on the other hand is inserted where necessary within the runCommand() function.

I’ll merge the fix into the repository in a moment.

Cheers
Rob