CARTAvis / carta

To CARTA users, this repo holds the CARTA release packages. Please use this repo to log bugs and feature requests. These will be triaged by the development team and prioritised as necessary in the development cycles.
19 stars 0 forks source link

feature request: 2d image convolution #82

Open drtobybrown opened 3 years ago

drtobybrown commented 3 years ago

It would be useful to be able to perform convolution, allowing the user to smooth an image (or part of an image) with the kernel of their choice. I think functionality similar to CASA's imsmooth task is desirable, giving the user control over the kernel type, size, shape, image region, and mask.

veggiesaurus commented 3 years ago

See https://github.com/CARTAvis/carta-backend/issues/633 for some technical information. If you have any input on the specific requirements, that would be greatly appreciated, as this feature requirement hasn't been fully fleshed out yet.

drtobybrown commented 3 years ago

Ah good to see it's in the works. I don't have any requirements beyond what is offered by CASA's imsmooth so I would use that as a starting point. One concern may be the memory requirement for very large images/small kernels but perhaps that just is what it is...

veggiesaurus commented 3 years ago

One concern may be the memory requirement for very large images/small kernels but perhaps that just is what it is...

If the kernel is separable (I imagine most common ones are), then the smoothing can be performed very efficiently. For example, we do 2D Gaussian smoothing before contour generation, and it works pretty well, even for large images. Generally uses (image slice size + 200 MB) in terms of extra memory. This could be reduced to ~400 MB if we're actually writing the image to disk or replacing the original image in memory.