Mercurial > hg > orthanc-wsi
changeset 324:a92bb720f90b
renamed option --tiff-alignment as --padding
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 16 Oct 2024 21:08:58 +0200 |
parents | 429c4efa1fde |
children | 9947e70cbcea |
files | Applications/Dicomizer.cpp Framework/DicomizerParameters.cpp Framework/DicomizerParameters.h NEWS |
diffstat | 4 files changed, 20 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/Dicomizer.cpp Wed Oct 16 19:36:01 2024 +0200 +++ b/Applications/Dicomizer.cpp Wed Oct 16 21:08:58 2024 +0200 @@ -60,7 +60,6 @@ static const char* OPTION_DATASET = "dataset"; static const char* OPTION_FOLDER = "folder"; static const char* OPTION_FOLDER_PATTERN = "folder-pattern"; -static const char* OPTION_FORCE_OPENSLIDE = "force-openslide"; static const char* OPTION_HELP = "help"; static const char* OPTION_ICC_PROFILE = "icc-profile"; static const char* OPTION_IMAGED_DEPTH = "imaged-depth"; @@ -95,7 +94,8 @@ static const char* OPTION_CYTOMINE_COMPRESSION = "cytomine-compression"; // New in release 2.1 -static const char* OPTION_TIFF_ALIGNMENT = "tiff-alignment"; +static const char* OPTION_FORCE_OPENSLIDE = "force-openslide"; +static const char* OPTION_PADDING = "padding"; #if ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 0) @@ -581,7 +581,7 @@ (OPTION_THREADS, boost::program_options::value<int>()->default_value(parameters.GetThreadsCount()), "Number of processing threads to be used") - (OPTION_FORCE_OPENSLIDE, boost::program_options::value<bool>(), + (OPTION_FORCE_OPENSLIDE, boost::program_options::value<bool>()->default_value(false), "Whether to force the use of OpenSlide on input TIFF-like files (Boolean)") (OPTION_OPENSLIDE, boost::program_options::value<std::string>(), "Path to the shared library of OpenSlide " @@ -600,9 +600,9 @@ "Whether to repaint the background of the image (Boolean)") (OPTION_COLOR, boost::program_options::value<std::string>(), "Color of the background (e.g. \"255,0,0\")") - (OPTION_TIFF_ALIGNMENT, boost::program_options::value<int>()->default_value(64), - "Add padding to plain TIFF images to align the width/height to multiples " - "of this value, very useful to enable deep zoom with IIIF (1 means no padding)") + (OPTION_PADDING, boost::program_options::value<int>()->default_value(1), + "Add padding to plain PNG/JPEG/TIFF images to align the width/height to multiples " + "of this value, which enables deep zoom with IIIF (1 means no padding)") ; boost::program_options::options_description cytomine("Options if importing from Cytomine"); @@ -1021,17 +1021,17 @@ parameters.SetIccProfilePath(options[OPTION_ICC_PROFILE].as<std::string>()); } - if (options.count(OPTION_TIFF_ALIGNMENT)) + if (options.count(OPTION_PADDING)) { - int value = options[OPTION_TIFF_ALIGNMENT].as<int>(); + int value = options[OPTION_PADDING].as<int>(); if (value <= 0) { throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange, - "TIFF alignment must be >= 1"); + "Padding must be >= 1"); } else { - parameters.SetTiffAlignment(static_cast<unsigned int>(value)); + parameters.SetPadding(static_cast<unsigned int>(value)); } } @@ -1107,7 +1107,7 @@ return new OrthancWSI::PlainTiff(path, parameters.GetTargetTileWidth(512), parameters.GetTargetTileHeight(512), - parameters.GetTiffAlignment(), + parameters.GetPadding(), parameters.GetBackgroundColorRed(), parameters.GetBackgroundColorGreen(), parameters.GetBackgroundColorBlue());
--- a/Framework/DicomizerParameters.cpp Wed Oct 16 19:36:01 2024 +0200 +++ b/Framework/DicomizerParameters.cpp Wed Oct 16 21:08:58 2024 +0200 @@ -76,7 +76,7 @@ cytomineImageInstanceId_(-1), cytomineCompression_(ImageCompression_Png), forceOpenSlide_(false), - tiffAlignment_(1) + padding_(1) { backgroundColor_[0] = 255; backgroundColor_[1] = 255; @@ -364,15 +364,15 @@ } - void DicomizerParameters::SetTiffAlignment(unsigned int alignment) + void DicomizerParameters::SetPadding(unsigned int padding) { - if (alignment == 0) + if (padding == 0) { throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } else { - tiffAlignment_ = alignment; + padding_ = padding; } } }
--- a/Framework/DicomizerParameters.h Wed Oct 16 19:36:01 2024 +0200 +++ b/Framework/DicomizerParameters.h Wed Oct 16 21:08:58 2024 +0200 @@ -70,7 +70,7 @@ // New in release 2.1 bool forceOpenSlide_; - unsigned int tiffAlignment_; + unsigned int padding_; public: DicomizerParameters(); @@ -284,11 +284,11 @@ ImageCompression GetCytomineCompression() const; - void SetTiffAlignment(unsigned int alignment); + void SetPadding(unsigned int padding); - unsigned int GetTiffAlignment() const + unsigned int GetPadding() const { - return tiffAlignment_; + return padding_; } void SetForceOpenSlide(bool force)
--- a/NEWS Wed Oct 16 19:36:01 2024 +0200 +++ b/NEWS Wed Oct 16 21:08:58 2024 +0200 @@ -4,7 +4,7 @@ * Support of sparse encoding of tiles in OpenSlide (notably for MIRAX format) * OrthancWSIDicomizer supports plain TIFF, besides hierarchical TIFF * New option: "--force-openslide" to force the use of OpenSlide on TIFF-like files -* New option: "--tiff-alignment" to control deep zoom of plain TIFF over IIIF +* New option: "--padding" to control deep zoom of plain PNG/JPEG/TIFF images over IIIF * Force version of Mirador to 3.3.0 * In the IIIF manifest, reverse the order of the "sizes" field, which seems to fix compatibility with Mirador v4.0.0-alpha