Yury wrote
I need to select ROIs -rectangular or ellipse- for different particles on an image or stack. Is it possible after selecting ROI manually to align its center to the maximum for center of mass more or less automatically?
I would think calculating the centroid would be a likely way of getting the center coordinates, perhaps with some thresholding to limit your points of interest. If you will be aligning to a central max or min I would suggest first filtering with a Gaussian, mean, or median filter to remove points where it is likely to be noise from the camera and not the extremum you want.
Hope this helps.