Giter Site home page Giter Site logo

Comments (4)

rbnvrw avatar rbnvrw commented on August 11, 2024

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.

kkrucki avatar kkrucki commented on August 11, 2024

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.

ninning avatar ninning commented on August 11, 2024

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.

kkrucki avatar kkrucki commented on August 11, 2024

@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)

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.