Giter Club home page Giter Club logo

Comments (8)

marcomusy avatar marcomusy commented on August 24, 2024

Hi, I might have introduced a bug in the dev version ....
Is the error also showing up in the released version?

pip uninstall vedo
pip install vedo -U

from vedo.

Anagabrielamantilla avatar Anagabrielamantilla commented on August 24, 2024

it did not work. I got this error now:

ImportError: cannot import name 'Volume' from 'vedo' (unknown location)

from vedo.

marcomusy avatar marcomusy commented on August 24, 2024

I think there must be something else going wrong there.. you should post a minimal script with the complete error message, e.g

from vedo import Volume
vol= Volume()
print(vol)

Does it work from command line eg.

vedo --run numpy2volume0

from vedo.

Anagabrielamantilla avatar Anagabrielamantilla commented on August 24, 2024

sure, here is my complete code:

import numpy as np
from vedo import Volume
from vedo.applications import Slicer3DPlotter
import matplotlib.pyplot as plt
f = open('data.bin', 'rb') 
content = f.read() 
f.close() 
data = np.frombuffer(content, np.float32)
print(data)

data_3d = data.reshape((200,200,700),order='F')

vol = Volume(data_3d)

plot3D = Slicer3DPlotter(vol)

plot3D.show()

I have numpy 1.26.4, vedo 2024.5.1 and matplotlib 3.8.4

from vedo.

marcomusy avatar marcomusy commented on August 24, 2024

You did not show the exact error message. Can you reproduce this?

import numpy as np
from vedo import Volume
from vedo.applications import Slicer3DPlotter

data = np.zeros([70, 80, 90], dtype=np.uint8)
data[ 0:30,  0:30,  0:30] = 1
data[30:50, 30:60, 30:70] = 2
data[50:70, 60:80, 70:90] = 3

vol = Volume(data)

plot3D = Slicer3DPlotter(vol)
plot3D.show()

Screenshot from 2024-05-15 20-19-59

from vedo.

Anagabrielamantilla avatar Anagabrielamantilla commented on August 24, 2024

I reproduced your code in spyder with vedo 2024.5.1 and I get the following error:

AttributeError: 'NoneType' object has no attribute 'pos'

If I use:

pip uninstall vedo
pip install vedo -U

and run the same code with spyder I get the following error: ImportError: cannot import name 'Volume' from 'vedo' (unknown location)

from vedo.

marcomusy avatar marcomusy commented on August 24, 2024

The second error message points to a problem in your anaconda installation.
I just run the above script in a spyder version 5 console and it runs normally..

from vedo.

marcomusy avatar marcomusy commented on August 24, 2024

Let me know if need further help on this.
I'm closing the issue for the moment.

from vedo.

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.