Libs/Optimize/Domain/ImageDomainWithGradients.h
Namespaces
| Name |
|---|
| shapeworks User usage reporting (telemetry) |
Classes
| Name | |
|---|---|
| class | shapeworks::ImageDomainWithGradients |
Source code
```cpp
pragma once
include "ImageDomain.h"
include "itkFixedArray.h"
include "itkGradientImageFilter.h"
include "itkImage.h"
include "itkImageDuplicator.h"
namespace shapeworks {
template
typedef typename ImageDomain
typedef itk::FixedArray
void SetImage(ImageType I, double narrow_band) {
ImageDomain
inline vnl_vector_fixed
inline vnl_vector_fixed
vnl_vector_fixed
void DeleteImages() override {
ImageDomain
protected: ImageDomainWithGradients() {} virtual ~ImageDomainWithGradients() {}
void PrintSelf(std::ostream& os, itk::Indent indent) const {
ImageDomain
openvdb::VectorGrid::Ptr GetVDBGradient() { return m_VDBGradient; }
private: inline VnlVectorType SampleGradientVnl(const PointType& p, int idx) const { return VnlVectorType(this->SampleGradient(p, idx).GetDataPointer()); } inline VectorType SampleGradient(const PointType& p, int idx) const { if (this->IsInsideBuffer(p)) { const auto coord = this->ToVDBCoord(p); const auto _v = openvdb::tools::BoxSampler::sample(m_VDBGradient->tree(), coord); const VectorType v(_v.asPointer()); // This copies 3 floats from a VDB vector to a vnl vector return v; } else { std::ostringstream message; message << "Gradient queried for a Point, " << p << ", outside the given image domain."; throw std::runtime_error(message.str()); } }
openvdb::VectorGrid::Ptr m_VDBGradient; };
} // end namespace shapeworks ```
Updated on 2026-03-31 at 16:02:11 +0000