tedana icon indicating copy to clipboard operation
tedana copied to clipboard

Repeated nilearn warning message for report

Open handwerkerd opened this issue 9 months ago • 1 comments

Summary

For certain anatomical images, nilearn is outputting the same warning message repeatedly (over 50 times in a run). It would be good to see if there is a way to prevent or suppress this warning.

Additional Detail

  • @mrneont shared this with me and might be able to provide more details
  • This is likely a result of #1045 which switched to using plot_stat_map with nilearn to generate brain images for the report
  • The message is /usr/local/apps/tedana/conda/envs/24.0.0/lib/python3.9/site-packages/nilearn/plotting/displays/_slicers.py:1949: UserWarning: A non-diagonal affine is found in the given image. Reordering the image to get diagonal affine for finding cuts in the slices. coords[direction] = find_cut_slices(
  • It looks like the warning his about how it is handling a specific situation instead of an actual problem, but I asked them to confirm the output in the report looks correct
  • @mrneont thinks the issue is that nilearn is expecting data in RAS+ orientation (right, anterior, superior), but these data were in ASL (anterior, superior, left) and it might not be handling the interaction between that and obliquity. If this is the case, the Q is whether we can just find a way to suppress the warning or if this is also an issue that might need to get fixed within nilearn

Next Steps

  • Just documenting for now.
  • Hopefully someone who knows nilearn plotting a bit better can assess if this is easily addressable or a more complex issue

handwerkerd avatar May 02 '24 19:05 handwerkerd

Let's just filter out that warning like this: https://stackoverflow.com/a/9134842/2589328

tsalo avatar Jun 05 '24 16:06 tsalo