import os 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', '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)
# 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 """ # Calculate the outer_shape outer_shape = txt_data.calculate_outer_shape(model_orig, tissue_mapping)
import os 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', '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)
# 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 """ the original model """ outer_shape = txt_data.calculate_outer_shape(model_orig, tissue_mapping) # store the original human body model AustinWoman.add_voxel_data( short_name='original',
import os import numpy as np 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', '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