Analyze the disk image stack
[1]:
import astro3d
from astro3d import image_stack
Read the image stack
We again need to set the printer-specific settings and the directory of the slides:
[2]:
stack = image_stack.IStack(
astro3d.get_output('slices_pluto_color3'),
dpi_x=600, dpi_y=300, dz=27e-4,
)
Print out statistics
[14]:
stack._get_colors(N=4)
f, ax = stack.show_colors(titles=['VeroCyan', 'VeroMagenta', 'UltraClear', 'VeroYellow'], fontsize='small')
getting colors from 4 sample images ... Done!
Now we assign the transparent color index
[21]:
stack.empty_indices = [2]
[25]:
stack.show_info()
There are 4 colors in this image:
- [29, 85, 111]
- [149, 39, 87]
- [178, 178, 178] (transp.)
- [192, 183, 52]
740 files
dimension = 15.99 x 16.00 x 2.00 cm
filling fraction: 0.28%
nr of fully transparent columns: 0.05%
most opaque pixel has 38 filled pixels (=5.14% of all layers are filled)
mean counts in non-transparent columns: 3.5, 1.6, 7.4e+02, 1.7
Plots
Show the distribution of materials
[26]:
f, ax = stack.show_counts()
Show a histogram of the columns that are not fully transparent
[27]:
f, ax = stack.show_histogram()
Show fully transparent pixels and the density distribution.
[28]:
f, ax = stack.show_transparency_estimate()
Top view
[29]:
stack.show_top_view(bg=[255] * 3)
[29]:
(<Figure size 640x480 with 1 Axes>, <AxesSubplot:>)
Careful: this takes around 10 minutes
[30]:
#%%time
#f, ax = stack.three_views()
#f.savefig('perspectives.pdf', transparent=True, bbox_inches='tight', dpi=300)