Comments (4)
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.
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.
In imctools v2 such functionality is also available. One can get/save slide/panorama images:
from imctools.
Thank you for your answers, with your help I managed to extract the panoramas!
from imctools.
Related Issues (20)
- Make exceptions discoverable in API HOT 3
- Extra 161 bytes extracted on all image buffers HOT 1
- TxtParser and McdParser should share a common base class
- Wrong ROI coordinates for new Fluidigm software versions HOT 4
- Create imctools.data.Acquisition object without loading image data when using TxtParser
- Feature request: option to export additional columns in omefile_2_analysisfolder HOT 4
- KeyError: 'Name' HOT 11
- ValueError: invalid literal for int() with base 10: HOT 1
- Broken assertion HOT 3
- ome2histocat stripps .tiff file ending from masks HOT 2
- Value Error: No session JSON files available HOT 3
- Error while running IMCtools HOT 4
- Generated OME-XML in OME-TIFF files is not schema compliant due to out-of-order AcquisitionDate element HOT 3
- broken link to xml namespace HOT 1
- imctools.scripts HOT 2
- Typo in method omexml.py HOT 2
- Inquiry about omexml.py related to schema location HOT 2
- NotADirectoryError: [Errno 20] Not a directory: '../../data/ometiff/.DS_Store/.DS_Store_Acquisition_meta.csv' HOT 4
- Adding clear specification of the 'ome' folder HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imctools.