Git Product home page Git Product logo

Comments (4)

jwindhager avatar jwindhager commented on July 18, 2024

Hi @laufre,

indeed, the mcdlib has been archived and is not maintained anymore in favor of imctools v2.

With imctools v2, extracting panorama images from .mcd files should be straightforward using the McdParser class. Something like:

from imctools.io.mcd.mcdparser import McdParser
buf = McdParser('/path/to/file.mcd').get_panorama_image(my_panorama_id)

However, note that .mcd files, by design, support panorama images in arbitrary image formats. Therefore, in the example above, buf is a raw data buffer (numpy array) that needs to be interpreted according to the actual file type (e.g. png) to get the image as numpy array, e.g. using OpenCV:

img = cv2.imdecode(np.frombuffer(buf, dtype=np.uint8), cv2.IMREAD_COLOR)

To my knowledge, with imtools v1, you could first save the panorama to a temporary directory using McdParser.save_panorama and then read in the image file manually. But maybe @votti or @plankter have better suggestions?

from imctools.

votti avatar votti commented on July 18, 2024

I would strictly recommend using Imctools v2 by now and use the McdParser class there: https://bodenmillergroup.github.io/imctools/io/mcd/mcdparser.html

To look into all the panoramas available, you should look into the attribute:
McdParser.session.panoramas which is a dictionary containing all panoramas and their metadata:
https://bodenmillergroup.github.io/imctools/data/panorama.html

For imctools v1 there is the direct way is to use McdParser.save_panorama.

from imctools.

plankter avatar plankter commented on July 18, 2024

In imctools v2 such functionality is also available. One can get/save slide/panorama images:

https://bodenmillergroup.github.io/imctools/io/mcd/mcdparser.html#imctools.io.mcd.mcdparser.McdParser.save_panorama_image

from imctools.

laufre avatar laufre commented on July 18, 2024

Thank you for your answers, with your help I managed to extract the panoramas!

from imctools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.