-
Notifications
You must be signed in to change notification settings - Fork 14
WIP: 109 layer descriptor shape parameters #110
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
base: master
Are you sure you want to change the base?
Changes from 15 commits
a4f69d6
afa60bc
ca684a5
78a1205
6fd3fb9
b45aecf
a3cbb27
cea1c15
c8b6515
f9e186e
7c75ebf
2cc6302
d49c72d
3b91e1e
39cee19
566324e
65c33d2
98344af
72b166d
d7cd221
27189ec
60a7a92
065acbd
728ee2f
772e7c9
27a6687
cd83fda
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ LayerDescriptor::LayerDescriptor( | |
| std::string internalPath, | ||
| std::string name, | ||
| LayerType type, | ||
| uint32_t rows, uint32_t cols, | ||
|
||
| uint64_t chunkSize, | ||
| int compressionLevel) | ||
| : m_id(id) | ||
|
|
@@ -39,6 +40,7 @@ LayerDescriptor::LayerDescriptor( | |
| , m_compressionLevel(compressionLevel) | ||
| , m_chunkSize(chunkSize) | ||
| , m_minMax(std::numeric_limits<float>::max(), std::numeric_limits<float>::lowest()) | ||
| , m_dims({rows, cols}) | ||
| { | ||
| } | ||
|
|
||
|
|
@@ -56,11 +58,13 @@ LayerDescriptor::LayerDescriptor( | |
| LayerDescriptor::LayerDescriptor( | ||
| const Dataset& dataset, | ||
| LayerType type, | ||
| uint32_t rows, uint32_t cols, | ||
| std::string internalPath, | ||
| std::string name) | ||
| : m_id(dataset.getNextId()) | ||
| , m_layerType(type) | ||
| , m_minMax(std::numeric_limits<float>::max(), std::numeric_limits<float>::lowest()) | ||
| , m_dims({rows, cols}) | ||
| { | ||
| m_internalPath = internalPath.empty() | ||
| ? Layer::getInternalPath(type) | ||
|
|
@@ -169,6 +173,16 @@ const std::string& LayerDescriptor::getName() const & noexcept | |
| return m_name; | ||
| } | ||
|
|
||
| //! Retrieve the dimensions (shape) of the layer | ||
| /*! | ||
| \return | ||
| The row and column spacing/resolution of the grid | ||
| */ | ||
| const std::tuple<uint32_t, uint32_t>& LayerDescriptor::getDims() const & noexcept | ||
| { | ||
| return m_dims; | ||
| } | ||
|
|
||
| //! Get the size of a buffer for reading a specified number rows and columns. | ||
| /*! | ||
| \param rows | ||
|
|
@@ -204,6 +218,12 @@ LayerDescriptor& LayerDescriptor::setMinMax( | |
| return *this; | ||
| } | ||
|
|
||
| LayerDescriptor& LayerDescriptor::setDims(uint32_t rows, uint32_t cols) & noexcept | ||
| { | ||
| m_dims = {rows, cols}; | ||
| return *this; | ||
| } | ||
|
|
||
| //! Set the HDF5 path of the layer. | ||
| /*! | ||
| \param inPath | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brian-r-calder This branch is being taken when running test_bag_vrmetadata.cpp, specifically when the test attempts to read back the VR metadata. Is the test wrong, or is there a mistake in
Layer::read()?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a branch here, but the code is correct --- we have to read the dimensions specifically from the layer rather than from the dataset, since we need to allow each layer to have its own dimensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant was
if (columnEnd >= numColumns || rowEnd >= numRows)evaluates totruewhenLayer::read()is called from test_bag_vrmetadata.cpp:452. Is the VR layer being created by the test incorrect?