overlay

Import packages

[1]:
import numpy as np
import porespy as ps
import scipy.ndimage as spim
import matplotlib.pyplot as plt
import skimage
ps.visualization.set_mpl_style()

Create image and variables

[3]:
im1 = np.zeros([100, 100,100])
im2 = np.zeros([51, 51,51])
im1 = ps.generators.RSA(im1, r=25, volume_fraction=0.5)
im2 = ps.generators.RSA(im2, r=5, volume_fraction=0.5)
im3 = im1.copy()

fig, ax = plt.subplots(figsize=[4, 4]);
ps.visualization.imshow(im1);
plt.axis(False)
fig, ax = plt.subplots(figsize=[4, 4]);
ps.visualization.imshow(im2);
plt.axis(False);

#default values:
c = [26,26,26]
../../../_images/examples_tools_howtos_overlay_4_0.svg
../../../_images/examples_tools_howtos_overlay_4_1.svg

Apply tool

[4]:
im = ps.tools.overlay(im1=im1,im2=im2, c=c)
fig, ax = plt.subplots(figsize=[4, 4]);
ps.visualization.imshow(im);
plt.axis(False);
../../../_images/examples_tools_howtos_overlay_6_0.svg
[5]:
im = ps.tools.overlay(im1=im3, im2=im2, c=[74, 74, 74])
fig, ax = plt.subplots(figsize=[4, 4]);
ps.visualization.imshow(im);
plt.axis(False);
../../../_images/examples_tools_howtos_overlay_7_0.svg