A method and an apparatus for generating a set of processed images of an object from overlapping raw images are provided. The raw images are aligned so that pixels representing a same part of the picture object in different raw images are aligned forming a respective pixel stack for each pictured part of the object. At least one mask image is then generated by a maximum intensity projection through the pixel stacks. The set of processed images is then generated from the raw images using the at least one mask image.