maweigert / spimagine

GPU accelerated volume rendering / processing in Python
BSD 3-Clause "New" or "Revised" License
117 stars 17 forks source link

offset in 3D data limits accessible color scale #6

Closed paulmueller closed 9 years ago

paulmueller commented 9 years ago

The current master branch 4dad0eaa has scaling problems when displaying data with offset.

The positions of the contrast/brightness sliders on the left hand side only yield a visible image for a few positions. Otherwise the image is black/full background.

I resolved this temporarily by removing the offset:

data -= data.min()
volfig(0)
volshow(data) 

Note: I experienced this problem when working with refractive index values which usually have an offset > 1.0 and don't go beyond 2.

maweigert commented 9 years ago

volshow doesn't scale the data to the full range by default, you can however activate that by calling

volshow(data, autoscale = True)

where data internally is rescaled to a bigger range (via numpy, i.e. possible slow, which is why the default is autoscale=False)

paulmueller commented 9 years ago

Thanks.