OGS
|
Loading raster data such as images or ArcGIS-data into VTK image data structures.
The VtkRaster class enables loading of raster data such as images or ArcGIS-data. Supported image formats are ..... Georeferenced data can be imported via the GeoTIFF- or asc-format.
Definition at line 29 of file VtkRaster.h.
#include <VtkRaster.h>
Static Public Member Functions | |
static vtkImageImport * | loadImageFromArray (double const *const data_array, GeoLib::RasterHeader header) |
Returns a VtkImageAlgorithm from an array of pixel values and some image meta data. | |
static vtkImageAlgorithm * | loadImage (const std::string &fileName) |
Loads an image- or raster-file into an vtkImageAlgorithm-Object. | |
Static Private Member Functions | |
static vtkImageAlgorithm * | loadImageFromTIFF (const std::string &fileName) |
static vtkImageReader2 * | loadImageFromFile (const std::string &fileName) |
static std::string | findWorldFile (const std::string &filename) |
static bool | readWorldFile (std::string const &filename, vtkImageReader2 *image) |
|
staticprivate |
Tries to find a world file for the image given by the filename. World files can have a number of extensions depending on the programme used to write the image and this method just cycles through the possibilities, returning the first match it finds.
Definition at line 329 of file VtkRaster.cpp.
References BaseLib::dropFileExtension().
Referenced by readWorldFile().
|
static |
Loads an image- or raster-file into an vtkImageAlgorithm-Object.
Public method for loading all data formats. Internally the method automatically differentiates between images and georeferenced files and then calls the appropriate method for reading the file.
fileName | Filename of the file that should be loaded. |
Definition at line 43 of file VtkRaster.cpp.
References ERR(), FileIO::AsciiRasterInterface::getRasterFromASCFile(), FileIO::AsciiRasterInterface::getRasterFromSurferFile(), FileIO::AsciiRasterInterface::getRasterFromXyzFile(), loadImageFromArray(), loadImageFromFile(), and loadImageFromTIFF().
Referenced by VtkCompositeTextureOnSurfaceFilter::init(), MainWindow::loadFile(), and VtkGeoImageSource::readImage().
|
static |
Returns a VtkImageAlgorithm from an array of pixel values and some image meta data.
Definition at line 82 of file VtkRaster.cpp.
References GeoLib::RasterHeader::cell_size, GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_depth, GeoLib::RasterHeader::n_rows, GeoLib::RasterHeader::no_data, and GeoLib::RasterHeader::origin.
Referenced by NetCdfConfigureDialog::createDataObject(), and loadImage().
|
staticprivate |
Loads image files into a QPixmap object. Since images are not geo-referenced no origin point will be returned.
fileName | Filename of the file that should be loaded. |
Definition at line 291 of file VtkRaster.cpp.
References ERR(), and readWorldFile().
Referenced by loadImage().
|
staticprivate |
Loads ArcGIS asc-files to a QPixmap object and automatically does a contrast stretching to adjust values to 8 bit greyscale images.
fileName | Filename of the file that should be loaded. |
Definition at line 123 of file VtkRaster.cpp.
References ERR(), INFO(), uint32, and WARN().
Referenced by loadImage().
|
staticprivate |
Tries to find and load the world file associated with a BMP/JPG/PNG-file and create a RasterHeader for the image.
Definition at line 350 of file VtkRaster.cpp.
References ERR(), findWorldFile(), BaseLib::str2number(), and WARN().
Referenced by loadImageFromFile().