MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
294 stars 180 forks source link

Misleading Memory Warning in tckfactor.cpp (SIFT2) #2668

Closed ppruc closed 1 year ago

ppruc commented 1 year ago

Hi everyone,

when running a standard tcksift2 command, I encountered the following warning, suggesting a problem with memory assignment: tcksift2: [WARNING] Unable to assign memory for output factor file: "weights.txt" not created

I initially expected the problem to be RAM limitations, so I downsampled the FOD image, however, still encountered the same warning. It was only then that I realised the output directory was incorrectly specified (should've been "results/sub-005/weights/weights.txt").

Potentially it would be helpful for other users to generate a warning like the "No such file or directory" in other commands. Given the computational expense of tcksift2, a check would probably be best before running the command.

Hope this helps!

tcksift2 -act subs/sub-005/5tt final.mif.gz subs/sub-005/tracks_10M.tck subs/sub-005/wmfod_norm.mif.gz results/weights/weights.txt
tcksift2: [100%] uncompressing image"subs/sub-005/sub-005_preop/wmfod_norm.mif.gz"
tcksift2: [100%] uncompressing image "subs/sub-005/sub-005 _preop/5tt_final.mif.gz" 
tcksift2: [100%] segmenting FODs tcksift2: [100%] mapping tracks to image
...
tcksift2: [done]
tcksift2: [WARNING] Unable to assign memory for output factor file: "weights.txt" not created

https://github.com/MRtrix3/mrtrix3/blob/32d17043ec75babbaed65b31d62c063b85ddfa24/src/dwi/tractography/SIFT2/tckfactor.cpp#L354C24-L354C24

jdtournier commented 1 year ago

Thanks for the report! See #2671 for a possible fix.