I'm shooting laboratory photos of small (60mm) sized objects. It is essential for me to use the entire camera sensor to achieve adequate spatial resolution, so I am putting the camera as close as needed to have the the objects reach the sides of the photo.
With this amount of zoom, image distortion is a problem. With a 105mm focal length lens and a working distance near 30cm or so, the inside edges of objects are revealed a bit from the side, while the outside edges are visually occluded. This means the images do not reflect a top down view on the scene, as you can see here in this photo of a periodic array of vertical cylinders:
This distortion is very bad for my scientific application. I guess to remove this distortion while keeping the object over the entire image sensor, I need to shoot from further away with a longer focal length. Is this correct? Are there other things I might try to avoid this distortion like shooting through some kind of lens, adding some attachment, or some more hairbrained scheme like photographing mirrors aimed at the object from different angles? I am currently using a Nikon Nikkor Z MC 105mm f/2.8 VR S.
Thank you for any help. I am not an experienced photographer, so any knowledge you could share would be useful.

You can do a few things to reduce barrel distortion in your photos. You can use a lens with a shorter focal length. This will make the image appear wider, which will help to reduce the amount of distortion.
– Bijutoha Jul 12 '23 at 04:20