tdsmith / ijroi Goto Github PK
View Code? Open in Web Editor NEWReads ImageJ ROI files into numpy arrays.
License: MIT License
Reads ImageJ ROI files into numpy arrays.
License: MIT License
Is there a reason there are only 5 supported ROI types in this package? FREEHAND, TRACED, POLYGON, RECT, and POINT are all supported, but type OVAL (which is common for cell segmentation pipelines), among a few others, raises exceptions.
I haven't looked at this too closely yet, but I assume something about the way ImageJ calculates ovals must be hard to translate to a numpy array?
The ijroi.read_roi() threw this exception when reading a roi file with sub pixel resolution.
File "<ipython-input-27-1cbaa36a0ba9>", line 2, in <module>
ijroi.read_roi(f)
File "C:\Users\kiritani\Documents\data\GitHub\ijroi\ijroi\ijroi.py", line 124, in read_roi
points[:, 1] = [getc() for i in range(n_coordinates)]
File "C:\Users\kiritani\Documents\data\GitHub\ijroi\ijroi\ijroi.py", line 124, in <listcomp>
points[:, 1] = [getc() for i in range(n_coordinates)]
File "C:\Users\kiritani\Documents\data\GitHub\ijroi\ijroi\ijroi.py", line 61, in getfloat
v = np.int32(get32())
File "C:\Users\kiritani\Documents\data\GitHub\ijroi\ijroi\ijroi.py", line 56, in get32
s0 = get16()
File "C:\Users\kiritani\Documents\data\GitHub\ijroi\ijroi\ijroi.py", line 51, in get16
b0 = get8()
File "C:\Users\kiritani\Documents\data\GitHub\ijroi\ijroi\ijroi.py", line 47, in get8
raise IOError('readroi: Unexpected EOF')
OSError: readroi: Unexpected EOF
I assume the file's current position is incorrectly set in line 111?
Hi,
Thanks for this tool. Very helpful!
It would be great if, in addition to the ROI data, this method would also return the slice # that the ROI was taken from in an image stack. Here is an example matlab function that accomplishes this.
Thanks!
Dave
Would be great if we could write ImageJ ROIs using NumPy Arrays as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.