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

"""
#The original model
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,
                     outer_shape=outer_shape,
                     tissue_names=tissue_name_orig)

Donna.add_voxel_data(
    short_name='complete',
    name='The \'original\' model converted to our TissueProperties.',
    model=Donna.models['original'].data,
Exemple #3
0
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_6-1x1x1')

# 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
print("Creating VoxelModel...")
AustinMan = VoxelModel()
AustinMan.show_progress_bar = True
# Set the name
AustinMan.name = 'AustinMan_v2.6_1x1x1'
AustinMan.description = 'AustinMan v2.6, Resolution: 1mm x 1mm x 1mm'

# get all the data from the txt files
print("Import the data...")
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'])
model_orig = txt_data.data['image']
tissue_name_orig = txt_data.tissue_names
tissue_mapping = txt_data.tissue_mapping
"""
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
model_orig = np.flip(model_orig, axis=0)

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

Katja.add_voxel_data(short_name='original',
                     name='Original data from AVW 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, :, :]))

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

Irene.add_voxel_data(short_name='original',
                     name='Original data from AVW file',
                     model=model_orig,
                     outer_shape=outer_shape,
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,
                     outer_shape=outer_shape,
                     tissue_names=tissue_name_orig)

Helga.add_voxel_data(
    short_name='complete',
    name='The \'original\' model converted to our TissueProperties.',
    model=Helga.models['original'].data,
Exemple #7
0
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-1x1x1')

# 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_1x1x1'
AustinWoman.description = 'AustinWoman v2.5, Resolution: 1mm x 1mm x 1mm'

# 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
"""
the original model
"""
Exemple #8
0
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)

Frank.add_voxel_data(short_name='original',
                     name='Original data from AVW file',
                     model=model_orig,
                     outer_shape=outer_shape,
                     tissue_names=tissue_name_orig)

Frank.add_voxel_data(
# 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,
                            tissue_names=tissue_name_orig)

VisibleHuman.add_voxel_data(short_name='complete',
                            name='The \'original\' model converted to our TissueProperties.',
                            model=VisibleHuman.models['original'].data,
                            outer_shape=outer_shape,