Skip to content

Commit

Permalink
add simple cell phantom and phantom base class
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Feb 6, 2019
1 parent fff6233 commit c3c3d03
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cellsino/elements/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .sphere import Sphere
from .el_sphere import Sphere

available = [Sphere]
File renamed without changes.
22 changes: 22 additions & 0 deletions cellsino/phantoms/base_phantom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class BasePhantom(object):
def __init__(self, elements=[]):
self.elements = elements

def __iter__(self):
for el in self.elements:
yield el

def append(self, element):
self.elements.append(element)

def transform(self, x=0, y=0, z=0, rot_main=0, rot_in_plane=0,
rot_perp_plane=0):
ph = BasePhantom()
for el in self:
ph.append(el.transform(x=x,
y=y,
z=z,
rot_main=rot_main,
rot_in_plane=rot_in_plane,
rot_perp_plane=rot_perp_plane))
return ph
56 changes: 56 additions & 0 deletions cellsino/phantoms/ph_simple_cell.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from .base_phantom import BasePhantom
from ..elements import Sphere


class SimpleCell(BasePhantom):
def __init__(self,
cytoplasm_index=1.365,
nucleus_index=1.360,
nucleoli_index=1.387,
medium_index=1.335,
cytoplasm_fl=0,
nucleus_fl=3,
nucleus_shell_fl=10,
nucleoli_fl=0):
"""Simple cell phantom with cytoplasm, nucleus, and 2 nucleoli
Configuration:
- cytoplasm_index sphere (no fl) containing
- nucleus sphere (shell fluorescence) containing
- 2 small nucleoli (full fluorescence)
"""
nleoi1 = Sphere(radius=1.5e-6,
position=(-.25, 2, 2),
fl_intensity=nucleoli_fl-nucleus_fl,
n_object=medium_index+(nucleoli_index-nucleus_index),
medium_index=medium_index,
)

nleoi2 = Sphere(radius=1.5e-6,
position=(+.25, -1, 2),
fl_intensity=nucleoli_fl-nucleus_fl,
n_object=medium_index+(nucleoli_index-nucleus_index),
medium_index=medium_index,
)

nuclus = Sphere(radius=4e-6,
position=(0, 1, 1),
fl_intensity=nucleus_shell_fl,
n_object=medium_index+(nucleus_index-cytoplasm_index),
medium_index=medium_index,
)

nuclus_shell = Sphere(radius=3.8e-6,
position=(0, 1, 1),
fl_intensity=nucleus_fl-nucleus_shell_fl,
n_object=medium_index,
medium_index=medium_index,
)

cyto = Sphere(radius=5.5e-6,
position=(0, 0, 0),
fl_intensity=cytoplasm_fl,
n_object=cytoplasm_index,
medium_index=medium_index,
)
self.elements = [nleoi1, nleoi2, nuclus, nuclus_shell, cyto]

0 comments on commit c3c3d03

Please sign in to comment.