diff --git a/CMakeLists.txt b/CMakeLists.txt index 90ebff68a..5615b9bcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ project(FAST) set(VERSION_MAJOR 4) set(VERSION_MINOR 7) -set(VERSION_PATCH 1) +set(VERSION_PATCH 2) set(VERSION_SO 4) # SO version, should be incremented by 1 every time the existing API changes set(FAST_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") diff --git a/source/FAST/Data/ImagePyramid.cpp b/source/FAST/Data/ImagePyramid.cpp index b0b208e4e..dce60759d 100644 --- a/source/FAST/Data/ImagePyramid.cpp +++ b/source/FAST/Data/ImagePyramid.cpp @@ -25,7 +25,7 @@ namespace fast { int ImagePyramid::m_counter = 0; -ImagePyramid::ImagePyramid(int width, int height, int channels, int patchWidth, int patchHeight) { +ImagePyramid::ImagePyramid(int width, int height, int channels, int patchWidth, int patchHeight, ImageCompression compression) { if(channels <= 0 || channels > 4) throw Exception("Nr of channels must be between 1 and 4"); @@ -62,14 +62,19 @@ ImagePyramid::ImagePyramid(int width, int height, int channels, int patchWidth, auto tiff = m_tiffHandle; m_counter += 1; - ImageCompression compression = ImageCompression::LZW; - - uint photometric = PHOTOMETRIC_RGB; + uint photometric; uint bitsPerSample = 8; - uint samplesPerPixel = 3; // RGBA image pyramid is converted to RGB with getPatchAsImage + uint samplesPerPixel; if(channels == 1) { photometric = PHOTOMETRIC_MINISBLACK; // Photometric mask causes crash.. samplesPerPixel = 1; + if(compression == ImageCompression::UNSPECIFIED) + compression = ImageCompression::LZW; + } else { + if(compression == ImageCompression::UNSPECIFIED) + compression = ImageCompression::JPEG; + photometric = PHOTOMETRIC_RGB; + samplesPerPixel = 3; // RGBA image pyramid is converted to RGB with getPatchAsImage } while(true) { diff --git a/source/FAST/Data/ImagePyramid.hpp b/source/FAST/Data/ImagePyramid.hpp index b81b8a9d2..8a5d35a65 100644 --- a/source/FAST/Data/ImagePyramid.hpp +++ b/source/FAST/Data/ImagePyramid.hpp @@ -22,7 +22,7 @@ class Image; class FAST_EXPORT ImagePyramid : public SpatialDataObject { FAST_DATA_OBJECT(ImagePyramid) public: - FAST_CONSTRUCTOR(ImagePyramid, int, width,, int, height,, int, channels,, int, patchWidth, = 256, int, patchHeight, = 256); + FAST_CONSTRUCTOR(ImagePyramid, int, width,, int, height,, int, channels,, int, patchWidth, = 256, int, patchHeight, = 256, ImageCompression, compression, = ImageCompression::UNSPECIFIED); FAST_CONSTRUCTOR(ImagePyramid, openslide_t*, fileHandle,, std::vector, levels,); FAST_CONSTRUCTOR(ImagePyramid, std::ifstream*, stream,, std::vector, tileHeaders,, std::vector, levels,, ImageCompression, compressionFormat,); FAST_CONSTRUCTOR(ImagePyramid, TIFF*, fileHandle,, std::vector, levels,, int, channels,,bool, isOMETIFF, = false); diff --git a/source/FAST/Importers/TIFFImagePyramidImporter.hpp b/source/FAST/Importers/TIFFImagePyramidImporter.hpp index c178e193f..8d84d420d 100644 --- a/source/FAST/Importers/TIFFImagePyramidImporter.hpp +++ b/source/FAST/Importers/TIFFImagePyramidImporter.hpp @@ -14,6 +14,9 @@ namespace fast { * For instance if exported using the TIFFImagePyramidExporter. * This exporter uses libtiff. * + * Outputs: + * - 0: ImagePyramid + * * @sa WholeSlideImageImporter TIFFImagePyramidExporter * @ingroup importers */