question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi Marco, sorry to be opening so many issues…

I was playing around with the Volume class and found a couple small issues.

Threshold in range

There seems to be something weird with volume.threshold, if I only pass vmin or vmax it works as expected, but if I pass both it just returns the full volume and which particular values I use doesn’t change anything (in fact I can even pass vmax > vmin).

bug in volume.resample

  File "/Users/federicoclaudi/Documents/Github/BrainRender/workspace.py", line 41, in <module>
    vol.resample([.1, .1, .1])
  File "/Users/federicoclaudi/miniconda3/envs/brainrender/lib/python3.7/site-packages/vtkplotter/volume.py", line 291, in resample
    oldsp = self.GetSpacing()
AttributeError: 'Volume' object has no attribute 'GetSpacing'

setting volume transparency.

I have these volumes that are 0 in empty voxels and >0 where there’s something. The actual scalar value in non-empty voxels doesn’t matter, it’s just to label voxels belonging to different structures. So when rendering the volume I wanted all the 0 voxels to have alpha=0 and all the non-zero voxels to have alpha=1, but I couldn’t find an easy way to do that with the alpha argument of Volume. I ended up doing this which works fine:

    otf = vol.GetProperty().GetScalarOpacity()
    otf.RemoveAllPoints()
    otf.AddPoint(vmin, 0) # set to transparent
    otf.AddPoint(vmin+.1, alpha) # set to opaque
    otf.AddPoint(data.max(), alpha)

but I thought perhaps you wanted to build this possibility into the Volume class.

All the best, Fede

P.s.: The slicers in the latest release look awesome!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marcomusycommented, May 7, 2020

In the latest push this should be possible check: vtkplotter -ir interpolateVolume

line: # vol.alpha([(0.3,0.3), (0.9,0.9)]) # alternative way, by specifying (xscalar, alpha)

0reactions
FedeClaudicommented, May 6, 2020

yep I think that would work, awesome thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Volume word problems (practice) - Khan Academy
Volume word problem: water tank · Volume word problems · Volume of rectangular prisms review · Math>. 5th grade>. Volume>. Volume word problems....
Read more >
Volume word problems | Lesson (article) - Khan Academy
Volume word problems focus on using the volume formulas of three-dimensional solids: rectangular prisms, cylinders, etc. In this lesson, we'll learn to:.
Read more >
Volume word problems — Basic example - Khan Academy
Watch Sal work through a basic Volume word problem. Google Classroom Facebook Twitter. Email. Additional topics in math. Volume word problems — Basic ......
Read more >
3D Shapes Volume Problems - Free Mathematics Tutorials
3D shapes volume problems with detailed solutions. ... Problems on 3D shapes, such as prisms, cube, cylinder, volume are presented along with detailed ......
Read more >
Problems on Volume - Onlinemath4all
PROBLEMS ON VOLUME. To find volume of the shapes, we will be using the formulas given below. Volume of sphere = (4/3) π...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found