ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
586 stars 161 forks source link

FIX: overlay plot background is masked #631

Closed ncullen93 closed 1 month ago

ncullen93 commented 1 month ago

Currently, plotting an image with an overlay - particularly a mask-like overlay - will have a weird background due to the overlay. This fixes that issue by masking the overlay where it is equal to zero.

Example here - the background should be black:

import ants
img = ants.image_read(ants.get_data('mni'))
mask = img > 6000
img.plot(mask)
coveralls commented 1 month ago

Coverage Status

coverage: 80.836% (+0.3%) from 80.524% when pulling f1a351531f8897ff258e112990cc4f66e7adf7dd on fix-plot-overlay into 3dcfdeb567e07f1d53a45476925c4de9345be236 on master.