3.1.2.14. opengate.helpers_image

3.1.2.14.1. Module Contents

3.1.2.14.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])

create_image_like_info(info[, allocate])

get_info_from_image(image)

read_image_info(filename)

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)

get_image_center(image)

get_translation_from_iso_center(img_info, rot, ...)

get_physical_volume(volume_engine, vol_name, ...)

attach_image_to_physical_volume(phys_vol_name, image)

create_image_with_volume_extent(sim, vol_name[, ...])

voxelize_volume(se, vol_name, image)

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)

split_spect_projections(input_filenames, nb_ene)

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

opengate.helpers_image.update_image_py_to_cpp(py_img, cpp_img, copy_data=False)[source]
opengate.helpers_image.itk_dir_to_rotation(dir)[source]
opengate.helpers_image.create_3d_image(size, spacing, pixel_type='float', allocate=True, fill_value=0)[source]
opengate.helpers_image.create_image_like(like_image, allocate=True)[source]
opengate.helpers_image.create_image_like_info(info, allocate=True)[source]
opengate.helpers_image.get_info_from_image(image)[source]
opengate.helpers_image.read_image_info(filename)[source]
opengate.helpers_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.helpers_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.helpers_image.get_cpp_image(cpp_image)[source]
opengate.helpers_image.get_image_center(image)[source]
opengate.helpers_image.get_translation_from_iso_center(img_info, rot, iso_center, centered)[source]
opengate.helpers_image.get_physical_volume(volume_engine, vol_name, physical_volume_index)[source]
opengate.helpers_image.attach_image_to_physical_volume(phys_vol_name, image, initial_translation=None, initial_rotation=Rotation.identity())[source]
opengate.helpers_image.create_image_with_volume_extent(sim, vol_name, spacing=[1, 1, 1], margin=0)[source]
opengate.helpers_image.voxelize_volume(se, vol_name, image)[source]
opengate.helpers_image.transform_images_point(p, img1, img2)[source]
opengate.helpers_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.helpers_image.scale_itk_image(img, scale)[source]
opengate.helpers_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.