current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..', '..', '..',
                         'Numerical Human Phantoms', 'Donna')

# path to the AVW File of this model
filename = os.path.join(base_path, 'segm_donna')
# path to the tissue_mapping file
tissue_file = os.path.join('ImportDonna_tissues.txt')

AVW_Data = VoxelModelImporter(filename, tissue_file, 'AVW')
model_orig = AVW_Data.data['image']
tissue_name_orig = AVW_Data.tissue_names
tissue_mapping = AVW_Data.tissue_mapping

Donna = VoxelModel()
Donna.show_progress_bar = True

# needs to be set manually from README.txt
Donna.set_scale(1.875, 1.875, 10)

Donna.name = 'Donna'
Donna.description = 'Donna model from the Helmholtz Zentrum München. ' \
                    'Resolution %.2fmm x %.2fmm x %.2fmm' % (Donna.scaling.x,
                                                             Donna.scaling.y, Donna.scaling.z)

#  Calculate the outer_shape of the original and the complete model
outer_shape = AVW_Data.calculate_outer_shape(model_orig, tissue_mapping)

Donna.add_voxel_data(short_name='original',
                     name='Original data from AVW file',
                     model=model_orig,
Exemple #2
0
from LayerModel_lib.voxelmodel import VoxelModel
from LayerModel_lib.voxelmodel_importer import VoxelModelImporter
from LayerModel_lib.coordinate import Coordinate

current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..',
                         'Numerical Human Phantoms unzipped')
# Folder with all the txt-files of the AustinWoman model
txt_files_dir = os.path.join(base_path, 'AustinWoman-v2_5-2x2x2')

# file with all the tissue ids and the mapping between our TissueProperties and the one in the model
tissue_mapping_file = os.path.join('ImportAustinXXX_TissuesMaterialv2_3.txt')

# Define VoxelModel Object to store all properties of the AustinMan VoxelModel
AustinWoman = VoxelModel()
AustinWoman.show_progress_bar = True
# Set the name
AustinWoman.name = 'AustinWoman_v2.5_2x2x2'
AustinWoman.description = 'AustinWoman v2.5, Resolution: 2mm x 2mm x 2mm'

# get all the data from the txt files
txt_data = VoxelModelImporter(txt_files_dir,
                              tissue_mapping_file,
                              'TXT',
                              show_progress=True)

scale = txt_data.data['scale']
AustinWoman.set_scale(scale['x'], scale['y'], scale['z'])
model_orig = txt_data.data['image']
tissue_name_orig = txt_data.tissue_names
tissue_mapping = txt_data.tissue_mapping
from LayerModel_lib.voxelmodel import VoxelModel
from LayerModel_lib.voxelmodel_importer import VoxelModelImporter
from LayerModel_lib.coordinate import Coordinate

current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..', 'Numerical Human Phantoms unzipped')

# Folder with all the txt-files of the AustinMan model
txt_files_dir = os.path.join(base_path, 'AustinMan-v2_5-2x2x2 txt')

# file with all the tissue ids and the mapping between our TissueProperties and the one in the model
tissue_mapping_file = os.path.join('ImportAustinXXX_TissuesMaterialv2_3.txt')

# Define VoxelModel Object to store all properties of the AustinMan VoxelModel
AustinMan = VoxelModel()
AustinMan.show_progress_bar = True
# Set the name
AustinMan.name = 'AustinMan_v2.5_2x2x2'
AustinMan.description = 'AustinMan v2.5, Resolution: 2mm x 2mm x 2mm'

# get all the data from the txt files
txt_data = VoxelModelImporter(txt_files_dir, tissue_mapping_file, 'TXT', show_progress=True)

# the scale of the model in millimeter
scale = txt_data.data['scale']
AustinMan.set_scale(scale['x'], scale['y'], scale['z'])
# the original voxel model
model_orig = txt_data.data['image']
# the tissue names
tissue_name_orig = txt_data.tissue_names
tissue_mapping = txt_data.tissue_mapping
current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..', '..', '..', '..', '..',
                         'Numerical Human Phantoms', 'Katja')

# path to the AVW File of this model
filename = os.path.join(base_path, 'Katja')
# path to the tissue_mapping file
tissue_file = os.path.join('ImportKatja_tissues.txt')

AVW_Data = VoxelModelImporter(filename, tissue_file, 'AVW')
model_orig = AVW_Data.data['image']
tissue_name_orig = AVW_Data.tissue_names
tissue_mapping = AVW_Data.tissue_mapping

Katja = VoxelModel()
Katja.show_progress_bar = True

# needs to be set manually from README.txt
Katja.set_scale(1.775, 1.775, 4.84)

Katja.name = 'Katja'
Katja.description = 'Katja model from the Helmholtz Zentrum München. ' \
                    'Resolution %.2fmm x %.2fmm x %.2fmm' % (Katja.scaling.x,
                                                             Katja.scaling.y, Katja.scaling.z)

# For some reason Katja needs to be shifted left and back circularly
# first the shift left
model_orig = np.hstack((model_orig[:, 210::, :], model_orig[:, 0:210, :]))
# then shift back
model_orig = np.vstack((model_orig[16::, :, :], model_orig[0:16, :, :]))
# Katja has inverse x coordinates in the model. Correct that by flipping along the first axis
current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..', '..', '..', '..', '..',
                         'Numerical Human Phantoms', 'Irene')

