OK, so two separate points to make on this one.
Firstly, when the troublesome command is executed properly as two separate steps, they proceed without error:
koushik@koushik-DQ67SW:/tmp/5ttgen-tmp-CTJYI1$ mrmath mesh2pve_L_Accu.mif mesh2pve_R_Accu.mif mesh2pve_L_Caud.mif mesh2pve_R_Caud.mif mesh2pve_L_Pall.mif mesh2pve_R_Pall.mif mesh2pve_L_Puta.mif mesh2pve_R_Puta.mif mesh2pve_L_Thal.mif mesh2pve_R_Thal.mif sum a.mif
koushik@koushik-DQ67SW:/tmp/5ttgen-tmp-CTJYI1$ mrcalc a.mif 1.0 -min all_sgms.mif
This suggests that thereās nothing fundamentally wrong with the commands or your system. The next test to perform after this would be to run the same command, but making use of piping as is done in the 5ttgen
script:
koushik@koushik-DQ67SW:/tmp/5ttgen-tmp-CTJYI1$ mrmath mesh2pve_L_Accu.mif mesh2pve_R_Accu.mif mesh2pve_L_Caud.mif mesh2pve_R_Caud.mif mesh2pve_L_Pall.mif mesh2pve_R_Pall.mif mesh2pve_L_Puta.mif mesh2pve_R_Puta.mif mesh2pve_L_Thal.mif mesh2pve_R_Thal.mif sum - | mrcalc - 1.0 -min all_sgms.mif
If this fails, but the commands are successful when split across multiple lines, this would suggest that wherever your system is writing the temporary piped images to has run out of disk storage space.
Secondly, I would have another read of the Unix pipelines tutorial to fully come to grips with its usage in MRtrix3. Commands like this are doomed to fail:
koushik@koushik-DQ67SW:/tmp/5ttgen-tmp-CTJYI1$ mrmath mesh2pve_* sum b.mif | mrcalc b.mif 1.0 -min all_sgms.mif
In its typical usage (e.g. see second terminal example above), mrcalc
waits for mrmath
to complete, as it sees the ā-
ā symbol where it expects to see an input image, and therefore waits until the path to this temporary image is received via its stdin
before proceeding; mrmath
completes its duties, generates its output in a temporary image, and writes the path to this temporary image to its stdout
, where it is subsequently received by mrcalc
. However in your example, both mrmath
and mrcalc
proceed instantly, and so mrcalc
fails instantly because it expects to see an input image called āb.mif
ā despite the fact that mrmath
has not yet created it.
Edit: OK, looks like the command with the piping was the first thing you tested:
koushik@koushik-DQ67SW:/tmp/5ttgen-tmp-CTJYI1$ mrmath mesh2pve_L_Accu.mif mesh2pve_R_Accu.mif mesh2pve_L_Caud.mif mesh2pve_R_Caud.mif mesh2pve_L_Pall.mif mesh2pve_R_Pall.mif mesh2pve_L_Puta.mif mesh2pve_R_Puta.mif mesh2pve_L_Thal.mif mesh2pve_R_Thal.mif sum - | mrcalc - 1.0 -min all_sgms.mif
mrmath: [100%] computing sum across 10 images
mrcalc: [ERROR] error converting string "-"
Iād have expected this to give more useful informationā¦ Are you working over e.g. an ssh
connection? Nevertheless, the fact that two separate commands works but piping does not indicates a problem with the location being used for temporary image piping. Iād run the piped command with the -debug
option (both for mrmath
and mrcalc
), that should tell you where the temporary piped image is (supposed to be) going. You can then check your disk space there.
Cheers
Rob