Creating training data#

In this notebook we create training data for deep learning by first creating phantom images (to use as ground truth images) then applying blur and noise operators (to create corrupted input images)

Create ground truth (phantoms)#

We will populate a 3D array with randomly distributed spheres of varying sizes and positions. Note we do not expect networks trained on these spheres to perform well on other types of content.

A note on more general and realistic bio-image training sets#

A more realistic training set for biological images could be generated using tools such as cytopaqc. In the future generative AI may be used in the future to develop more robust training sets. For the purposes of this tutorial we are mostly looking at a limited content domain of spherical objects. Even within this limited domain there are some interesting experiments that can be done (for example looking at the variety of training data needed to teach the network to handle combinations of small to large spheres and dim to bright signal levels)

Point Spread Function (PSF) generation and Image Simulation#

We will calculate the PSF, which represents the blurring effect caused by the microscope’s optical system. The PSF will be computed based on the microscope’s parameters such as magnification, numerical aperture, and focal length.

Convolution with the PSF: The generated 3D image will be convolved with the PSF to simulate the blurring effect of the microscope on the true signal.

Photon shot noise addition: Photon shot noise arises due to the discrete nature of light and affects the number of photons detected by the camera. We will introduce photon shot noise into the convolved image to mimic this stochastic effect.

Cavaets: Please note that this example focuses on the generation of a 3D image, PSF calculation, convolution with the PSF, and addition of photon shot noise. Other aspects, such as optical aberrations, sample interactions, camera characteristics, sensor noise, and post-processing steps, are not considered in this simplified simulation. These additional factors can significantly impact the image quality and should be taken into account for comprehensive microscopy simulations.

Import dependant libraries#

… and define location to put ground truths and images

from tnia.simulation.phantoms import add_sphere3d
from tnia.plotting.projections import show_xy_zy_max, show_xy_zy_slice
from tnia.simulation.phantoms import add_small_to_large
import numpy as np
import random
import raster_geometry as rg
from skimage.io import imsave
from tnia.deconvolution.forward import forward
import os

data_path =r'../../data/deep learning training'

# can be big, small, or big_small
spheres = 'big_small'
noise = 'high'
na = 'high'

set_name = 'spheres_'+spheres+'_noise_'+noise+'_na_'+na

print(set_name)
# path to put training data
truth_path = os.path.join(data_path, set_name, 'train', 'ground truth0')
image_path = os.path.join(data_path, set_name, 'train', 'input0')

if not os.path.exists(truth_path):
    os.makedirs(truth_path)
if not os.path.exists(image_path):
    os.makedirs(image_path)
spheres_big_small_noise_high_na_

Create PSF used for simulation#

from tnia.deconvolution.psfs import gibson_lanni_3D

# scope parameters
if na == 'high':
    print('high NA')
    ni=1.5
    ns  = 1.33
    NA=1.4
else:
    print('low NA')
    ni=1
    ns= 1
    NA=0.7
w=0.530

# spacings
xy_spacing = .1
z_spacing= .1

#depth to compute PSF this can be used to compute a PSF that has aberrations
#note stil need to confirm the sign of the depth, the negative sign is used to reproduce the experimental PSF
d=0

xy_psf_dim=255
z_psf_dim=151

psf  = gibson_lanni_3D(NA, ni, ns, xy_spacing, z_spacing, xy_psf_dim, z_psf_dim, d, w, use_psfm=True)
psf = psf.astype('float32')

psf=psf/psf.sum()

fig=show_xy_zy_max(psf, vmax=psf.max()/100)
print(psf.sum())
high NA
1.0
../_images/99c82ab9d8125b21f6608000d9036d95ce66e55ca7c8378d3e03a87e9456fe7a.png

Create phantom and applying imaging system#

In this block we create a set of phantoms, populate them with random spheres, apply the imaging model to them (convolution + Poisson noise), then save them.

xdim=128
ydim=128
zdim=128

number_images=30
number_spheres=50
number_spheres_added = 0

if noise == 'low':
    print('low noise')
    gain = 10
else:
    print('high noise')
    gain = 0.5

if spheres == 'big':
    print('big spheres')
    min_radius = 24
    max_radius = 80
elif spheres == 'small':
    print('small spheres')
    min_radius = 5
    max_radius = 15
else:
    print('big and small spheres')
    min_radius = 5
    max_radius = 80

gpu = False

