go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Loading...
Searching...
No Matches
ImpactTensorUtils.h File Reference
#include <torch/torch.h>
#include <vector>
#include <functional>
#include <exception>
#include "ImpactLoss.h"
#include "itkImpactModelConfiguration.h"
#include <random>
#include "ImpactTensorUtils.hxx"
Include dependency graph for ImpactTensorUtils.h:

Go to the source code of this file.

Namespaces

namespace  ImpactTensorUtils

Typedefs

template<typename ImagePointType>
using ImpactTensorUtils::ImagesPatchValuesAndJacobiansEvaluator
template<typename ImagePointType>
using ImpactTensorUtils::ImagesPatchValuesEvaluator

Functions

template<class ImagePointType>
std::vector< torch::Tensor > ImpactTensorUtils::GenerateOutputs (const std::vector< itk::ImpactModelConfiguration > &modelConfig, const std::vector< ImagePointType > &fixedPoints, const std::vector< std::vector< std::vector< std::vector< float > > > > &patchIndex, const std::vector< torch::Tensor > subsetsOfFeatures, torch::Device device, const ImpactTensorUtils::ImagesPatchValuesEvaluator< ImagePointType > &imagesPatchValuesEvaluator)
template<typename ImagePointType>
std::vector< torch::Tensor > ImpactTensorUtils::GenerateOutputsAndJacobian (const std::vector< itk::ImpactModelConfiguration > &modelConfig, const std::vector< ImagePointType > &fixedPoints, const std::vector< std::vector< std::vector< std::vector< float > > > > &patchIndex, std::vector< torch::Tensor > subsetsOfFeatures, std::vector< torch::Tensor > fixedOutputsTensor, torch::Device device, std::vector< std::unique_ptr< ImpactLoss::Loss > > &losses, const ImpactTensorUtils::ImagesPatchValuesAndJacobiansEvaluator< ImagePointType > &imagesPatchValuesAndJacobiansEvaluator)
template<typename TImage, typename FeaturesMaps, typename InterpolatorType, typename FeaturesImageType>
std::vector< FeaturesMaps > ImpactTensorUtils::GetFeaturesMaps (typename TImage::ConstPointer image, typename InterpolatorType::Pointer interpolator, const std::vector< itk::ImpactModelConfiguration > &modelsConfiguration, torch::Device device, std::vector< unsigned int > pca, std::vector< torch::Tensor > &principalComponents, const std::function< void(typename TImage::ConstPointer, torch::Tensor &, const std::string &)> &writeInputImage, const std::function< typename TImage::PointType(const typename TImage::PointType &)> &transformPoint=nullptr)
std::vector< torch::Tensor > ImpactTensorUtils::GetModelOutputsExample (std::vector< itk::ImpactModelConfiguration > &modelsConfig, const std::string &modelType, torch::Device device)
std::vector< std::vector< float > > ImpactTensorUtils::GetPatchIndex (const itk::ImpactModelConfiguration &modelConfiguration, std::mt19937 &randomGenerator, unsigned int dimension)
template<typename TImage, typename TInterpolator>
torch::Tensor ImpactTensorUtils::ImageToTensor (typename TImage::ConstPointer image, typename TInterpolator::Pointer interpolator, const std::vector< float > &voxelSize, const std::function< typename TImage::PointType(const typename TImage::PointType &)> &transformPoint)
template<typename TImage, typename TFeatureImage>
TFeatureImage::Pointer ImpactTensorUtils::TensorToImage (typename TImage::ConstPointer image, torch::Tensor layers)

Detailed Description

Utilities for converting ITK images to Torch tensors and extracting features using TorchScript models.

This module supports:

  • Conversion between ITK image data and Torch tensors
  • Patch-based evaluation of feature models (optionally with Jacobians)
  • Optional PCA projection and feature selection
  • Export of features and inputs for inspection

These tools are used internally by the ImpactImageToImageMetric for deep learning-based image registration.

Author
V. Boussot, Univ. Rennes, INSERM, LTSI- UMR 1099, F-35000 Rennes, France
Note
This work was funded by the French National Research Agency as part of the VATSop project (ANR-20-CE19-0015).
If you use the Impact anywhere we would appreciate if you cite the following article:
V. Boussot et al., IMPACT: A Generic Semantic Loss for Multimodal Medical Image Registration, arXiv preprint arXiv:2503.24121 (2025). https://doi.org/10.48550/arXiv.2503.24121

Definition in file ImpactTensorUtils.h.



Generated on 1774142652 for elastix by doxygen 1.15.0 elastix logo