Analyze MHD 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_mhd'),
    dpi_x=600, dpi_y=300, dz=27e-4,
)

Plots

Show the distribution of materials

[6]:
f, ax = stack.show_counts()
../../_images/3Dprinting_3_mhd_3_link_11_0.png

Show a histogram of the columns that are not fully transparent

[7]:
f, ax = stack.show_histogram()
../../_images/3Dprinting_3_mhd_3_link_13_0.png

Show fully transparent pixels and the density distribution.

[8]:
f, ax = stack.show_transparency_estimate()
../../_images/3Dprinting_3_mhd_3_link_15_0.png

Top view

[9]:
stack.show_top_view(bg=[255, 255, 255]);
../../_images/3Dprinting_3_mhd_3_link_17_0.png

Add shell

[10]:
from pathlib import Path
path = Path(astro3d.get_output()) / (stack.directory.name + '_shell')
[11]:
stack.add_shell(0.2)
[12]:
stack._get_colors()

getting colors from 10 sample images ... Done!
[13]:
stack.show_colors()
[13]:
(<Figure size 500x100 with 1 Axes>, <Axes:>)
../../_images/3Dprinting_3_mhd_3_link_22_1.png
[14]:
stack.empty_indices = [3, 4]
[15]:
# here we don't store all of them, just one for testing
stack.save_images(path, i0=0, i1=1)
directory exists, deleting old files
only printing from index 0 to 1 = 0.00 cm of it