Giter VIP home page Giter VIP logo

neurite's People

Contributors

adalca avatar ahoopes avatar avnishks avatar brf2 avatar catherine0505 avatar halleewong avatar jondo avatar kinshuk1207 avatar mu40 avatar neel-dey avatar zhiluzhang123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neurite's Issues

About kears version

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!

Affine Warp

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

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)

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

Compatibility issue with recent TensorFlow versions

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.

Explaining HyperConvFromDense

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.

Is it a typo in the paper?

Hi Adrian, in the paper page 9292 equation (3), why the parameter theta is z given s as marked red in the screenshot? Isn't it theta x given s? Could you clarify it? Thank you.
image

3D plots using neurone.plot.flow not properly visualised

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

flow

Neurite is incompatible with python 3.11

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 in ne.utils.resize:

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)

Replicating Paper Results

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?

Error cannot provide both bin centers and nb_bins, while only providing bin centers

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?
err

Neurite is incompatible with `numpy==1.24` due to upstream Pystrum `AttributeError`

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'

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.