adalca / neurite Goto Github PK
View Code? Open in Web Editor NEWNeural networks toolbox focused on medical image analysis
License: Apache License 2.0
Neural networks toolbox focused on medical image analysis
License: Apache License 2.0
Hi, I use tensorflow 1.4 with kears 2.1.3 and always get "ModuleNotFoundError: No module named 'tensorflow.keras'", so how can I solve the problem? Thanks a lot!
Hello! It is not completely clear for me how one can use Neuron to get results from your Unsupervised Data Imputation paper for instance on MNIST dataset? Thank you!
Hi there,
First, thank you so much for these resources. They are really great tools.
I was testing the Spatial Transformer layer and have noticed an odd behaviour. In some experiments I have ran, I have noticed an odd behaviour, where when doing a rotation about the z-axis, the image is rotated, however, it's also scaled down. I dug in the code and I noticed the _single_aff_to_shift
function. I see that you add the identity matrix to affine matrix.
To remedy that, I subtracted the identity matrix and it worked fine.
I saw the comment in the code, but it still doesn't make sense for me. Maybe I don't understand something, but why did you add this initially?
Kind Regards
Hi there, unsure if this is the right place to post this.
Just getting the following issue!
``
----> 6 import voxelmorph as vxm
7 import neurite as ne
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/voxelmorph/init.py:12
9 from packaging import version
11 # ensure valid neurite version is available
---> 12 import neurite
13 minv = '0.2'
14 curv = getattr(neurite, 'version', None)
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/neurite/init.py:50
47 except ImportError:
48 raise ImportError('Please install tensorflow to use this neurite backend')
---> 50 from . import tf
51 from .tf import *
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/neurite/tf/init.py:5
3 from . import generators
4 from . import callbacks
----> 5 from . import metrics
6 from . import losses
7 from . import models
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/neurite/tf/metrics.py:33
31 from tensorflow.keras import losses
32 # simple metrics renamed mae -> l1, mse -> l2
---> 33 from tensorflow.keras.losses import mean_absolute_error as l1
34 from tensorflow.keras.losses import mean_squared_error as l2
36 # local
ImportError: cannot import name 'mean_absolute_error' from 'tensorflow.keras.losses' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/keras/_tf_keras/keras/losses/init.py)
``
I am currently using TensorFlow 2.4.1, and am getting an error related to the usage of tf.random_normal in the class SampleNormalLogVar(Layer), which has been deprecated since tf version 2.1.0 I believe, and is now replaced with tf.random.normal. I am not using neurite by itself, but VoxelMorph, which uses this class for its vxm_model when the use_probs parameters is set to True.
In Hypermoprh they combined a hyper network with voxelmorph for auto-hyperparamter training.
From their source code I have traced that they use "HyperConvFromDense" layer from neurite. Can you explain the concept behind this layer? Thanks.
Can you upload the train python file? Thanks!
Line 1043 in 46c975e
Hello,
I'm trying to plot the flow field vectors for my 3D warping but the "flow" plot of neurite asks me to convert the 3D array into 2D+2 to plot it. So the actual array (1, 160, 160, 48, 3) has to be compressed to (54, 54, 16, 2) and I end up plotting (1, 54, 16, 2) for each flow plot, which does not give proper visualisation.
I'm squeezing the image in the following way:
flow = pred_warp.squeeze()[::3,::3,::3,::2]
pred_warp.shape = (1, 160, 160, 48, 3)
flow.shape = (54, 54, 16, 2)
Is there a way for me to plot the 3D flow plot or is there a better way to represent this flow vector? Thank you
Hi! I am trying to use neurite with python 3.11 and I noticed the following error:
attrs, varargs, varkw, defaults = inspect.getargspec(func)
which is cause by an incompatibility of inspect and python 3.11.
The issue can be resolved by changing the above line to:
attrs, varargs, varkw, defaults, _, _, _ = inspect.getfullargspec(func)
It would be nice to make neurite compatible with the newer python versions.
Thanks a lot!
Error raised when i use ne.utils.resize()
:
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported numpy type: NPY_INT).
And I located it in ne.utils.sub2ind2d()
, neurite\tf\utils\utils.py line 937,
Solution(?) :
neurite\tf\utils\utils.py line 933:
k = np.cumprod(siz[::-1])
-> k = np.cumprod(siz[::-1]).astype(np.int32)
Hello, I found a performance issue in the definition of interpn
, neurite/tf/utils/utils.py, tf.reshape
will be calculated repeatedly during program execution, resulting in reduced efficiency. I think it should be created before the loop.
Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
Hello! Thank you for your work! However, it is not completely clear for me how one can use Neuron to get results from your Anatomical Priors in Convolutional Networks for Unsupervised Biomedical Segmentation paper? Thank you! Is the training code available anywhere?
... would be nice to have, but are not implemented yet, see
Line 297 in 249d497
Hi,
I'm trying to use ne.metrics.MutualInformation, I provide the function only bin centers and not number of bins, and I receive the error "Error cannot provide both bin centers and nb_bins".
If I only provide the nb_bins parameter I don't receive this error.
My assumption for the root cause for the problem is in the class MutualInformation, when defining the bin_centers it redifines the number of bins by using nb_bins = bin_centers.shape[0] (line 95).
And when it runs self.quanitize (line 315) it sees that both nb_bins and bins_centers are not None and I receive this error.
Can please someone help, Maybe the script needs to be fixed?
The full context is here: adalca/pystrum#9
But, simply importing neurite
will trigger the issue above:
File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.8/site-packages/voxelmorph/__init__.py", line 12, in <module>
import neurite
File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.8/site-packages/neurite/__init__.py", line 19, in <module>
import pystrum
File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.8/site-packages/pystrum/__init__.py", line 3, in <module>
from . import pynd
File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.8/site-packages/pystrum/pynd/__init__.py", line 1, in <module>
from . import ndutils
File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.8/site-packages/pystrum/pynd/ndutils.py", line 581, in <module>
def sphere_vol(vol_shape, radius, center=None, dtype=np.bool):
File "/home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool'
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.