for n in range(0,number_images):

    phantom = np.zeros([zdim,xdim,ydim], dtype=np.float32)
    
    for i in range(0,number_spheres):
        x=random.randint(0,xdim)
        y=random.randint(0,ydim)
        z=random.randint(0,zdim)
        intensity = random.randint(50,800) 

        #print(i,x,y,z)

        r=random.randint(min_radius,max_radius)

        size = [2*r, 2*r, 2*r]
        sphere = rg.sphere(size, r).astype(np.float32)
        sphere = sphere*intensity
        #add_sphere3d(phantom, 20, x, y, z, intensity, 2)
        if add_small_to_large(phantom, sphere, x, y, z, True) == True:
            number_spheres_added += 1

    print('number_spheres_added', number_spheres_added)

    phantom = phantom*gain
    phantom_forward = forward(phantom, psf, 10, True, gpu=gpu)
    sub_sample = 4 
    phantom_sub = phantom[::sub_sample,:,:]
    phantom_forward_sub = phantom_forward[::sub_sample,:,:]

    fig=show_xy_zy_max(phantom, figsize=(7,5))
    fig = show_xy_zy_max(phantom_forward, figsize=(7,5))
    fig = show_xy_zy_max(phantom_sub, figsize=(7,5))
    fig = show_xy_zy_max(phantom_forward_sub, figsize=(7,5))

    imsave(truth_path + '\phantom_sub'+str(n)+'.tif', phantom_sub)
    imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
