Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Topography Metadata validations #10

Merged
merged 22 commits into from
May 9, 2024

Conversation

m-aXimilian
Copy link
Contributor

@m-aXimilian m-aXimilian commented Apr 30, 2024

Description

Extended Depth of Focus (EDF) images are described in a czi-image by means of "Appliance" metadata items called "TopographyDataItem". It is important for the consuming application that the data specified there defines channels (indices) where "Textures" (the subblock that contain image pixeldata) and "HeightMaps" (the subblock that contain height information) can be found. At the same time, there should not be any additional information in these sections that is not defined by the czi specification.

This PR adds a basic metadata check for these topography sections. It implements the following checks:

  1. If both information HeightMap AND Texture information is present in the metadata
  2. Each of the entries in 'Textures' and 'HeighMaps' specifies a channel (via a 'StartC' information)
  3. No information other than 'StartC' is specified in the items. That other information is considered superfluous.

Fixes #8

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Malformed czi images were added to the testdata source. These are used with 2 new automated tests validating the introduced changes.

Checklist:

  • I followed the Contributing Guidelines.
  • I did a self-review.
  • I commented my code, particularly in hard-to-understand areas.
  • I updated the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

@m-aXimilian m-aXimilian linked an issue Apr 30, 2024 that may be closed by this pull request
@ptahmose ptahmose added the cla Contributor License Agreement sent to Admin label May 8, 2024
@m-aXimilian m-aXimilian marked this pull request as ready for review May 8, 2024 20:21
@m-aXimilian m-aXimilian changed the title add a topographyappliance checker skeleton Basic Topography Metadata validations May 8, 2024
m-aXimilian and others added 3 commits May 8, 2024 22:40
…n class and variable names, and to improve code organization and readability. The class name `CCheckTopgraphyApplianceMetadata` was corrected to `CCheckTopographyApplianceMetadata` in `checkerfactory.cpp` and `checkerTopographyApplianceValidation.cpp` files. The `DimensionView` struct was moved from the global scope to the private scope of the `CCheckTopographyApplianceMetadata` class in `checkerTopographyApplianceValidation.h` for better encapsulation. The variable names `texture_views` and `heightmap_views` were updated to `texture_views_` and `heightmap_views_` to follow the naming convention for private member variables.

Here is the list of changes:

1. The class name `CCheckTopgraphyApplianceMetadata` was corrected to `CCheckTopographyApplianceMetadata` in `checkerfactory.cpp` and `checkerTopographyApplianceValidation.cpp` files (spelling correction).
2. The `#include <codecvt>` directive was replaced with `#include <functional>`, `#include <string>`, and `#include <vector>` in `checkerTopographyApplianceValidation.cpp` (library inclusion).
3. The variable names `texture_views` and `heightmap_views` were changed to `texture_views_` and `heightmap_views_` in `checkerTopographyApplianceValidation.cpp` (naming convention).
4. The character `'0'` was replaced with `'\0'` in the `IsValid` method of the `DimensionView` struct in `checkerTopographyApplianceValidation.cpp` (correct representation of null character).
5. The `DimensionView` struct was moved from the global scope to the private scope of the `CCheckTopographyApplianceMetadata` class in `checkerTopographyApplianceValidation.h` (code organization).
6. The comment for the `CCheckTopographyApplianceMetadata` class was updated in `checkerTopographyApplianceValidation.h` (documentation update).
7. The `kHeighMapItemKey` constant was corrected to `kHeightMapItemKey` in `checkerTopographyApplianceValidation.h` (spelling correction).
8. The lambda function `enumChildrenLabmda` was renamed to `enumChildrenLambda` in `checkerTopographyApplianceValidation.cpp` (spelling correction).
…ZEISS/czicheck into 8-specialized-checker-for-topology-data
Copy link
Contributor

@ptahmose ptahmose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ptahmose ptahmose requested review from ptahmose and a team May 8, 2024 21:48
Copy link
Contributor

@ptahmose ptahmose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...we forgot the bump the version number (check CMakeLists.txt in repo's root folder, line 8). I'd guess - this change adds a new feature, so the minor-version-number should be incremented -> "0.2.0". And please add an entry to documentation/version-history.md.

@m-aXimilian
Copy link
Contributor Author

@ptahmose Thank you very much for fixing all the typos and ugliness!! Very much appreciated! I updated the version number and the version history according to your comment.

@m-aXimilian m-aXimilian requested a review from ptahmose May 9, 2024 10:31
Copy link
Contributor

@ptahmose ptahmose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@ptahmose ptahmose merged commit e9a12ef into main May 9, 2024
7 checks passed
@m-aXimilian m-aXimilian deleted the 8-specialized-checker-for-topology-data branch May 12, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla Contributor License Agreement sent to Admin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specialized checker for "topology data"
2 participants