Phantom#

class snake.core.phantom.static.Phantom(name, masks, labels, props)[source]#

Bases: object

A Phantom consist of a list of tissue mask and parameters for those tissues.

Methods

__init__

add_tissue

Add a tissue to the phantom.

from_brainweb

Get the Brainweb Phantom.

from_guerin_kern

Get the Guerin-Kern Phantom.

from_mrd_dataset

Load the phantom from a mrd dataset.

from_shared_memory

Give access the tissue masks and properties in shared memory.

from_shepp_logan

Get the Shepp-Logan Phantom.

in_shared_memory

Add a copy of the phantom in shared memory.

to_mrd_dataset

Add the phantom as an image to the dataset.

Attributes

anat_shape

Get the shape of the base volume.

n_tissues

Get the number of tissues.

name

masks

labels

props

Parameters:
add_tissue(tissue_name, mask, props, phantom_name=None)[source]#

Add a tissue to the phantom. Creates a new Phantom object.

Parameters:
Return type:

Phantom

classmethod from_brainweb(sub_id, sim_conf, tissue_file=TissueFile.tissue_1T5, tissue_select=None, tissue_ignore=None)[source]#

Get the Brainweb Phantom.

Parameters:
Return type:

Phantom

classmethod from_shepp_logan(resolution)[source]#

Get the Shepp-Logan Phantom.

Parameters:

resolution (tuple[int])

Return type:

Phantom

classmethod from_guerin_kern(resolution)[source]#

Get the Guerin-Kern Phantom.

Parameters:

resolution (tuple[int])

Return type:

Phantom

classmethod from_mrd_dataset(dataset, imnum=0)[source]#

Load the phantom from a mrd dataset.

Parameters:
Return type:

Phantom

to_mrd_dataset(dataset, sim_conf, imnum=0)[source]#

Add the phantom as an image to the dataset.

Parameters:
Return type:

Dataset

classmethod from_shared_memory(name, mask_prop, properties_prop, label_prop)[source]#

Give access the tissue masks and properties in shared memory.

Parameters:
Return type:

Generator[Phantom, None, None]

in_shared_memory(manager)[source]#

Add a copy of the phantom in shared memory.

Parameters:

manager (SharedMemoryManager)

Return type:

tuple[tuple[str, ArrayProps, ArrayProps, ArrayProps], tuple[SharedMemory, SharedMemory, SharedMemory]]

property anat_shape: tuple[int, ...]#

Get the shape of the base volume.

property n_tissues: int#

Get the number of tissues.