|
open_iA 2024.7
|
#include "iabase_export.h"#include "iAVec3.h"#include <vtkSmartPointer.h>#include <QMap>#include <QStringList>#include <QVariant>Classes | |
| class | iAByteOrder |
| Byte Order handling - mainly for simplifying exporting string constants for the two possible values. More... | |
Macros | |
| #define | FOR_VTKIMG_PIXELS(img, x, y, z) |
| #define | FOR_VTKIMG_PIXELS_IDX(img, idx) for (size_t idx = 0; idx < img->GetDimensions()[0]*img->GetDimensions()[1]*img->GetDimensions()[2]; ++idx) |
Enumerations | |
| enum | iACameraPosition { PX , MX , PY , MY , PZ , MZ , Iso } |
| Predefined camera positions; view along every positive (P) and negative (M) axis (x, y, z), as well as an isometric perspective. More... | |
Functions | |
| iAbase_API void | addImages (vtkSmartPointer< vtkImageData > imgDst, vtkSmartPointer< vtkImageData > const imgToAdd, iAProgress *p=nullptr) |
| add values of one image to the values of another image | |
| iAbase_API void | adjustIndexAndSizeToImage (QVariantMap ¶ms, vtkImageData *img) |
| Given index and size parameters in a QVariantMap, adjust these parameters so that they specify a region of interest that lies completely within the given image. | |
| iAbase_API vtkSmartPointer< vtkImageData > | allocateImage (int vtkType, int const dimensions[3], double const spacing[3]) |
| Create a VTK image with the given properties. | |
| iAbase_API vtkSmartPointer< vtkImageData > | allocateImage (int vtkType, int const dimensions[3], double const spacing[3], int numComponents) |
| Create a VTK image with the given properties. | |
| iAbase_API vtkSmartPointer< vtkImageData > | allocateImage (vtkSmartPointer< vtkImageData > img) |
| Create a VTK image that has the same properties (type, size, spacing) as the given image. | |
| iAbase_API void | convertLUTToTF (vtkSmartPointer< vtkLookupTable > src, vtkSmartPointer< vtkColorTransferFunction > ctf, vtkSmartPointer< vtkPiecewiseFunction > otf, double alphaOverride=-1) |
| iAbase_API void | convertTFToLUT (vtkSmartPointer< vtkLookupTable > dst, vtkSmartPointer< vtkScalarsToColors > ctf, vtkSmartPointer< vtkPiecewiseFunction > otf, int numCols, double const *lutRange=nullptr, bool reverse=false) |
| iAbase_API void | copyCameraParams (vtkCamera *dst, vtkCamera *src) |
| iAbase_API void | fillImage (vtkSmartPointer< vtkImageData > img, double const value, iAProgress *p=nullptr) |
| fill all pixels in the given image with the given value | |
| iAbase_API bool | isFlat (vtkImageData *img) |
| Checks whether an image is flat. | |
| iAbase_API bool | isVtkIntegerImage (vtkImageData *img) |
| Check whether the given image holds integer numbers. | |
| iAbase_API int | mapReadableDataTypeToVTKType (QString const &dataTypeName) |
| Maps a given data type string to the corresponding VTK type identifier. | |
| iAbase_API int | mapRenderModeToEnum (QString const &) |
| map the given render mode name to the respective enum in the render mode map | |
| iAbase_API int | mapStereoModeToEnum (QString const &) |
| iAbase_API QString | mapVTKTypeToReadableDataType (int vtkType) |
| Maps a given VTK type to the corresponding readable data type. | |
| iAbase_API size_t | mapVTKTypeToSize (int vtkType) |
| Returns the size (in bytes) of the given VTK type. | |
| iAbase_API iAVec3i | mapWorldCoordsToIndex (vtkImageData *img, double const *worldCoord) |
| Translate from world coordinates to voxel indices for the given image. | |
| iAbase_API void | mapWorldToVoxelCoords (vtkImageData *img, double const *worldCoord, double *voxelCoord) |
| Translate from world coordinates to voxel coordinates for the given image. | |
| iAbase_API void | multiplyImage (vtkSmartPointer< vtkImageData > imgDst, double value, iAProgress *p=nullptr) |
| multiply all values of an image with the given value | |
| iAbase_API QStringList const & | readableDataTypeList (bool withLongLongTypes) |
| Returns a human-readable list of available data types for a single pixel/voxel. | |
| iAbase_API vtkSmartPointer< vtkImageData > | readImage (QString const &filename) |
| Read an image from disk into a VTK image. | |
| iAbase_API QMap< QString, int > const & | RenderModeMap () |
| a map of available render modes in vtkSmartVolumeMapper to their names | |
| iAbase_API void | setCamPosition (vtkCamera *cam, iACameraPosition mode) |
| Set given camera position to one of the predefined positions available in iACameraPosition. | |
| iAbase_API QMap< QString, int > const & | StereoModeMap () |
| iAbase_API void | storeImage (vtkSmartPointer< vtkImageData > img, QString const &filename, bool useCompression=true, iAProgress const *progress=nullptr) |
| Stores an image on disk (typically in .mhd format). | |
| iAbase_API void | writeSingleSliceImage (QString const &filename, vtkImageData *img) |
| Write a single slice image to a common 2D picture format. | |
| #define FOR_VTKIMG_PIXELS_IDX | ( | img, | |
| idx ) for (size_t idx = 0; idx < img->GetDimensions()[0]*img->GetDimensions()[1]*img->GetDimensions()[2]; ++idx) |
| enum iACameraPosition |
| iAbase_API void addImages | ( | vtkSmartPointer< vtkImageData > | imgDst, |
| vtkSmartPointer< vtkImageData > const | imgToAdd, | ||
| iAProgress * | p = nullptr ) |
add values of one image to the values of another image
| imgDst | destination image (will be modified) |
| imgToAdd | image with values to be added to imgDst (will not be modified) |
| p | if given, used to report progress |
| iAbase_API void adjustIndexAndSizeToImage | ( | QVariantMap & | params, |
| vtkImageData * | img ) |
Given index and size parameters in a QVariantMap, adjust these parameters so that they specify a region of interest that lies completely within the given image.
| params | map of parameters (which should contain values for "Index" and "Size", as iAValueType::Vector3i, i.e. QVector<int>) |
| img | the image whose size determines the clamping of parameters |
| iAbase_API vtkSmartPointer< vtkImageData > allocateImage | ( | int | vtkType, |
| int const | dimensions[3], | ||
| double const | spacing[3] ) |
Create a VTK image with the given properties.
| vtkType | the VTK type identifier (VTK_INT, VTK_UNSIGNED_CHAR, ...) for the voxel data type to use in the new image |
| dimensions | the size of the image in the 3 dimensions. |
| spacing | the spacing (distance of voxels) in each of the 3 dimension directions. |
| iAbase_API vtkSmartPointer< vtkImageData > allocateImage | ( | int | vtkType, |
| int const | dimensions[3], | ||
| double const | spacing[3], | ||
| int | numComponents ) |
Create a VTK image with the given properties.
| vtkType | the VTK type identifier (VTK_INT, VTK_UNSIGNED_CHAR, ...) for the voxel data type to use in the new image |
| dimensions | the size of the image in the 3 dimensions. |
| spacing | the spacing (distance of voxels) in each of the 3 dimension directions. |
| numComponents | the number of components in each voxel. |
| iAbase_API vtkSmartPointer< vtkImageData > allocateImage | ( | vtkSmartPointer< vtkImageData > | img | ) |
Create a VTK image that has the same properties (type, size, spacing) as the given image.
| img | image whose type, size and spacing will be used to create the result image; its data will not be copied over to the new image |
| iAbase_API void convertLUTToTF | ( | vtkSmartPointer< vtkLookupTable > | src, |
| vtkSmartPointer< vtkColorTransferFunction > | ctf, | ||
| vtkSmartPointer< vtkPiecewiseFunction > | otf, | ||
| double | alphaOverride = -1 ) |
| iAbase_API void convertTFToLUT | ( | vtkSmartPointer< vtkLookupTable > | dst, |
| vtkSmartPointer< vtkScalarsToColors > | ctf, | ||
| vtkSmartPointer< vtkPiecewiseFunction > | otf, | ||
| int | numCols, | ||
| double const * | lutRange = nullptr, | ||
| bool | reverse = false ) |
| iAbase_API void copyCameraParams | ( | vtkCamera * | dst, |
| vtkCamera * | src ) |
| iAbase_API void fillImage | ( | vtkSmartPointer< vtkImageData > | img, |
| double const | value, | ||
| iAProgress * | p = nullptr ) |
fill all pixels in the given image with the given value
| img | image to be filled |
| value | used to fill each voxel in given image |
| p | if given, used to report progress |
| iAbase_API bool isFlat | ( | vtkImageData * | img | ) |
Checks whether an image is flat.
| img | a VTK image |
| iAbase_API bool isVtkIntegerImage | ( | vtkImageData * | img | ) |
Check whether the given image holds integer numbers.
| img | a VTK image |
| iAbase_API int mapReadableDataTypeToVTKType | ( | QString const & | dataTypeName | ) |
Maps a given data type string to the corresponding VTK type identifier.
Reverse of mapVTKTypeToReadableDataType
| dataTypeName | an entry from the list of readable data types (see readableDataTypeList()) |
| iAbase_API int mapRenderModeToEnum | ( | QString const & | modeName | ) |
map the given render mode name to the respective enum in the render mode map
| iAbase_API int mapStereoModeToEnum | ( | QString const & | modeName | ) |
| iAbase_API QString mapVTKTypeToReadableDataType | ( | int | vtkType | ) |
Maps a given VTK type to the corresponding readable data type.
Reverse of mapReadableDataTypeToVTKType
| vtkType | the VTK type identifier (VTK_INT, VTK_UNSIGNED_CHAR, ...) |
| iAbase_API size_t mapVTKTypeToSize | ( | int | vtkType | ) |
Returns the size (in bytes) of the given VTK type.
| vtkType | a VTK type identifier (VTK_INT, VTK_UNSIGNED_CHAR, ...) |
| iAbase_API iAVec3i mapWorldCoordsToIndex | ( | vtkImageData * | img, |
| double const * | worldCoord ) |
Translate from world coordinates to voxel indices for the given image.
| img | a VTK image |
| worldCoord | world (=scene) coordinates (3 components: x, y, z) |
| iAbase_API void mapWorldToVoxelCoords | ( | vtkImageData * | img, |
| double const * | worldCoord, | ||
| double * | voxelCoord ) |
Translate from world coordinates to voxel coordinates for the given image.
| img | a VTK image |
| worldCoord | world (=scene) coordinates (3 components: x, y, z) |
| voxelCoord | place for storing 3 components of voxel coordinates in img for the given world coordinates (clamped) |
| iAbase_API void multiplyImage | ( | vtkSmartPointer< vtkImageData > | imgDst, |
| double | value, | ||
| iAProgress * | p = nullptr ) |
multiply all values of an image with the given value
| imgDst | the image to be multiplied |
| value | multiplier used for each voxel |
| p | if given, used to report progress |
| iAbase_API QStringList const & readableDataTypeList | ( | bool | withLongLongTypes | ) |
Returns a human-readable list of available data types for a single pixel/voxel.
| withLongLongTypes | whether to include 64 bit signed/unsigned integer types |
| iAbase_API vtkSmartPointer< vtkImageData > readImage | ( | QString const & | filename | ) |
Read an image from disk into a VTK image.
| filename | the name of the file to read. |
| iAbase_API QMap< QString, int > const & RenderModeMap | ( | ) |
a map of available render modes in vtkSmartVolumeMapper to their names
| iAbase_API void setCamPosition | ( | vtkCamera * | cam, |
| iACameraPosition | mode ) |
Set given camera position to one of the predefined positions available in iACameraPosition.
| iAbase_API QMap< QString, int > const & StereoModeMap | ( | ) |
| iAbase_API void storeImage | ( | vtkSmartPointer< vtkImageData > | img, |
| QString const & | filename, | ||
| bool | useCompression = true, | ||
| iAProgress const * | progress = nullptr ) |
Stores an image on disk (typically in .mhd format).
| img | the image to store |
| filename | the name of the file to write to. |
| useCompression | whether the file should be compressed (.zraw) or not (.raw) in case we are storing .mhd files |
| progress | an optional progress link; if != null, the file writer will trigger its progress signal |
| iAbase_API void writeSingleSliceImage | ( | QString const & | filename, |
| vtkImageData * | img ) |
Write a single slice image to a common 2D picture format.
| filename | the name of the file to write to; this is expected to have an extension of tif, png, jpg or bmp; the type of the file written will be chosen according to this extension |
| img | the image to write; this already needs to be a 2D image (i.e., size in Z dimension = 1) |