Update ParameterMap_Recommended.txt
Browse filesUpdate ParameterMap_Recommended.txt
Add mind
Update PresetDatabase.json
Add mind
Add mind
Add mind
Update ParameterMap_Mind.txt
Update PresetDatabase.json
Add mind
Add mind
Add mind
Add mind
Update ImpactReg/Uncertainty.yml
Create UncertaintyDVF
Add uncertainty
Add uncertainty
Add uncertainty
Add uncertainty
Add uncertainty
- ImpactReg/Uncertainty.yml +2 -1
- ImpactReg/UncertaintyDVF.py +15 -0
- ParameterMap_SynthRad2025_MRI_HN.txt → ParameterMap_Mind.txt +132 -138
- ParameterMap_Recommended.txt +7 -6
- PresetDatabase.json +16 -2
ImpactReg/Uncertainty.yml
CHANGED
|
@@ -12,9 +12,10 @@ Evaluator:
|
|
| 12 |
groups_dest:
|
| 13 |
Uncertainty:
|
| 14 |
transforms:
|
|
|
|
| 15 |
Variance: {}
|
| 16 |
Save:
|
| 17 |
-
dataset: ./
|
| 18 |
group: None
|
| 19 |
subset: None
|
| 20 |
dataset_filenames:
|
|
|
|
| 12 |
groups_dest:
|
| 13 |
Uncertainty:
|
| 14 |
transforms:
|
| 15 |
+
UncertaintyDVF:DVFToNorm: {}
|
| 16 |
Variance: {}
|
| 17 |
Save:
|
| 18 |
+
dataset: ./Uncertainties/ImpactReg/Output:mha
|
| 19 |
group: None
|
| 20 |
subset: None
|
| 21 |
dataset_filenames:
|
ImpactReg/UncertaintyDVF.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from konfai.data.transform import Transform
|
| 2 |
+
from konfai.utils.dataset import Attribute
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
class DVFToNorm(Transform):
|
| 6 |
+
|
| 7 |
+
def __init__(self) -> None:
|
| 8 |
+
super().__init__()
|
| 9 |
+
|
| 10 |
+
def __call__(self, name: str, tensors: torch.Tensor, cache_attribute: Attribute) -> torch.Tensor:
|
| 11 |
+
cache_attribute["Origin"] = cache_attribute.pop_np_array("Origin")[:tensors.dim()-2]
|
| 12 |
+
cache_attribute["Spacing"] = cache_attribute.pop_np_array("Spacing")[:tensors.dim()-2]
|
| 13 |
+
cache_attribute.pop("Direction")
|
| 14 |
+
cache_attribute["Direction"] = torch.eye(tensors.dim()-2).flatten()
|
| 15 |
+
return torch.linalg.norm(tensors, dim=-1)
|
ParameterMap_SynthRad2025_MRI_HN.txt → ParameterMap_Mind.txt
RENAMED
|
@@ -1,138 +1,132 @@
|
|
| 1 |
-
(MaximumNumberOfIterations
|
| 2 |
-
(NumberOfSpatialSamples
|
| 3 |
-
(Transform "RecursiveBSplineTransform")
|
| 4 |
-
(NumberOfResolutions 4)
|
| 5 |
-
(FinalGridSpacingInPhysicalUnits
|
| 6 |
-
(FixedImagePyramid "
|
| 7 |
-
(MovingImagePyramid "
|
| 8 |
-
|
| 9 |
-
(
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
(
|
| 14 |
-
(
|
| 15 |
-
(
|
| 16 |
-
(
|
| 17 |
-
(
|
| 18 |
-
(
|
| 19 |
-
|
| 20 |
-
(
|
| 21 |
-
(
|
| 22 |
-
(
|
| 23 |
-
|
| 24 |
-
(
|
| 25 |
-
(
|
| 26 |
-
(
|
| 27 |
-
(
|
| 28 |
-
(
|
| 29 |
-
(
|
| 30 |
-
|
| 31 |
-
(
|
| 32 |
-
(
|
| 33 |
-
(
|
| 34 |
-
|
| 35 |
-
(
|
| 36 |
-
(
|
| 37 |
-
(
|
| 38 |
-
(
|
| 39 |
-
(
|
| 40 |
-
(
|
| 41 |
-
|
| 42 |
-
(
|
| 43 |
-
(
|
| 44 |
-
(
|
| 45 |
-
|
| 46 |
-
(
|
| 47 |
-
(
|
| 48 |
-
(
|
| 49 |
-
(
|
| 50 |
-
(
|
| 51 |
-
(
|
| 52 |
-
|
| 53 |
-
(
|
| 54 |
-
(
|
| 55 |
-
(
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
(
|
| 60 |
-
(
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
(
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
(
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
(
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
(
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
(
|
| 82 |
-
(
|
| 83 |
-
(
|
| 84 |
-
(
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
(
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
(
|
| 92 |
-
(
|
| 93 |
-
//(
|
| 94 |
-
(
|
| 95 |
-
(
|
| 96 |
-
(
|
| 97 |
-
|
| 98 |
-
//
|
| 99 |
-
(
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
//
|
| 108 |
-
|
| 109 |
-
(
|
| 110 |
-
(
|
| 111 |
-
(
|
| 112 |
-
(
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
//
|
| 116 |
-
(
|
| 117 |
-
(
|
| 118 |
-
(
|
| 119 |
-
(
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
(
|
| 125 |
-
(
|
| 126 |
-
(
|
| 127 |
-
(
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
(
|
| 132 |
-
(
|
| 133 |
-
(BSplineInterpolationOrder 3)
|
| 134 |
-
(Resampler "DefaultResampler")
|
| 135 |
-
(WriteIterationInfo "false")
|
| 136 |
-
(WriteResultImage "false")
|
| 137 |
-
(DefaultPixelValue 0)
|
| 138 |
-
(ResultImageFormat "nii.gz")
|
|
|
|
| 1 |
+
(MaximumNumberOfIterations 300 300 300 300)
|
| 2 |
+
(NumberOfSpatialSamples 2048)
|
| 3 |
+
(Transform "RecursiveBSplineTransform")
|
| 4 |
+
(NumberOfResolutions 4)
|
| 5 |
+
(FinalGridSpacingInPhysicalUnits 16)
|
| 6 |
+
(FixedImagePyramid "FixedRecursiveImagePyramid")
|
| 7 |
+
(MovingImagePyramid "MovingRecursiveImagePyramid")
|
| 8 |
+
|
| 9 |
+
(ImpactModelsPath0 "MIND/R1D2.pt")
|
| 10 |
+
(ImpactDimension0 3 )
|
| 11 |
+
(ImpactNumberOfChannels0 1)
|
| 12 |
+
(ImpactPatchSize0 0 0 0)
|
| 13 |
+
(ImpactVoxelSize0 6 6 6)
|
| 14 |
+
(ImpactLayersMask0 "1")
|
| 15 |
+
(ImpactSubsetFeatures0 32)
|
| 16 |
+
(ImpactPCA0 0)
|
| 17 |
+
(ImpactDistance0 "L1")
|
| 18 |
+
(ImpactLayersWeight0 1)
|
| 19 |
+
|
| 20 |
+
(ImpactModelsPath1 "MIND/R1D2.pt")
|
| 21 |
+
(ImpactDimension1 3)
|
| 22 |
+
(ImpactNumberOfChannels1 1)
|
| 23 |
+
(ImpactPatchSize1 0 0 0)
|
| 24 |
+
(ImpactVoxelSize1 3 3 3)
|
| 25 |
+
(ImpactLayersMask1 "1")
|
| 26 |
+
(ImpactSubsetFeatures1 32)
|
| 27 |
+
(ImpactPCA1 0)
|
| 28 |
+
(ImpactDistance1 "L1")
|
| 29 |
+
(ImpactLayersWeight1 1)
|
| 30 |
+
|
| 31 |
+
(ImpactModelsPath2 "MIND/R1D2.pt")
|
| 32 |
+
(ImpactDimension2 3)
|
| 33 |
+
(ImpactNumberOfChannels2 1)
|
| 34 |
+
(ImpactPatchSize2 0 0 0)
|
| 35 |
+
(ImpactVoxelSize2 1.5 1.5 1.5)
|
| 36 |
+
(ImpactLayersMask2 "1")
|
| 37 |
+
(ImpactSubsetFeatures2 32)
|
| 38 |
+
(ImpactPCA2 0)
|
| 39 |
+
(ImpactDistance2 "L1")
|
| 40 |
+
(ImpactLayersWeight2 1)
|
| 41 |
+
|
| 42 |
+
(ImpactModelsPath3 "MIND/R1D2.pt")
|
| 43 |
+
(ImpactDimension3 3)
|
| 44 |
+
(ImpactNumberOfChannels3 1)
|
| 45 |
+
(ImpactPatchSize3 0 0 0)
|
| 46 |
+
(ImpactVoxelSize3 1 1 1)
|
| 47 |
+
(ImpactLayersMask3 "1")
|
| 48 |
+
(ImpactSubsetFeatures3 32)
|
| 49 |
+
(ImpactPCA3 0)
|
| 50 |
+
(ImpactDistance3 "L1")
|
| 51 |
+
(ImpactLayersWeight3 1)
|
| 52 |
+
|
| 53 |
+
(ImpactUseMixedPrecision "true")
|
| 54 |
+
(ImpactFeaturesMapUpdateInterval -1)
|
| 55 |
+
(ImpactWriteFeatureMaps "./Features/")
|
| 56 |
+
(ImpactMode "Static")
|
| 57 |
+
(ImpactGPU 0)
|
| 58 |
+
|
| 59 |
+
(Metric "Impact")
|
| 60 |
+
(Metric0Weight 1)
|
| 61 |
+
|
| 62 |
+
// imageTypes
|
| 63 |
+
(FixedInternalImagePixelType "float")
|
| 64 |
+
(MovingInternalImagePixelType "float")
|
| 65 |
+
(UseDirectionCosines "true")
|
| 66 |
+
|
| 67 |
+
// components
|
| 68 |
+
(Registration "MultiMetricMultiResolutionRegistration")
|
| 69 |
+
(BSplineTransformSplineOrder 3)
|
| 70 |
+
(UseCyclicTransform "false")
|
| 71 |
+
|
| 72 |
+
// transform
|
| 73 |
+
(AutomaticTransformInitialization "false")
|
| 74 |
+
(AutomaticTransformInitializationMethod "GeometricalCenter")
|
| 75 |
+
(AutomaticScalesEstimation "true")
|
| 76 |
+
(HowToCombineTransforms "Compose")
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
// optimizer
|
| 80 |
+
(Optimizer "AdaptiveStochasticGradientDescent")
|
| 81 |
+
(MaximumNumberOfSamplingAttempts 8)
|
| 82 |
+
(UseAdaptiveStepSizes "true")
|
| 83 |
+
(UseMultiThreadingForMetrics "true")
|
| 84 |
+
(ASGDParameterEstimationMethod "DisplacementDistribution")
|
| 85 |
+
//(MaximumStepLength 0.6602)
|
| 86 |
+
(SigmoidInitialTime 0.0)
|
| 87 |
+
(NoiseCompensation "true")
|
| 88 |
+
(NumberOfSamplesForExactGradient 4096)
|
| 89 |
+
|
| 90 |
+
// automatic
|
| 91 |
+
(AutomaticParameterEstimation "true")
|
| 92 |
+
//(SP_alpha 1)
|
| 93 |
+
//(SP_A 20.0)
|
| 94 |
+
//(SP a 400)
|
| 95 |
+
//(SigmoidMax 1.0)
|
| 96 |
+
//(SigmoidMin -0.8)
|
| 97 |
+
//(SigmoidScale 0.00000001)
|
| 98 |
+
//(NumberOfGradientMeasurements 10)
|
| 99 |
+
//(NumberOfJacobianMeasurements 1000)
|
| 100 |
+
|
| 101 |
+
(FixedKernelBSplineOrder 3)
|
| 102 |
+
(MovingKernelBSplineOrder 3)
|
| 103 |
+
(CheckNumberOfSamples "true")
|
| 104 |
+
(UseRelativeWeights "false")
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
// several
|
| 108 |
+
(WriteTransformParametersEachIteration "false")
|
| 109 |
+
(WriteTransformParametersEachResolution "false")
|
| 110 |
+
(ShowExactMetricValue "false")
|
| 111 |
+
(ErodeFixedMask "false")
|
| 112 |
+
(ErodeMovingMask "false")
|
| 113 |
+
(UseBinaryFormatForTransformationParameters "false")
|
| 114 |
+
|
| 115 |
+
// imageSampler
|
| 116 |
+
(Interpolator "BSplineInterpolator")
|
| 117 |
+
(ImageSampler "RandomCoordinate")
|
| 118 |
+
(NewSamplesEveryIteration "true")
|
| 119 |
+
(UseRandomSampleRegion "false")
|
| 120 |
+
|
| 121 |
+
// interpolator and resampler
|
| 122 |
+
(ResampleInterpolator "FinalBSplineInterpolator")
|
| 123 |
+
(FinalBSplineInterpolationOrder 3)
|
| 124 |
+
(BSplineInterpolationOrder 3)
|
| 125 |
+
(Resampler "DefaultResampler")
|
| 126 |
+
(WriteIterationInfo "false")
|
| 127 |
+
(WriteResultImage "false")
|
| 128 |
+
(DefaultPixelValue -1024)
|
| 129 |
+
(ResultImageFormat "mha")
|
| 130 |
+
|
| 131 |
+
(ITKTransformOutputFileNameExtension "itk.txt")
|
| 132 |
+
(WriteITKCompositeTransform "true")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ParameterMap_Recommended.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
(Metric "Impact")
|
| 3 |
(Metric0Weight 1)
|
| 4 |
|
| 5 |
-
(ImpactModelsPath0 "
|
| 6 |
(ImpactDimension0 3)
|
| 7 |
(ImpactNumberOfChannels0 1)
|
| 8 |
(ImpactPatchSize0 11 11 11)
|
|
@@ -13,7 +13,7 @@
|
|
| 13 |
(ImpactDistance0 "L2")
|
| 14 |
(ImpactLayersWeight0 1)
|
| 15 |
|
| 16 |
-
(ImpactModelsPath1 "
|
| 17 |
(ImpactDimension1 3)
|
| 18 |
(ImpactNumberOfChannels1 1)
|
| 19 |
(ImpactPatchSize1 11 11 11)
|
|
@@ -24,7 +24,7 @@
|
|
| 24 |
(ImpactDistance1 "L2")
|
| 25 |
(ImpactLayersWeight1 1)
|
| 26 |
|
| 27 |
-
(ImpactModelsPath2 "
|
| 28 |
(ImpactDimension2 3)
|
| 29 |
(ImpactNumberOfChannels2 1)
|
| 30 |
(ImpactPatchSize2 11 11 11)
|
|
@@ -35,7 +35,7 @@
|
|
| 35 |
(ImpactDistance2 "L2")
|
| 36 |
(ImpactLayersWeight2 1)
|
| 37 |
|
| 38 |
-
(ImpactModelsPath3 "
|
| 39 |
(ImpactDimension3 3)
|
| 40 |
(ImpactNumberOfChannels3 1)
|
| 41 |
(ImpactPatchSize3 11 11 11)
|
|
@@ -56,7 +56,7 @@
|
|
| 56 |
(NumberOfSpatialSamples 2000)
|
| 57 |
(Transform "RecursiveBSplineTransform")
|
| 58 |
(NumberOfResolutions 4)
|
| 59 |
-
(FinalGridSpacingInPhysicalUnits
|
| 60 |
(FixedImagePyramid "FixedSmoothingImagePyramid")
|
| 61 |
(MovingImagePyramid "MovingSmoothingImagePyramid")
|
| 62 |
(GridSpacingSchedule 10.000000 5.000000 2.000000 1.000000)
|
|
@@ -130,4 +130,5 @@
|
|
| 130 |
(DefaultPixelValue -1024)
|
| 131 |
(ResultImageFormat "mha")
|
| 132 |
|
| 133 |
-
(ITKTransformOutputFileNameExtension "itk.txt")
|
|
|
|
|
|
| 2 |
(Metric "Impact")
|
| 3 |
(Metric0Weight 1)
|
| 4 |
|
| 5 |
+
(ImpactModelsPath0 "TS/M730_2_Layers.pt")
|
| 6 |
(ImpactDimension0 3)
|
| 7 |
(ImpactNumberOfChannels0 1)
|
| 8 |
(ImpactPatchSize0 11 11 11)
|
|
|
|
| 13 |
(ImpactDistance0 "L2")
|
| 14 |
(ImpactLayersWeight0 1)
|
| 15 |
|
| 16 |
+
(ImpactModelsPath1 "TS/M730_2_Layers.pt")
|
| 17 |
(ImpactDimension1 3)
|
| 18 |
(ImpactNumberOfChannels1 1)
|
| 19 |
(ImpactPatchSize1 11 11 11)
|
|
|
|
| 24 |
(ImpactDistance1 "L2")
|
| 25 |
(ImpactLayersWeight1 1)
|
| 26 |
|
| 27 |
+
(ImpactModelsPath2 "TS/M730_2_Layers.pt")
|
| 28 |
(ImpactDimension2 3)
|
| 29 |
(ImpactNumberOfChannels2 1)
|
| 30 |
(ImpactPatchSize2 11 11 11)
|
|
|
|
| 35 |
(ImpactDistance2 "L2")
|
| 36 |
(ImpactLayersWeight2 1)
|
| 37 |
|
| 38 |
+
(ImpactModelsPath3 "TS/M730_2_Layers.pt")
|
| 39 |
(ImpactDimension3 3)
|
| 40 |
(ImpactNumberOfChannels3 1)
|
| 41 |
(ImpactPatchSize3 11 11 11)
|
|
|
|
| 56 |
(NumberOfSpatialSamples 2000)
|
| 57 |
(Transform "RecursiveBSplineTransform")
|
| 58 |
(NumberOfResolutions 4)
|
| 59 |
+
(FinalGridSpacingInPhysicalUnits 10)
|
| 60 |
(FixedImagePyramid "FixedSmoothingImagePyramid")
|
| 61 |
(MovingImagePyramid "MovingSmoothingImagePyramid")
|
| 62 |
(GridSpacingSchedule 10.000000 5.000000 2.000000 1.000000)
|
|
|
|
| 130 |
(DefaultPixelValue -1024)
|
| 131 |
(ResultImageFormat "mha")
|
| 132 |
|
| 133 |
+
(ITKTransformOutputFileNameExtension "itk.txt")
|
| 134 |
+
(WriteITKCompositeTransform "true")
|
PresetDatabase.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
| 24 |
"description": "This preset performs rigid alignment using an Euler transform optimized with Adaptive Stochastic Gradient Descent. It uses a 4-level multi-resolution strategy and Mattes mutual information as similarity metric. Initial alignment based on image centers are enabled to ensure robust convergence for multimodal images."
|
| 25 |
},
|
| 26 |
{
|
| 27 |
-
"display_name": "IMPACT BSpline M730",
|
| 28 |
"parameter_maps": [
|
| 29 |
"ParameterMap_Recommended.txt"
|
| 30 |
],
|
|
@@ -34,7 +34,21 @@
|
|
| 34 |
"preprocess_function": "Preprocess:standardize_MRI",
|
| 35 |
"iterations": 1900,
|
| 36 |
"short_description": "IMPACT-based multimodal BSpline registration with deep semantic features (M730)",
|
| 37 |
-
"description": "A deformable BSpline registration using the IMPACT metric to align semantic features extracted from pretrained models (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
|
|
|
| 39 |
]
|
| 40 |
}
|
|
|
|
| 24 |
"description": "This preset performs rigid alignment using an Euler transform optimized with Adaptive Stochastic Gradient Descent. It uses a 4-level multi-resolution strategy and Mattes mutual information as similarity metric. Initial alignment based on image centers are enabled to ensure robust convergence for multimodal images."
|
| 25 |
},
|
| 26 |
{
|
| 27 |
+
"display_name": "IMPACT BSpline jacobian M730",
|
| 28 |
"parameter_maps": [
|
| 29 |
"ParameterMap_Recommended.txt"
|
| 30 |
],
|
|
|
|
| 34 |
"preprocess_function": "Preprocess:standardize_MRI",
|
| 35 |
"iterations": 1900,
|
| 36 |
"short_description": "IMPACT-based multimodal BSpline registration with deep semantic features (M730)",
|
| 37 |
+
"description": "A deformable BSpline registration using the IMPACT metric to align semantic features extracted from pretrained models (M730). The method uses 4 resolution levels."
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"display_name": "IMPACT MIND",
|
| 41 |
+
"parameter_maps": [
|
| 42 |
+
"ParameterMap_Mind.txt"
|
| 43 |
+
],
|
| 44 |
+
"models": [
|
| 45 |
+
"VBoussot/impact-torchscript-models:MIND/R1D2.pt"
|
| 46 |
+
],
|
| 47 |
+
"preprocess_function": "Preprocess:standardize_MRI",
|
| 48 |
+
"iterations": 900,
|
| 49 |
+
"short_description": "IMPACT-based multimodal BSpline registration with MIND",
|
| 50 |
+
"description": "A deformable BSpline registration using the IMPACT metric to align semantic features extracted from pretrained models MIND. The method uses 4 resolution levels."
|
| 51 |
}
|
| 52 |
+
|
| 53 |
]
|
| 54 |
}
|