Skip to content

Commit

Permalink
Write z interval metadata for correct display in Zen 2d viewer / dime…
Browse files Browse the repository at this point in the history
…nsion slider (#8)

* cleanup

* create new guids for each z layer

* use guid only where necessary

* only activate acquisition tiles if command line parameter is set

* suggestions from code review

* cleanup

* cleanup

* fix linux build, more suggestions from code review

* missing files from previous commit

* suggestions from code review

* version number, documentation

* add changes

* cosmetic - remove some commented out code

* fix linter-issues

* copy attachments

* fix null pointer exception

* suggestions from code review

* add interval metadata, increase version number

* cleanup

* more cleanup

* more cleanup

* remove accidentially added files

* suggestions from code review

---------

Co-authored-by: ptahmose <jbohl@h-quer.de>
  • Loading branch information
RobertSchwede and ptahmose authored Aug 27, 2024
1 parent 0722536 commit bcd4fa1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ out/
build/
CMakeSettings.json
cmake-build-*/
.idea/
.idea/
.vscode/launch.json
.vscode/settings.json
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules" ${CMAKE_MODULE_PATH})

project ("warpaffine"
VERSION 0.5.0
VERSION 0.5.1
DESCRIPTION "experimental Deskew operation")

option(WARPAFFINE_BUILD_CLANGTIDY "Build with Clang-Tidy" OFF)
Expand Down
3 changes: 2 additions & 1 deletion documentation/version-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ version history {#version_history}
0.3.1 | [3](https://github.com/ZEISS/warpaffine/pull/3) | bugfix for a crash for "CZIs containing a single brick but have an S-index"
0.3.2 | [5](https://github.com/ZEISS/warpaffine/pull/5) | bugfix for a deadlock in rare case
0.4.0 | [6](https://github.com/ZEISS/warpaffine/pull/6) | set re-tiling id of sub-blocks to allow for more sensible stitching of resulting CZI
0.5.0 | [7](https://github.com/ZEISS/warpaffine/pull/7) | copy attachments from source document
0.5.0 | [7](https://github.com/ZEISS/warpaffine/pull/7) | copy attachments from source document
0.5.1 | [8](https://github.com/ZEISS/warpaffine/pull/8) | fix z interval metadata
12 changes: 12 additions & 0 deletions libwarpaffine/sliceswriter/SlicesWriterTbb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ void CziSlicesWriterTbb::Close(const std::shared_ptr<libCZI::ICziMetadata>& sour
MetadataUtils::WriteScalingInfo(metadata_builder_from_source.get(), *new_scaling_info);
}

if (new_scaling_info->IsScaleZValid())
{
auto increment_node = metadata_builder_from_source->GetRootNode()->GetOrCreateChildNode("Metadata/Information/Image/Dimensions/Z/Positions/Interval/Increment");
if (increment_node)
{
const double original_scaling_meters = new_scaling_info->scaleZ;

// increment should be in micrometers
increment_node->SetValueDbl(original_scaling_meters * 1e6);
}
}

// allow the caller to tweak the metadata before it is written out
if (tweak_metadata_hook)
{
Expand Down

0 comments on commit bcd4fa1

Please sign in to comment.