STIR  6.2.0
Classes | Namespaces
zoom.h File Reference

This file declares various zooming functions. More...

#include "stir/common.h"
#include "stir/ZoomOptions.h"

Go to the source code of this file.

Classes

class  stir::Viewgram< elemT >
 A class for 2d projection data. More...
 
class  stir::RelatedViewgrams< elemT >
 A class for storing viewgrams which are related by symmetry. More...
 
class  stir::VoxelsOnCartesianGrid< elemT >
 This class is used to represent voxelised densities on a cuboid grid (3D). More...
 
class  stir::PixelsOnCartesianGrid< elemT >
 This class is used to represent pixelised densities on a rectangular grid (2D). More...
 
class  stir::CartesianCoordinate3D< coordT >
 a templated class for 3-dimensional coordinates. More...
 
class  stir::BasicCoordinate< num_dimensions, coordT >
 class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordinates. More...
 

Namespaces

 stir
 Namespace for the STIR library (and some/most of its applications)
 

Functions

Functions for interpolating data to new pixel/bin sizes
void stir::zoom_viewgrams (RelatedViewgrams< float > &viewgrams, const float zoom, const int min_tang_pos_num, const int max_tang_pos_num, const float x_offset_in_mm=0, const float y_offset_in_mm=0)
 zoom a RelatedViewgrams object, replacing it with the new data More...
 
void stir::zoom_viewgram (Viewgram< float > &viewgram, const float zoom, const int min_tang_pos_num, const int max_tang_pos_num, const float x_offset_in_mm=0, const float y_offset_in_mm=0)
 zoom viewgram, replacing it with the new data More...
 
void stir::zoom_viewgram (Viewgram< float > &out_viewgram, const Viewgram< float > &in_viewgram, const float x_offset_in_mm=0, const float y_offset_in_mm=0)
 zoom in_viewgram, replacing out_viewgram with the new data More...
 
VoxelsOnCartesianGrid< float > stir::zoom_image (const VoxelsOnCartesianGrid< float > &image, const CartesianCoordinate3D< float > &zooms, const CartesianCoordinate3D< float > &offsets_in_mm, const BasicCoordinate< 3, int > &new_sizes, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, returning the new image More...
 
void stir::zoom_image_in_place (VoxelsOnCartesianGrid< float > &image, const CartesianCoordinate3D< float > &zooms, const CartesianCoordinate3D< float > &offsets_in_mm, const BasicCoordinate< 3, int > &new_sizes, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, replacing the first argument with the new data. Full 3D shifts and zooms. More...
 
void stir::zoom_image (VoxelsOnCartesianGrid< float > &image_out, const VoxelsOnCartesianGrid< float > &image_in, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image_in according to dimensions, origin and voxel_size of image_out. More...
 
void stir::zoom_image (PixelsOnCartesianGrid< float > &image2D_out, const PixelsOnCartesianGrid< float > &image2D_in, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image2D_in according to dimensions, origin and pixel_size of image2D_out. More...
 
VoxelsOnCartesianGrid< float > stir::zoom_image (const VoxelsOnCartesianGrid< float > &image, const float zoom, const float x_offset_in_mm, const float y_offset_in_mm, const int new_size, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, replacing the first argument with the new data More...
 
void stir::zoom_image_in_place (VoxelsOnCartesianGrid< float > &image, const float zoom, const float x_offset_in_mm, const float y_offset_in_mm, const int new_size, const ZoomOptions=ZoomOptions::preserve_sum)
 zoom image, replacing the first argument with the new data More...
 

Detailed Description

This file declares various zooming functions.

Author
Kris Thielemans
Claire Labbe
PARAPET project
Ludovica Brusaferri

These functions can be used for zooming of projection data or image data. Zooming requires interpolation. Currently, this is done using stir::overlap_interpolate.

The first set of functions allows zooming and translation in transaxial planes only. These parameters are the same for projection data or image data. That is, zoomed projection data are (approximately) the forward projections of zoomed images with the same parameters. These functions have the following parameters:

Parameters
zoomscales the projection bins (zoom larger than 1 means more detail, so smaller pixels)
x_offset_in_mmx-coordinate of new origin (in mm)
y_offset_in_mmy-coordinate of new origin (in mm)
Projection data

This allows 2-dimensional zooming and translation on arccorrected data, here translation means a translation in 'image' space which gives a sin shift of origin in the s - coordinate in projection space. The new range of s coordinates is given by

Parameters
min_tang_pos_num[for projection data only] the minimum tangential position number in the new projection line
max_tang_pos_num[for projection data only] the maximum tangential position number in the new projection line Note that the (projection of the) centre of the scanner axis is supposed to be at tang_pos_num = 0.
images

It allows three-dimensional zooming and translation. Parameters are derived either from stir::CartesianCoordinate3D objects, or from the information in the in and out images.

In the case that the offsets are 0, the following holds:

Warning
Because overlap_interpolate is used, the zooming is 'count-preserving', i.e. when the output range is large enough, the in.sum() == out.sum().
In STIR 1.x, origins were taken relative to the centre of the coordinate range:
x_in_mm = (x_index - x_ctr_index) * voxel_size.x() + origin.x()
where
x_ctr_index = (x_max_index + x_min_index)/2
This is no longer true. Instead we use DiscretisedDensity<3,float>::get_physical_coordinates_for_indices.