SIRF icon indicating copy to clipboard operation
SIRF copied to clipboard

Gadgetron NUFFT producing a lot of output in stdout.

Open johannesmayer opened this issue 2 years ago • 3 comments

The non-uniform Fourier transform using Gadgetron generates a lot of output during the gridding. The output is just timing how long the gridding took. In the past this has caused notebooks to crash without warning.

This output can be suppressed by adjusting the gadgetron logger-level setting an environmental variable export GADGETRON_LOG_MASK="LEVEL_INFO" (c.f. here).

This should be documented somewhere, but I don't know where would be best. Or maybe exporting the variable in the sirf environmental script could automatically suppress it, I don't know what would be best.

johannesmayer avatar Feb 03 '23 16:02 johannesmayer

I think it would make sense to add it to the env scripts as a default value, and provide an equivalent to stir.set_verbosity() in SIRF that would set the env variable, assuming that changing the env variable while in python would change the log-level. @johannesmayer could you test that?

KrisThielemans avatar Feb 05 '23 09:02 KrisThielemans

I did some testing, but doing anything to the environmental variables from Python will not modify them in the parent shell (according to SO). Setting the verbosity level within Python seems not possible.

johannesmayer avatar Mar 22 '23 11:03 johannesmayer

yes, you cannot modify anything in the parent shell, and certainly not anything for a running Gadgetron server. However, you are running this toolboxes directly from SIRF, so I didn't think the parent shell as we involved. I think if you change the env variables from Python, you would change them for the whole process, and therefore for anything that runs from Python. But I guess you tried that...

The alternative is to do a PR to Gadgetron to be able to switch this output off.

KrisThielemans avatar Mar 22 '23 11:03 KrisThielemans