|
|
Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
Typedefs | |
| template<typename ImagePointType> | |
| using | ImagesPatchValuesAndJacobiansEvaluator |
| template<typename ImagePointType> | |
| using | ImagesPatchValuesEvaluator |
Functions | |
| template<class ImagePointType> | |
| std::vector< torch::Tensor > | 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 > | 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 > | 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 > | GetModelOutputsExample (std::vector< itk::ImpactModelConfiguration > &modelsConfig, const std::string &modelType, torch::Device device) |
| std::vector< std::vector< float > > | GetPatchIndex (const itk::ImpactModelConfiguration &modelConfiguration, std::mt19937 &randomGenerator, unsigned int dimension) |
| template<typename TImage, typename TInterpolator> | |
| torch::Tensor | 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 | TensorToImage (typename TImage::ConstPointer image, torch::Tensor layers) |
| using ImpactTensorUtils::ImagesPatchValuesAndJacobiansEvaluator |
Definition at line 174 of file ImpactTensorUtils.h.
| using ImpactTensorUtils::ImagesPatchValuesEvaluator |
Definition at line 146 of file ImpactTensorUtils.h.
| 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 ) |
Computes feature outputs for all patches using each model.
This function computes feature outputs for each patch by running a forward pass through the model and applying optional feature sub-selection.
| modelConfig | Vector of model configurations (dimensions, patch sizes, voxel sizes, etc.). |
| fixedPoints | Central points on the fixed image where features are computed. |
| patchIndex | Indices defining the local patches around each point. |
| subsetsOfFeatures | Tensors containing indices of feature channels to select. |
| device | The device (CPU or GPU) to perform the computation on. |
| imagesPatchValuesEvaluator | Callable that evaluate image values. |
| 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 ) |
Computes feature outputs and their spatial Jacobians for image registration.
This function calculates the feature outputs and their corresponding Jacobians at given points to aid in optimization. The Jacobians are used for gradient computation during image registration.
| modelConfig | Vector of model configurations (dimensions, patch sizes, voxel sizes, etc.). |
| fixedPoints | Central points on the fixed image where features are computed. |
| patchIndex | Indices defining the local patches around each point for feature extraction. |
| subsetsOfFeatures | Tensors containing indices of feature channels to select. |
| fixedOutputsTensor | Tensor containing feature outputs from the fixed image. |
| device | The device (CPU or GPU) to perform the computation on. |
| losses | Vector of loss objects to be updated incrementally during optimization. |
| imagesPatchValuesAndJacobiansEvaluator | Callable that evaluate image values and Jacobians. |
| 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 ) |
Applies one or more models to an image to extract feature maps.
This function extracts feature maps from an image using one or more models. Optionally, it can export the resampled input image for debugging purposes.
| image | The input image from which features are extracted. |
| interpolator | The interpolator used for resampling. |
| modelsConfiguration | The configuration of the models used for feature extraction. |
| device | The device (CPU or GPU) to perform the computation on. |
| pca | The number of principal components for dimensionality reduction. |
| principalComponents | A vector to store the computed principal components. |
| writeInputImage | Optional function to export the resampled input image for debugging. |
| transformPoint | ptional function to transform a point, used for geometric transformations on the moving image. |
| std::vector< torch::Tensor > ImpactTensorUtils::GetModelOutputsExample | ( | std::vector< itk::ImpactModelConfiguration > & | modelsConfig, |
| const std::string & | modelType, | ||
| torch::Device | device ) |
Tests the configuration of each model by generating outputs from dummy input.
This function validates the compatibility of TorchScript models and checks the output structure (e.g., number of layers, spatial shape, channels). It ensures that models are properly loaded and executable during initialization.
| modelsConfig | Vector of model configurations. |
| modelType | The type of the model being tested (fixed, moving) for logging errors. |
| device | The device (CPU or GPU) to perform the computation on. |
| std::vector< std::vector< float > > ImpactTensorUtils::GetPatchIndex | ( | const itk::ImpactModelConfiguration & | modelConfiguration, |
| std::mt19937 & | randomGenerator, | ||
| unsigned int | dimension ) |
Computes patch index offsets around a center point based on model configuration.
This function generates the offsets for local patches (e.g., 5x5x5) around a center point using the model's configuration. It helps in extracting features from local neighborhoods.
| modelConfiguration | Configuration of the model, including patch size and voxel size. |
| randomGenerator | Random generator used for randomizing 2D patch slices in a 3D volume. |
| dimension | The image dimension (2D or 3D). |
| 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 ) |
Converts an ITK image to a Torch tensor using physical spacing.
| voxelSize | Target voxel size in mm, used for resampling the image. |
| transformPoint | Optional point-wise transform to apply to the moving image. |
| TFeatureImage::Pointer ImpactTensorUtils::TensorToImage | ( | typename TImage::ConstPointer | image, |
| torch::Tensor | layers ) |
Converts a tensor (C×D×H×W) to a multi-channel ITK image. Converts the given tensor to an ITK image, preserving the original image metadata (origin, spacing, direction).
| image | The original input image used to retrieve metadata. |
| layers | The tensor representing the feature layers. |
Generated on 1774142652 for elastix by 1.15.0 |