# HG changeset patch # User Sebastien Jodogne # Date 1689245390 -7200 # Node ID 5f783bf882fe954bd166edd4b150a11bacf1f6f7 # Parent a1efc5c39615de15399b802b3d49e780f8b9778e add warning about anisotropic pixel spacing diff -r a1efc5c39615 -r 5f783bf882fe Applications/Dicomizer.cpp --- a/Applications/Dicomizer.cpp Wed Jul 12 23:37:38 2023 +0200 +++ b/Applications/Dicomizer.cpp Thu Jul 13 12:49:50 2023 +0200 @@ -644,9 +644,9 @@ boost::program_options::options_description volumeOptions("Description of the imaged volume"); volumeOptions.add_options() (OPTION_IMAGED_WIDTH, boost::program_options::value(), - "Width of the specimen (in mm), defaults to 15mm if missing") + "Width of the specimen (in mm), in the coordinate system of the glass slide, defaults to 15mm if missing") (OPTION_IMAGED_HEIGHT, boost::program_options::value(), - "Height of the specimen (in mm), defaults to 15mm if missing") + "Height of the specimen (in mm), in the coordinate system of the glass slide, defaults to 15mm if missing") (OPTION_IMAGED_DEPTH, boost::program_options::value()->default_value(1), "Depth of the specimen (in mm)") (OPTION_OFFSET_X, boost::program_options::value()->default_value(20), @@ -1127,6 +1127,16 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); } + // In the 2 lines below, remember to switch X/Y when going from physical to pixel coordinates! + float pixelSpacingX = volume.GetWidth() / static_cast(source->GetLevelHeight(0)); + float pixelSpacingY = volume.GetHeight() / static_cast(source->GetLevelWidth(0)); + if (std::abs(pixelSpacingX - pixelSpacingY) >= 100.0f * std::numeric_limits::epsilon()) + { + LOG(WARNING) << "Your pixel spacing is different along the X and Y axes, make sure that " + << "you have not inversed the --" << OPTION_IMAGED_WIDTH << " and the --" + << OPTION_IMAGED_HEIGHT << " options: " << pixelSpacingX << " vs. " << pixelSpacingY; + } + LOG(WARNING) << "Compression of the individual source tiles: " << OrthancWSI::EnumerationToString(sourceCompression); // Create the shared DICOM tags diff -r a1efc5c39615 -r 5f783bf882fe ViewerPlugin/openseadragon.html --- a/ViewerPlugin/openseadragon.html Wed Jul 12 23:37:38 2023 +0200 +++ b/ViewerPlugin/openseadragon.html Thu Jul 13 12:49:50 2023 +0200 @@ -21,7 +21,7 @@ var params = new URL(document.location).searchParams; OpenSeadragon({ id: 'osd', - prefixUrl: 'https://unpkg.com/openseadragon@4.1.0/build/openseadragon/images/', + prefixUrl: 'https://unpkg.com/openseadragon@4.0.0/build/openseadragon/images/', preserveViewport: true, visibilityRatio: 1, sequenceMode: true,