Comments (4)
Thank you for your report @ninning! If this shape is stored in the ND2 file, there should of course be some way to implement this. I think that currently, only circular or rectangular ROIs are parsed correctly. This would be a nice improvement but I don't have the time myself to implement it. Of course PRs are very welcome.
from nd2reader.
Was there ever a fix added for this? I tried extracting the x,y values myself but am unsure on the conversion factor from m_vectBasePoints to image pixel units
from nd2reader.
Was there ever a fix added for this? I tried extracting the x,y values myself but am unsure on the conversion factor from m_vectBasePoints to image pixel units
I dont think so, I just ended up saving the ROI's as a separate binary .tif file with the Nikon software. If you re-load your .nd2 file on the Nikon elements software that you used to take the image, there should be a option to "Save ROI's as..."
from nd2reader.
@rbnvrw @ninning if you add something like the following lines of code to _parse_vect_anim in raw_metadata.py then it will extract the shape in pixels
x_dict = []
y_dict = []
f = animation_dict[six.b('m_sExtrudedShape')]
for i in range(f[six.b('m_vectBasePoints_Size')]):
x = f[six.b('m_vectBasePoints_%d' % i)][six.b('x')]
x = 0.5 *(1+x+animation_dict[six.b('m_dCenterX')]) *self._metadata_parsed["width"]
x_dict.append(x)
y = f[six.b('m_vectBasePoints_%d' % i)][six.b('y')]
y = 0.5 * (1+y+animation_dict[six.b('m_dCenterY')]) *self._metadata_parsed["height"]
y_dict.append(y)
roi_dict["x"] = x_dict
roi_dict["y"] = y_dict
return `roi_dict`
I am not the best or most efficient python coder so if you want to add this in a better format by all means add it
from nd2reader.
Related Issues (20)
- KeyError when opening nd2 file HOT 1
- Loaded images are gray scale HOT 2
- Bug in attempt to remove unwanted bytes HOT 1
- Build error on Travis due to SSH git url for docs HOT 1
- Colors wrong when saving ND2 to png HOT 9
- Single time point exported from time series appears to have as many frames as original HOT 1
- reading from files being written HOT 4
- git-lfs in the repo pointing to missing objects HOT 1
- nd2reader outputs empty arrays for certain ND2 files. HOT 2
- Improving metadata: Add X and Y stage coordinates in Metadata. HOT 3
- documentation link is broken HOT 1
- Cannot open nd2 files obtained with version 5.21.03 of the acquisition software
- parser.calculate_image_properties breaks if "z_levels" are empty
- float64 .nd2 files don't recognize intensities above 2**16-1
- pull out the label dXPos/dYPos and dPosX/dPosY
- Wrong z parameter in Focused EDF files
- in numpy ver1.24+, the numpy.float is deprecated, please fix it...
- Error: 'numpy' Module Has No Attribute 'float' in nd2reader HOT 1
- Apple Silicon Error (pims_nd2)
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 nd2reader.