# path to the AVW File of this model
filename = os.path.join(base_path, 'Irene')
# path to the tissue_mapping file
tissue_file = os.path.join('ImportIrene_tissues.txt')

AVW_Data = VoxelModelImporter(filename, tissue_file, 'AVW')
model_orig = AVW_Data.data['image']
tissue_name_orig = AVW_Data.tissue_names
tissue_mapping = AVW_Data.tissue_mapping

Irene = VoxelModel()
Irene.show_progress_bar = True

# needs to be set manually from README.txt
Irene.set_scale(1.875, 1.875, 5)

Irene.name = 'Irene'
Irene.description = 'Irene model from the Helmholtz Zentrum München. ' \
                    'Resolution %.2fmm x %.2fmm x %.2fmm' % (Irene.scaling.x,
                                                             Irene.scaling.y, Irene.scaling.z)

# For some reason Irene needs to be shifted left and back circularly
# first the shift left
model_orig = np.hstack((model_orig[:, 166::, :], model_orig[:, 0:166, :]))
# then shift back
model_orig = np.vstack((model_orig[16::, :, :], model_orig[0:16, :, :]))
current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..', '..', '..', '..', '..',
                         'Numerical Human Phantoms', 'Helga')

# path to the AVW File of this model
filename = os.path.join(base_path, 'segm_helga')
# path to the tissue_mapping file
tissue_file = os.path.join('ImportHelga_tissues.txt')

AVW_Data = VoxelModelImporter(filename, tissue_file, 'AVW')
model_orig = AVW_Data.data['image']
tissue_name_orig = AVW_Data.tissue_names
tissue_mapping = AVW_Data.tissue_mapping

Helga = VoxelModel()
Helga.show_progress_bar = True

# needs to be set manually from README.txt
Helga.set_scale(0.98, 0.98, 10)

Helga.name = 'Helga'
Helga.description = 'Helga model from the Helmholtz Zentrum München. ' \
                    'Resolution %.2fmm x %.2fmm x %.2fmm' % (Helga.scaling.x,
                                                             Helga.scaling.y, Helga.scaling.z)

# Calculate the outer_shape of the original and the complete model
outer_shape = AVW_Data.calculate_outer_shape(model_orig, tissue_mapping)

Helga.add_voxel_data(short_name='original',
                     name='Original data from AVW file',
                     model=model_orig,
Exemple #7
0
current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..', '..', '..', '..', '..',
                         'Numerical Human Phantoms', 'Frank')

# path to the AVW File of this model
filename = os.path.join(base_path, 'segm_frank')
# path to the tissue_mapping file
tissue_file = os.path.join('ImportFrank_tissues.txt')

AVW_Data = VoxelModelImporter(filename, tissue_file, 'AVW')
model_orig = AVW_Data.data['image']
tissue_name_orig = AVW_Data.tissue_names
tissue_mapping = AVW_Data.tissue_mapping

Frank = VoxelModel()
Frank.show_progress_bar = True

# needs to be set manually from README.txt
Frank.set_scale(0.742188, 0.742188, 5)

Frank.name = 'Frank'
Frank.description = 'Frank model from the Helmholtz Zentrum München. ' \
                    'Resolution %.2fmm x %.2fmm x %.2fmm' % (Frank.scaling.x,
                                                             Frank.scaling.y, Frank.scaling.z)

# For some reason Frank needs to be shifted back circularly
model_orig = np.vstack((model_orig[25::, :, :], model_orig[0:25, :, :]))

#  Calculate the outer_shape of the original and the complete model
outer_shape = AVW_Data.calculate_outer_shape(model_orig, tissue_mapping)
current_directory = os.path.dirname(__file__)
base_path = os.path.join(current_directory, '..', '..', '..', '..', '..', 'Numerical Human Phantoms', 'VisHum')

# path to the AVW File of this model
filename = os.path.join(base_path, 'segm_vishum')
# path to the tissue_mapping file
tissue_file = os.path.join('ImportVisibleHuman_tissues.txt')

AVW_Data = VoxelModelImporter(filename, tissue_file, 'AVW')
model_orig = AVW_Data.data['image']
tissue_name_orig = AVW_Data.tissue_names
tissue_mapping = AVW_Data.tissue_mapping

VisibleHuman = VoxelModel()
VisibleHuman.show_progress_bar = True
# from README.txt
VisibleHuman.set_scale(0.94, 0.91, 5)

VisibleHuman.name = 'VisibleHuman'
VisibleHuman.description = 'Visible Human model from the Helmholtz Zentrum München. ' \
                           'Resolution %.2fmm x %.2fmm x %.2fmm' % (VisibleHuman.scaling.x,
                                                                    VisibleHuman.scaling.y, VisibleHuman.scaling.z)

# Calculate the outer_shape of the original and the complete model
outer_shape = AVW_Data.calculate_outer_shape(model_orig, tissue_mapping)

VisibleHuman.add_voxel_data(short_name='original',
                            name='Original data from AVW file',
                            model=model_orig,
                            outer_shape=outer_shape,