Trying to convert .mds file into any other image file format. I found that pathomation provide python API as the link below.
https://free.pathomation.com/programming/