gtrancourt / microct-leaf-traits Goto Github PK
View Code? Open in Web Editor NEWFunctions to segment plant leaves microCT scans into distinct tissues and to extract anatomical data and other functional traits.
License: MIT License
Functions to segment plant leaves microCT scans into distinct tissues and to extract anatomical data and other functional traits.
License: MIT License
I had that problem once with the py2 version, but this was fixed by using the nearest neighbour option, which is order=0. Using the 2to3 function did not correct this it seems. The issue results in trained models being too huge because of too many input values, and leads to memory errors with really large files, not to mention the full stack segmentation not being sparse.
Opened full stack predictions with negative values. E.g.:
np.unique(raw_pred_stack[100])
[-103 -52 -1 0 51 102]
I don't know what might have caused this, but managed to get rid of this error when re-saving the file in ImageJ. If this happens, an error message will be printed and the program will stop.
Traceback (most recent call last):
File "/home/gtrancourt/Dropbox/_github/microCT-leaf-traits/Leaf_Segmentation_py3.py", line 101, in <module>
gridrec_stack = Load_Resize_and_Save_Stack(filepath, grid_name, rescale_factor)
File "/home/gtrancourt/Dropbox/_github/microCT-leaf-traits/Leaf_Segmentation_Functions_py3.py", line 1024, in Load_Resize_and_Save_Stack
stack_rs = np.empty(np.array(stack.shape)/np.array([1, rescale_factor, rescale_factor]))
TypeError: 'numpy.float64' object cannot be interpreted as an integer
Dont' know what caused this yet. Waiting for it to rehappen.
File "/home/gtrancourt/Dropbox/_github/microCT-leaf-traits/Leaf_Segmentation_py3.py", line 148, in <module>
rf_transverse, gridrec_stack, phaserec_stack, localthick_stack, "transverse")
File "/home/gtrancourt/Dropbox/_github/microCT-leaf-traits/Leaf_Segmentation_Functions_py3.py", line 436, in RFPredictCTStack
class_prediction_transverse = rf_transverse.predict(FL_reshape)
File "/home/gtrancourt/anaconda2/envs/py37/lib/python3.7/site-packages/sklearn/ensemble/forest.py", line 543, in predict
proba = self.predict_proba(X)
File "/home/gtrancourt/anaconda2/envs/py37/lib/python3.7/site-packages/sklearn/ensemble/forest.py", line 583, in predict_proba
X = self._validate_X_predict(X)
File "/home/gtrancourt/anaconda2/envs/py37/lib/python3.7/site-packages/sklearn/ensemble/forest.py", line 362, in _validate_X_predict
return self.estimators_[0]._validate_X_predict(X, check_input=True)
File "/home/gtrancourt/anaconda2/envs/py37/lib/python3.7/site-packages/sklearn/tree/tree.py", line 377, in _validate_X_predict
X = check_array(X, dtype=DTYPE, accept_sparse="csr")
File "/home/gtrancourt/anaconda2/envs/py37/lib/python3.7/site-packages/sklearn/utils/validation.py", line 573, in check_array
allow_nan=force_all_finite == 'allow-nan')
File "/home/gtrancourt/anaconda2/envs/py37/lib/python3.7/site-packages/sklearn/utils/validation.py", line 56, in _assert_all_finite
raise ValueError(msg_err.format(type_err, X.dtype))
ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
An error occurs sometimes when ImageJ generates an 8-bit image that seems to have only one color layer, but that is imported as 3 layers in python.
Traceback (most recent call last):
File "/home/guillaume/Dropbox/_github/microCT-leaf-traits/Leaf_Segmentation_py3.py", line 93, in <module>
filepath, label_name, rescale_factor, labelled_stack=True)
File "/home/guillaume/Dropbox/_github/microCT-leaf-traits/Leaf_Segmentation_Functions_py3.py", line 1026, in Load_Resize_and_Save_Stack
stack, to_trim = Trim_Individual_Stack(stack, rescale_factor, labelled_stack)
File "/home/guillaume/Dropbox/_github/microCT-leaf-traits/Leaf_Segmentation_Functions_py3.py", line 931, in Trim_Individual_Stack
1, 3), np.repeat(2, 3)])#, np.repeat(3, 3), np.repeat(4, 3), np.repeat(5, 3)])
ValueError: operands could not be broadcast together with shapes (4,) (3,3)
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.