Robin
New Member
I couple the distributions and kinematics of cold gas in galaxies w/ Bulge/Disk decompositions.
Posts: 13
|
Post by Robin on Dec 4, 2017 19:22:32 GMT 8
I'm facing the issue where if an image contains any NaNs, profoundImBlur(/Diff/Grad) will produce an image that is completely filled with NaNs; not quite the desired effect, of course.
I've tried converting the NaN pixels into zeros for instance, but the issue is that after the blurring process, these pixels are, of course, no longer "==0" and so it's difficult to convert them back to NaNs.
Is there no way to avoid this in these functions? If not, do you have any suggestions for getting around such a problem?
|
|
Sarah
New Member
Posts: 31
|
Post by Sarah on Dec 8, 2017 15:51:56 GMT 8
As an easy workaround you could just save the indices (or the TRUE/FALSE array) of the pixels you did set to zero to reconvert them after the blur (as the image dimensions aren't changed during the blur), i.e. something like ignorepix=!is.finite(image) image[ignorepix]=0 newim=profoundImBlur(image) newim[ignorepix]=NaN By testing for is.finite you also exclude Inf, -Inf and NA which all have the same issue. There might be better ways though...
|
|