3.1.2.8. opengate.image

3.1.2.8.1. Module Contents

3.1.2.8.1.1. Functions

update_image_py_to_cpp(py_img, cpp_img[, copy_data])

itk_dir_to_rotation(dir)

create_3d_image(size, spacing[, pixel_type, allocate, ...])

create_image_like(like_image[, allocate, pixel_type])

create_image_like_info(info[, allocate])

get_info_from_image(image)

read_image_info(path_to_image)

get_translation_between_images_center(img_name1, img_name2)

The two images are considered in the same physical space (coordinate system).

get_origin_wrt_images_g4_position(img_info1, ...)

The two images are considered in the same GATE physical space (coordinate system), so according to the

get_cpp_image(cpp_image)

itk_image_view_from_array(arr)

When the input numpy array is of shape [1,1,x], the conversion to itk image fails:

get_image_center(image)

get_translation_from_iso_center(img_info, rot, ...)

align_image_with_physical_volume(volume, image[, ...])

create_image_with_extent(extent[, spacing, margin])

create_image_with_volume_extent(volume[, spacing, margin])

voxelize_volume(se, image)

The voxelization do not check which volume is voxelized.

transform_images_point(p, img1, img2)

compute_image_3D_CDF(image)

Compute the three CDF (Cumulative Density Function) for the given image

scale_itk_image(img, scale)

divide_itk_images(img1_numerator, img2_denominator[, ...])

split_spect_projections(input_filenames, nb_ene)

The inputs are filenames of several images containing projections for a given spect head

compare_itk_image_info(image1, image2)

compare_itk_image_content(image1, image2)

compare_itk_image(filename1, filename2)

write_itk_image(img, file_path)

opengate.image.update_image_py_to_cpp(py_img, cpp_img, copy_data=False)[source]
opengate.image.itk_dir_to_rotation(dir)[source]
opengate.image.create_3d_image(size, spacing, pixel_type='float', allocate=True, fill_value=0)[source]
opengate.image.create_image_like(like_image, allocate=True, pixel_type='')[source]
opengate.image.create_image_like_info(info, allocate=True)[source]
opengate.image.get_info_from_image(image)[source]
opengate.image.read_image_info(path_to_image)[source]
opengate.image.get_translation_between_images_center(img_name1, img_name2)[source]

The two images are considered in the same physical space (coordinate system). This function computes the translation between their centers. Warning, the ITK image origin consider the center of the first voxel, we thus consider half a pixel shift for the center.

opengate.image.get_origin_wrt_images_g4_position(img_info1, img_info2, translation)[source]

The two images are considered in the same GATE physical space (coordinate system), so according to the centers of both images (+translation). This function computes the origin for the second image such as the two images will be in the same physical space of the first image. Warning, the ITK image origin considers the center of the first voxel, we thus consider half a pixel shift for the center.

opengate.image.get_cpp_image(cpp_image)[source]
opengate.image.itk_image_view_from_array(arr)[source]

When the input numpy array is of shape [1,1,x], the conversion to itk image fails: the output image size is with the wrong dimensions. We thus ‘patch’ itk.image_view_from_array to correct the size.

Not fully sure if this is the way to go.

opengate.image.get_image_center(image)[source]
opengate.image.get_translation_from_iso_center(img_info, rot, iso_center, centered)[source]
opengate.image.align_image_with_physical_volume(volume, image, initial_translation=None, initial_rotation=Rotation.identity(), copy_index=0)[source]
opengate.image.create_image_with_extent(extent, spacing=(1, 1, 1), margin=0)[source]
opengate.image.create_image_with_volume_extent(volume, spacing=(1, 1, 1), margin=0)[source]
opengate.image.voxelize_volume(se, image)[source]

The voxelization do not check which volume is voxelized. Every voxel will be assigned an ID corresponding to the material at this position in the world.

opengate.image.transform_images_point(p, img1, img2)[source]
opengate.image.compute_image_3D_CDF(image)[source]

Compute the three CDF (Cumulative Density Function) for the given image Warning; numpy order is ZYX

Parameters:

image – itk image

opengate.image.scale_itk_image(img, scale)[source]
opengate.image.divide_itk_images(img1_numerator, img2_denominator, filterVal=0, replaceFilteredVal=0)[source]
opengate.image.split_spect_projections(input_filenames, nb_ene)[source]

The inputs are filenames of several images containing projections for a given spect head Each image is composed of nb_ene energy windows and XX angles. The number of angles is found by looking at the number of slices.

The function computes nb_ene itk image with all angles and all heads merged into a list of projections stored as a 3D image, to make it easy to reconstruct with RTK.

opengate.image.compare_itk_image_info(image1, image2)[source]
opengate.image.compare_itk_image_content(image1, image2)[source]
opengate.image.compare_itk_image(filename1, filename2)[source]
opengate.image.write_itk_image(img, file_path)[source]