high noise
big and small spheres
number_spheres_added 6
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub0.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 17
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub1.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 26
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub2.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 31
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub3.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 36
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub4.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 54
c:\users\bnort\work\imagej2022\tnia\tnia-python\tnia\plotting\projections.py:228: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`). Consider using `matplotlib.pyplot.close()`.
  fig=plt.figure(figsize=figsize)
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub5.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 62
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub6.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 70
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub7.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 79
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub8.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 88
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub9.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 99
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub10.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 106
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub11.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 113
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub12.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 122
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub13.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 125
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub14.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 130
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub15.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 135
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub16.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 145
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub17.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 158
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub18.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 164
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub19.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 173
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub20.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 181
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub21.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 192
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub22.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 201
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub23.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 208
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub24.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 215
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub25.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 219
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub26.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 228
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub27.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 235
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub28.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
number_spheres_added 238
C:\Users\bnort\AppData\Local\Temp\ipykernel_10184\4048830295.py:66: UserWarning: ../../data/deep learning training\spheres_big_small_noise_high_na_\train\input0\phantom_forward_sub29.tif is a low contrast image
  imsave(image_path + '\phantom_forward_sub'+str(n)+'.tif', phantom_forward_sub)
../_images/9a592da754872ffc2c47d1d7877b76a7c734b73bfff45425708abb97ef4db264.png ../_images/ceb3ef056daf508a97b25b3db3bfbb0488dd65c584fa7961a142329b2ae88425.png ../_images/a7f9b32c80ac7bdf6f0e414906f53dba1154ac091de84f1162c2bfba3b11a82e.png ../_images/9451b28c70196eb5d3724d3cea282572b2212111a494e2e01a8f1391c7dd27b4.png ../_images/e15920c6a019cbe8ff7e801a99754fd498a9e8df9d2d198c9a7211351cf1fdf9.png ../_images/d8b0d9cd0e9449ae7dd3451f80a56c66ef21547681f324317c5a4ebbc5de8626.png ../_images/5d852e521383ffbace8825b3ad3108a610956695ee68efd51a251e77e8ae4cea.png ../_images/7478faa8e6b17413ed425104de3fbb28a0809b90e253a373e70a5a61784aaa81.png ../_images/0387d2fe7af35c905d45eabc4f0ba1d69badb83fef512a39ef3cd3982543885b.png ../_images/08e97bc2136a9ef53c39647dfb1b5ba0fc760f582abe393c5a1e38348c03971b.png ../_images/2e2e4469d89b6f439a5393f5a4c6968cf454a0098701dc33ea26b586e6568b5c.png ../_images/e31efc0f8ef70434c173773ebadd4717e31640c1624d433a9bba22eacafde3e5.png ../_images/2d02153cd808c4bc90bf8018289945e85207d3a17e54f5473ea2aedd8ae5b101.png ../_images/f04d8a3d449111b6847addca55c3da67dfe41894d48fd9c7444104d6348c1b66.png ../_images/47abf993e81655aad00e0db1253718f283b5fab5c35761cbabadc89fdce7bd14.png ../_images/da20b31ba22cbe6222018f83fe87e6011f1072ac63669886dbee50d36ec895d8.png ../_images/ae477472e8c12be697b490027ee885248db15bbd24a8e6c356d3474e22b1cefb.png ../_images/1aff21d75531b7aaae786bae57d750d54a9523543ee79216eb7b270259dd8bcd.png ../_images/8b5082f44907aa6c2a1cc92462d70f68eee19e641728ee2618be316bcf395ae7.png ../_images/acd61c357470bed3bb3d6cb8d1ad016573cb38550e93cd18483a0f0bcce6979d.png ../_images/dc6e6d886c2995a81395e4fd0cc98bdef6f02054ec5ff67658a3568604d696a1.png ../_images/50dd03c369c1755585c970139539bd125fa07ba2e5a6c425ccd70bc8beb4e3ab.png ../_images/e421c32c11c37060ee7089293aeaeba9631987ecd6c7611a2c1bfa509c80f8c1.png ../_images/990b9ad44bf4af2b114d169313688f7bc824e91873c0f10cb31e394658c50310.png ../_images/54d97acc2eb3a540be7139e2606886437f316df8fa141de1bb9f83410c0a8d0f.png ../_images/de62ed6749dd260e46fdb65ef137dd70fa7c74c5bb97b95161bde66dec149f5e.png ../_images/2b9148eaecaf267231989682734a81c5c502a0b1c23c39d6442957ca85940673.png ../_images/f13031ed3aca63f6f7790c5294ee743a7ae450f88b3b6dbe35ba27f0e87cb118.png ../_images/eedaf0137017dceb42a46d06406af8e693413870a6b6d1a9a81bff973b417508.png ../_images/5a5c98bfbef761bd878cafe485d3e2d27fc6cac4511a4a9b022d4e5cec847a40.png ../_images/b6ef50df860a53ee1b0db307f5c3b179104bbd0d504438deb6097ca8fcc03f7c.png ../_images/395280fdee7b4f12b4776d71f462a6ed537ec42b39127f42c63512cd9654ff97.png ../_images/cd7295bdba8f89b49b265d1908c4130009c9c38284f23746c91361b548d55f1b.png ../_images/e5a3ad8f8f6c7d234928cc095b3bb1ab61fda92bbd8e81a100a9611188d47eaf.png ../_images/fa32a628f697a1d71bdfd2b29d39e009557185fc8be8f53670694dec3d7dc103.png ../_images/3c7d78c065835e5566d23fff2dc72938107e1c0cbaa94998a3e283e300e954db.png ../_images/f421b60d420bb949968724cb8cd5335eb577ecc925a5d6194b43b499f6d49f2a.png ../_images/53cbdf603f555c62be3732f1f63ff9705489fe5fda2c7fbb7deb271039933b0c.png ../_images/c61fbf7930660ba2dc0cee4453e27fa49ae861e86ee5c8122907f2a2f40e53cd.png ../_images/9f017db1c9098e3e9378fae82b550007501a2ebe31af1d207469e496d7a65b10.png ../_images/44c1fd5bbd1c5913d0d6393fefcc8306070751c6613e6e18c68a89e495f096ae.png ../_images/c81ce4038e9caee81de1300fde2cbea73f8e558928ec88afcde78234ec18fb83.png ../_images/6b8102c0c107b7462f5925a8d4a323ef15e49ce82e1fa19953533b662dfdc27b.png ../_images/42041957c6bdaeee03c425f478fc2a1129c6c0faad2b7d70c2ec500dc4d6d5c7.png ../_images/ace95ab2bffb096e5e8396b86938d1bdb5be49370af90deebea28ffd6d34d9a7.png ../_images/2d406e72343818795810248bd17ca6c6142d723de5b3cb4a793a2259df53b208.png ../_images/58ff1a2f32908d856100f2f35143c632e66b2e2390bc950712227e8d2468a139.png ../_images/b91c460dfc500baa78729ed7a74f6e637e59f9dcc05d14d0270add378cfb2bf9.png ../_images/2c5755776a3ff3afd92dae93a919fe2950173a3a1ccc40fd19d00b8eab68a5f2.png ../_images/4479e4fc0320345b48fcde3a2b443c212cd7d095d3fbfa36313523c066159383.png ../_images/85475041eae9ed3e4b3a6bd2d3a814f9e9701106d663e71e57749c75f711280a.png ../_images/acba997bf0f76e2bd9b464587518446859ff8647081496e345ef8ab9546df010.png ../_images/d586dc8055caa0eba836d18a6d16aef1d9afe6155e0c1ef01eecfad24a787db9.png ../_images/23afb278250df10557c05a8023ec6fd5cad5b2b6e6864d4e56a3ddc59c804a82.png ../_images/3bad5c6febc051723ee09168b16ded0a44abc06a015d508adcf9bf2e72ea6c30.png ../_images/a148b4e76b6c488470cf5d931d08ddfdd1a6c674f8466c36dee42830e817c995.png ../_images/779ff9e1c48774e1a708270e22b3955b5217989b95435f2c123ae18842ac876d.png ../_images/bfb638477283bc27ab0ada695956104cc3c70f87c6f205d72834f39e0e57c3f7.png ../_images/dd37d0e8e18994d3bf02e613e8ca954f6c81ed3a743681fd90fd8b3e13e697bd.png ../_images/f07120d455bda55697e81706d23dcdad952e39c01de995cf4adc8eb35e7d9878.png ../_images/34e4431dc08b1c7ed17e93f27c23e72c39fecbc4540fdd069fb939823b25db5c.png ../_images/f77ef88a68adc9e3cccc89e6701ad99abece5bc70e70c59d2576a72c3e73f83b.png ../_images/0a2c07b1fb326f9e7c156e420f85724a94e85982ab40604446bf5edf2e16f591.png ../_images/30fd1c7e105d4e9cb74b618c78629f3eb7cdda144448559f2299b374b7df9565.png ../_images/159a176538a484339383dc97e41c364119fcd23fa6a87c441df551ce2fc59a85.png ../_images/0adc023038871b037acbcc97b03a12177c4bef8900e824da9c3daab3d18ef25c.png ../_images/00084aaf5990f835b47b0f99bb777e863207b4732a2c20193a273c5ae387e971.png ../_images/d0ec74e4e3b6ecf59ad21624a9ce624e8b811a6b5fb69b230630521c3913988e.png ../_images/795b3a409da41380355f2b60ee0cf2daba50aed83f92e546841d0435e565f355.png ../_images/2bce6f33de1dd10c9a66ebbbed6f390179b4f4df445ff4a47db455f4666c6a72.png ../_images/57aa6c66831e67c4012e460ca796e5624d1a230d15224d215593b8f0dc4281f2.png ../_images/b81d651e97c4efc46c7d824765feb3fc58aa495dad34ab42872e628b7b9f9a28.png ../_images/22d11c150a4a3f6fafbbcb01b078bff993d0eb8ffc592f319b36b1cf1bb03b27.png ../_images/b9231d6aadfad7939885bd990a5ce5f7b9b83e355db9c01f5f5ac0fefb34c651.png ../_images/01ba3c92ff77f13e866016dd4bddd40543fdc4c3756304ef6746f4472953a3b8.png ../_images/7242720887db48f93abee156ed172680b09f9d75d675d9240d32cc12f983e9ec.png ../_images/6b5125f0d9074804d0339ab77d51ab8911d04c651479abe0878ace12ef865489.png ../_images/12860f69b431bc0fa8e369f0f02a1ce27c00771be35ab859a11acac58e356eda.png ../_images/51574ca491c981fdc708303781c67f8f0b1791e11d372482dbc986980b4b7536.png ../_images/ec0b597bfd90d0a594032e902088751afa21dc5d58984fdbff4b6530785760b3.png ../_images/9ae80290cc64db4c813e319bf106457dc92f16fea3801650fac9711660a450c0.png ../_images/0ef38bc56f81531d7e0fd7b03b9cdab54332fec23ba7ecd8c4628ccc5cefa3d3.png ../_images/6ca137908b2abb2a1beab4572074dc9a561f94dd23fbd98b43cfd6d75c8fcd1c.png ../_images/499eb80f077ad201053171dca43b69e30b35516dff870c5dff82c9bce4602834.png ../_images/4efeb400db7121b8e197a3833550242db5c6528359c98d4795f001347c54c336.png ../_images/905ee22e7a55a65d2725d37d1dbf4a8253a682ec1b5303460c6e9a75121213b3.png ../_images/1b9380580928d81994ba803fc34d9aaa5b6f16dcc165be9643943ae5597d8505.png ../_images/3b04dbfd3a9fac1f2efcf182cd98e6a5f85c17d496247c5856d7de50e9610899.png ../_images/7bb823e3f3ce2db716381fae82f4ea6d2d1dae2bdc0478579fdc05e98b8be9ec.png ../_images/72d00ac64f749fe50fae0c5df8a47d59f71ca35698ccd181968fef31b472f82b.png ../_images/6aa8f7b7d01d3e211c8a16d77d3325ffff7366822184b7d7fb39dffe54ccae92.png ../_images/63f91a5664da36986f2f3c52d035a2f3710bf5b90755431e8d780556d654366b.png ../_images/4a3815e7a7dbcac9a52b4b7ae536ef81207fcba1490082721d9f6b727e253227.png ../_images/d0e889eddd5ee8a44dcfad400bd9dd4a16412a8274d768994adbf08a24609e4c.png ../_images/efc716efe6efb5bbc5b120434a4adac7cc83367dd6df61727db354585a82678f.png ../_images/a78749eba7108f68de2d680781df7780d2d12f1bec699e9a32ad4512f11739af.png ../_images/0eb5afb898f7db21f8d6ea77ecab54cc94e1912e74bcd4d1b6fd6e43354c1fbc.png ../_images/983ec8a958815c6e2f4eb704a1d55c42772b361dcc938b22d0d6a18d232ad0a9.png ../_images/ab780e7b8790926aa671345260e6e163436595123f5f2e42f521de0fb47991c0.png ../_images/a279a511c716ecec9d74f5ac8fdecf50d3737d9630f27ff93553374b479be1fd.png ../_images/a5777e5abd0afd0fbf2ecb8873fb6851bd8b8f299703b4f33792d667d2b287c0.png ../_images/f730c223fd25dc3cd61880f1acbab2f6b7e332a6f98a8ed98b46a39242eaf00c.png ../_images/5740314f407dcf37d00b009ee21e24eb8ad87dd78fa28728af77ce0767aa0b87.png ../_images/c4c4791432c6dbb1035d7a67a51e51bf3909455d5c68fb6640b284cfe1ad102c.png ../_images/d9cf0b38f6d679d9e6a8942c52eba2750422704e3c070bfd62212054e0a8d1d7.png ../_images/979456e607e0a1b36c0866cefbc6f2e2ecc81052208fcba2efef65879dd68fd9.png ../_images/17f76aad8f24f35cd0c076679e260d245efc75e6896c161ceffa9dd7bfab9d9a.png ../_images/a04f3adf379ab8ee0400790979d47604cbde6e6f306e0b18676e3e3794254352.png ../_images/03acd305bd671258960bcd4e2adb7ac6f1004ecee382347e63ed8f1933b461a7.png ../_images/48c32e7a9f42f0cc8d564598fbf4d880c8aafc5f0ecd0e2f499596e79515b47d.png ../_images/56b431a9f85bfc13b69e8ed02892da0f793bc5aab424373169ef489d768cce18.png ../_images/b3988d6aa24b3cbd70f80acbfbe6c88779ec3ca6aa1b0ed36cdbe075e96ff269.png ../_images/701065bb8c37bd9ce98ec859e95859c461222ee7e537bd9665feecd2d9bdb7f7.png ../_images/2afb00ec7bc822acffd7bf01471cc3bc4a132c45dd2ecd7a70502c92068f6998.png ../_images/95b2940c5e1cadaa63ee536059a3b21809bd65948d3a1aa74213958712012048.png ../_images/f704bcc81ea68f59cc70bae055d7cdab156f775753b4444e8d350027ea10d57c.png ../_images/1aeb581d79c5c5bbf90c81e6dff0ccc0c46b3bcc2112b7540d7139fbd9815d3a.png ../_images/9b81663325a11fe2191285c14d20487b8e8cd5eedf2045dc2a34f383e4358702.png ../_images/aba22edf41d40163287655945fe797e34a0caa0348a5f69b550edcd20cddbede.png ../_images/449de51be85630235eba950b17f2833f9a48a63e7d873985201432bf10014af8.png
import napari
viewer = napari.Viewer()
viewer.add_image(phantom)
viewer.add_image(phantom_forward)
<Image layer 'phantom_forward' at 0x19240dba700>
phantom_forward_sub.shape
(86, 256, 256)