pytomography.io.SPECT.shared#

Module Contents#

Functions#

subsample_projections(projections, N_pixel, N_angle[, ...])

Subsamples SPECT projections by averaging over N_pixel x N_pixel pixel regions and by removing certain angles

subsample_metadata(object_meta, proj_meta[, N_pixel, ...])

Subsample SPECT metadata with the specified pixel and angle reduction factors

subsample_projections_and_modify_metadata(object_meta, ...)

Subsamples SPECT projection and modifies metadata accordingly

subsample_amap(amap, N)

Subsamples 3D attenuation map by averaging over N x N x N regions

pytomography.io.SPECT.shared.subsample_projections(projections, N_pixel, N_angle, N_angle_start=0)[source]#

Subsamples SPECT projections by averaging over N_pixel x N_pixel pixel regions and by removing certain angles

Parameters:
  • projections (torch.Tensor) – Projections to subsample

  • N_pixel (int) – Pixel reduction factor (1 means no reduction)

  • N_angle (int) – Angle reduction factor (1 means no reduction)

  • N_angle_start (int) – Angle index to start at. Defaults to 0.

Returns:

Subsampled projections

Return type:

torch.Tensor

pytomography.io.SPECT.shared.subsample_metadata(object_meta, proj_meta, N_pixel=1, N_angle=1, N_angle_start=0)[source]#

Subsample SPECT metadata with the specified pixel and angle reduction factors

Parameters:
  • object_meta (SPECTObjectMeta) – Original object metadata

  • proj_meta (SPECTProjMeta) – Original projection metadata

  • N_pixel (int) – Pixel reduction factor (1 means no reduction). Defaults to 1.

  • N_angle (int) – Angle reduction factor (1 means no reduction). Defaults to 1.

  • N_angle_start (int) – Angle index to start at. Defaults to 0.

Returns:

Modified object metadata, modified projection metadata

Return type:

Sequence

pytomography.io.SPECT.shared.subsample_projections_and_modify_metadata(object_meta, proj_meta, projections, N_pixel=1, N_angle=1, N_angle_start=0)[source]#

Subsamples SPECT projection and modifies metadata accordingly

Parameters:
  • object_meta (ObjectMeta) – Object metadata

  • proj_meta (SPECTProjMeta) – Projection metadata

  • projections (torch.Tensor) – Projections to subsample

  • N_pixel (int) – Pixel reduction factor (1 means no reduction). Defaults to 1.

  • N_angle (int) – Angle reduction factor (1 means no reduction). Defaults to 1.

  • N_angle_start (int) – Angle index to start at. Defaults to 0.

Returns:

Modified object metadata, modified projection metadata, subsampled projections

Return type:

Sequence

pytomography.io.SPECT.shared.subsample_amap(amap, N)[source]#

Subsamples 3D attenuation map by averaging over N x N x N regions

Parameters:
  • amap (torch.Tensor) – Original attenuation map

  • N (int) – Factor to reduce by

Returns:

Subsampled attenuation map

Return type:

torch.Tensor