├── CMakeLists.txt ├── CTestConfig.cmake ├── Doc └── SlicerElastix.drawio ├── Elastix ├── CMakeLists.txt ├── Elastix.py ├── ElastixLib │ ├── ElastixPresetSubjectHierarchyPlugin.py │ ├── __init__.py │ ├── database.py │ ├── manager.py │ ├── preset.py │ └── utils.py ├── Resources │ ├── Icons │ │ └── Elastix.png │ ├── RegistrationParameters │ │ ├── Bsplines_parameter-file.txt │ │ ├── Deformable.txt │ │ ├── ElastixParameterSetDatabase.xml │ │ ├── Par0000affine.txt │ │ ├── Par0000bspline.txt │ │ ├── Par0001affine.txt │ │ ├── Par0001bspline04.txt │ │ ├── Par0001bspline08.txt │ │ ├── Par0001bspline16.txt │ │ ├── Par0001bspline32.txt │ │ ├── Par0001bspline64.txt │ │ ├── Par0001rigid.txt │ │ ├── Par0001translation.txt │ │ ├── Par0002.fs.MI.rigid.Full.txt │ │ ├── Par0002.fs.MI.rigid.Random.txt │ │ ├── Par0002.fs.MI.rigid.RandomCoordinate.txt │ │ ├── Par0003.affine.txt │ │ ├── Par0003.bs-R1-fg.txt │ │ ├── Par0003.bs-R1-ug.txt │ │ ├── Par0003.bs-R2-fg.txt │ │ ├── Par0003.bs-R2-ug.txt │ │ ├── Par0003.bs-R3-fg.txt │ │ ├── Par0003.bs-R3-ug.txt │ │ ├── Par0003.bs-R4-fg.txt │ │ ├── Par0003.bs-R4-ug.txt │ │ ├── Par0003.bs-R5-fg.txt │ │ ├── Par0003.bs-R5-ug.txt │ │ ├── Par0003.bs-R6-fg.txt │ │ ├── Par0003.bs-R6-ug.txt │ │ ├── Par0003.bs-R7-fg.txt │ │ ├── Par0003.bs-R7-ug.txt │ │ ├── Par0003.bs-R8-fg.txt │ │ ├── Par0003.bs-R8-ug.txt │ │ ├── Par0010affine.txt │ │ ├── Par0010bspline.txt │ │ ├── Par0013Powell_NGC_singleImage.txt │ │ ├── Par0017_cartilage_RigidLMI.txt │ │ ├── Par0018_2D_rigid_MI.txt │ │ ├── Par0018_2D_translation_MI.txt │ │ ├── Par0018_3D_affine_MI.txt │ │ ├── Par0018_3D_bspline_MI_15.txt │ │ ├── Par0018_3D_rigid_MI.txt │ │ ├── Par0020affine.txt │ │ ├── Par0020bspline1.txt │ │ ├── Par0020bspline2.txt │ │ ├── Par0020bspline3.txt │ │ ├── Par0020rigid.txt │ │ ├── Par0025affine.txt │ │ ├── Par0025bspline.txt │ │ ├── Par0025rigid.txt │ │ ├── Par0026affine.txt │ │ ├── Par0026bspline.txt │ │ ├── Par0026rigid.txt │ │ ├── Par0032_bsplines.txt │ │ ├── Par0032_rigid.txt │ │ ├── Par0033bspline.txt │ │ ├── Par0033rigid.txt │ │ ├── Par0033similarity.txt │ │ ├── Par0034affine.txt │ │ ├── Par0034bspline.txt │ │ ├── Par0034rigid.txt │ │ ├── Par0040affine.txt │ │ ├── Par0041bspline.txt │ │ ├── Par0041similarity.txt │ │ ├── Par0042bspline.txt │ │ ├── Par0042rigid.txt │ │ ├── Par0043rigid.txt │ │ ├── Par0044Affine.txt │ │ ├── Par0044NonRigid.txt │ │ ├── Parameters.MI.Coarse.Bspline_tuned.txt │ │ ├── Parameters.MI.Fine.Bspline_tuned.txt │ │ ├── Parameters.MI.RP.Bspline_tuned.txt │ │ ├── Parameters.NCC.txt │ │ ├── Parameters.NCC_EDM.txt │ │ ├── Parameters.Par0008.affine.txt │ │ ├── Parameters.Par0008.elastic.txt │ │ ├── Parameters.Par0009.affine.txt │ │ ├── Parameters.Par0009.elastic.txt │ │ ├── Parameters.Par0011.affine.txt │ │ ├── Parameters.Par0011.bspline1.txt │ │ ├── Parameters.Par0011.bspline1_s.txt │ │ ├── Parameters.Par0011.bspline2.txt │ │ ├── Parameters.Par0011.bspline2_s.txt │ │ ├── Parameters.Par0015.expA.patient.LNC.bspline.txt │ │ ├── Parameters.Par0015.expA.patient.NC.affine.txt │ │ ├── Parameters.Par0015.expA.patient.NC.bspline.txt │ │ ├── Parameters.Par0015.expB.phantom.NC_EDM.affine.txt │ │ ├── Parameters.Par0015.expB.phantom.NC_EDM.bspline.txt │ │ ├── Parameters.Par0015.expC.phantom.NC.affine.txt │ │ ├── Parameters.Par0015.expC.phantom.NC.bspline.txt │ │ ├── Parameters.Par0015.expD.phantom.NC.rigid.txt │ │ ├── Parameters.similarity.txt │ │ ├── Parameters0030_Affine.txt │ │ ├── Parameters0030_Bspline.txt │ │ ├── Parameters0030_Euler.txt │ │ ├── Parameters_Affine.txt │ │ ├── Parameters_BSpline.txt │ │ ├── Parameters_BSplineNCC.txt │ │ ├── Parameters_Rigid.txt │ │ ├── Parameters_RigidAMS.txt │ │ ├── Parameters_Translation.txt │ │ ├── Rigid.txt │ │ └── Rigid_parameter-file.txt │ └── UI │ │ ├── Elastix.ui │ │ └── PresetManager.ui └── Testing │ ├── CMakeLists.txt │ └── Python │ └── CMakeLists.txt ├── LICENSE ├── README.md ├── Screenshot01.jpg ├── SlicerElastix.png ├── SlicerElastix.xcf ├── SuperBuild.cmake └── SuperBuild └── External_elastix.cmake /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | project(SlicerElastix) 4 | 5 | #----------------------------------------------------------------------------- 6 | # Extension meta-information 7 | set(EXTENSION_HOMEPAGE "https://github.com/lassoan/SlicerElastix") 8 | set(EXTENSION_CATEGORY "Registration") 9 | set(EXTENSION_CONTRIBUTORS "Andras Lasso (PerkLab, Queen's University)") 10 | set(EXTENSION_DESCRIPTION "This extension makes available Elastix medical image registration toolbox (https://elastix.dev) available in Slicer.") 11 | set(EXTENSION_ICONURL "https://raw.githubusercontent.com/lassoan/SlicerElastix/master/SlicerElastix.png") 12 | set(EXTENSION_SCREENSHOTURLS "https://raw.githubusercontent.com/lassoan/SlicerElastix/master/Screenshot01.jpg") 13 | set(EXTENSION_DEPENDS "NA") # Specified as a space separated string, a list or 'NA' if any 14 | set(EXTENSION_BUILD_SUBDIRECTORY inner-build) 15 | 16 | set(SUPERBUILD_TOPLEVEL_PROJECT inner) 17 | 18 | #----------------------------------------------------------------------------- 19 | # Extension dependencies 20 | find_package(Slicer REQUIRED) 21 | include(${Slicer_USE_FILE}) 22 | mark_as_superbuild(Slicer_DIR) 23 | 24 | find_package(Git REQUIRED) 25 | mark_as_superbuild(GIT_EXECUTABLE) 26 | 27 | #----------------------------------------------------------------------------- 28 | # SuperBuild setup 29 | option(${EXTENSION_NAME}_SUPERBUILD "Build ${EXTENSION_NAME} and the projects it depends on." ON) 30 | mark_as_advanced(${EXTENSION_NAME}_SUPERBUILD) 31 | if(${EXTENSION_NAME}_SUPERBUILD) 32 | include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake") 33 | return() 34 | endif() 35 | 36 | #----------------------------------------------------------------------------- 37 | # Extension modules 38 | add_subdirectory(Elastix) 39 | ## NEXT_MODULE 40 | 41 | #----------------------------------------------------------------------------- 42 | # Install directory, install project name, install component, and install subdirectory. 43 | set(EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS) 44 | list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS "${elastix_DIR};elastix;Executables;/") 45 | set(${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS "${EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS}" CACHE STRING "List of external projects to install" FORCE) 46 | 47 | #----------------------------------------------------------------------------- 48 | list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/") 49 | list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS}") 50 | include(${Slicer_EXTENSION_GENERATE_CONFIG}) 51 | include(${Slicer_EXTENSION_CPACK}) 52 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | set(CTEST_PROJECT_NAME "SlicerElastix") 2 | set(CTEST_NIGHTLY_START_TIME "3:00:00 UTC") 3 | 4 | set(CTEST_DROP_METHOD "http") 5 | set(CTEST_DROP_SITE "slicer.cdash.org") 6 | set(CTEST_DROP_LOCATION "/submit.php?project=Slicer4") 7 | set(CTEST_DROP_SITE_CDASH TRUE) 8 | -------------------------------------------------------------------------------- /Elastix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------------------------- 2 | set(MODULE_NAME Elastix) 3 | 4 | #----------------------------------------------------------------------------- 5 | set(MODULE_PYTHON_SCRIPTS 6 | ${MODULE_NAME}.py 7 | ElastixLib/__init__ 8 | ElastixLib/utils.py 9 | ElastixLib/database.py 10 | ElastixLib/preset.py 11 | ElastixLib/manager.py 12 | ElastixLib/ElastixPresetSubjectHierarchyPlugin.py 13 | ) 14 | 15 | set(MODULE_PYTHON_RESOURCES 16 | Resources/Icons/${MODULE_NAME}.png 17 | Resources/UI/${MODULE_NAME}.ui 18 | Resources/UI/PresetManager.ui 19 | ) 20 | 21 | set(REGISTRATION_PARAMETER_FILES 22 | ElastixParameterSetDatabase.xml 23 | Bsplines_parameter-file.txt 24 | Deformable.txt 25 | Par0000affine.txt 26 | Par0000bspline.txt 27 | Par0001affine.txt 28 | Par0001bspline04.txt 29 | Par0001bspline08.txt 30 | Par0001bspline16.txt 31 | Par0001bspline32.txt 32 | Par0001bspline64.txt 33 | Par0001rigid.txt 34 | Par0001translation.txt 35 | Par0002.fs.MI.rigid.Full.txt 36 | Par0002.fs.MI.rigid.Random.txt 37 | Par0002.fs.MI.rigid.RandomCoordinate.txt 38 | Par0003.affine.txt 39 | Par0003.bs-R1-fg.txt 40 | Par0003.bs-R1-ug.txt 41 | Par0003.bs-R2-fg.txt 42 | Par0003.bs-R2-ug.txt 43 | Par0003.bs-R3-fg.txt 44 | Par0003.bs-R3-ug.txt 45 | Par0003.bs-R4-fg.txt 46 | Par0003.bs-R4-ug.txt 47 | Par0003.bs-R5-fg.txt 48 | Par0003.bs-R5-ug.txt 49 | Par0003.bs-R6-fg.txt 50 | Par0003.bs-R6-ug.txt 51 | Par0003.bs-R7-fg.txt 52 | Par0003.bs-R7-ug.txt 53 | Par0003.bs-R8-fg.txt 54 | Par0003.bs-R8-ug.txt 55 | Par0010affine.txt 56 | Par0010bspline.txt 57 | Par0013Powell_NGC_singleImage.txt 58 | Par0017_cartilage_RigidLMI.txt 59 | Par0018_2D_rigid_MI.txt 60 | Par0018_2D_translation_MI.txt 61 | Par0018_3D_affine_MI.txt 62 | Par0018_3D_bspline_MI_15.txt 63 | Par0018_3D_rigid_MI.txt 64 | Par0020affine.txt 65 | Par0020bspline1.txt 66 | Par0020bspline2.txt 67 | Par0020bspline3.txt 68 | Par0020rigid.txt 69 | Par0025affine.txt 70 | Par0025bspline.txt 71 | Par0025rigid.txt 72 | Par0026affine.txt 73 | Par0026bspline.txt 74 | Par0026rigid.txt 75 | Par0032_bsplines.txt 76 | Par0032_rigid.txt 77 | Par0033bspline.txt 78 | Par0033rigid.txt 79 | Par0033similarity.txt 80 | Par0034affine.txt 81 | Par0034bspline.txt 82 | Par0034rigid.txt 83 | Par0040affine.txt 84 | Par0041bspline.txt 85 | Par0041similarity.txt 86 | Par0042bspline.txt 87 | Par0042rigid.txt 88 | Par0043rigid.txt 89 | Par0044Affine.txt 90 | Par0044NonRigid.txt 91 | Parameters.MI.Coarse.Bspline_tuned.txt 92 | Parameters.MI.Fine.Bspline_tuned.txt 93 | Parameters.MI.RP.Bspline_tuned.txt 94 | Parameters.NCC.txt 95 | Parameters.NCC_EDM.txt 96 | Parameters.Par0008.affine.txt 97 | Parameters.Par0008.elastic.txt 98 | Parameters.Par0009.affine.txt 99 | Parameters.Par0009.elastic.txt 100 | Parameters.Par0011.affine.txt 101 | Parameters.Par0011.bspline1.txt 102 | Parameters.Par0011.bspline1_s.txt 103 | Parameters.Par0011.bspline2.txt 104 | Parameters.Par0011.bspline2_s.txt 105 | Parameters.Par0015.expA.patient.LNC.bspline.txt 106 | Parameters.Par0015.expA.patient.NC.affine.txt 107 | Parameters.Par0015.expA.patient.NC.bspline.txt 108 | Parameters.Par0015.expB.phantom.NC_EDM.affine.txt 109 | Parameters.Par0015.expB.phantom.NC_EDM.bspline.txt 110 | Parameters.Par0015.expC.phantom.NC.affine.txt 111 | Parameters.Par0015.expC.phantom.NC.bspline.txt 112 | Parameters.Par0015.expD.phantom.NC.rigid.txt 113 | Parameters.similarity.txt 114 | Parameters0030_Affine.txt 115 | Parameters0030_Bspline.txt 116 | Parameters0030_Euler.txt 117 | Parameters_Affine.txt 118 | Parameters_BSpline.txt 119 | Parameters_BSplineNCC.txt 120 | Parameters_Rigid.txt 121 | Parameters_RigidAMS.txt 122 | Parameters_Translation.txt 123 | Rigid.txt 124 | Rigid_parameter-file.txt 125 | ) 126 | 127 | foreach (paramfile ${REGISTRATION_PARAMETER_FILES}) 128 | set(MODULE_PYTHON_RESOURCES ${MODULE_PYTHON_RESOURCES} "Resources/RegistrationParameters/${paramfile}") 129 | endforeach() 130 | 131 | #----------------------------------------------------------------------------- 132 | slicerMacroBuildScriptedModule( 133 | NAME ${MODULE_NAME} 134 | SCRIPTS ${MODULE_PYTHON_SCRIPTS} 135 | RESOURCES ${MODULE_PYTHON_RESOURCES} 136 | WITH_GENERIC_TESTS 137 | ) 138 | 139 | #----------------------------------------------------------------------------- 140 | if(BUILD_TESTING) 141 | # Register the unittest subclass in the main script as a ctest. 142 | # Note that the test will also be available at runtime. 143 | slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py) 144 | 145 | # Additional build-time testing 146 | add_subdirectory(Testing) 147 | endif() 148 | -------------------------------------------------------------------------------- /Elastix/ElastixLib/ElastixPresetSubjectHierarchyPlugin.py: -------------------------------------------------------------------------------- 1 | import qt, ctk, slicer 2 | from AbstractScriptedSubjectHierarchyPlugin import * 3 | 4 | 5 | class ElastixPresetSubjectHierarchyPlugin(AbstractScriptedSubjectHierarchyPlugin): 6 | 7 | # Necessary static member to be able to set python source to scripted subject hierarchy plugin 8 | filePath = __file__ 9 | 10 | def __init__(self, scriptedPlugin): 11 | scriptedPlugin.name = 'Elastix' 12 | AbstractScriptedSubjectHierarchyPlugin.__init__(self, scriptedPlugin) 13 | 14 | def canAddNodeToSubjectHierarchy(self, node, parentItemID = None): 15 | if node is not None and node.IsA("vtkMRMLScriptedModuleNode"): 16 | if node.GetAttribute("Type") == "ElastixPreset": 17 | return 0.9 18 | return 0.0 19 | 20 | def canOwnSubjectHierarchyItem(self, itemID): 21 | pluginHandlerSingleton = slicer.qSlicerSubjectHierarchyPluginHandler.instance() 22 | shNode = pluginHandlerSingleton.subjectHierarchyNode() 23 | associatedNode = shNode.GetItemDataNode(itemID) 24 | return self.canAddNodeToSubjectHierarchy(associatedNode) 25 | 26 | def roleForPlugin(self): 27 | return "ElastixPreset" 28 | 29 | def icon(self, itemID): 30 | import os 31 | iconPath = None 32 | pluginHandlerSingleton = slicer.qSlicerSubjectHierarchyPluginHandler.instance() 33 | shNode = pluginHandlerSingleton.subjectHierarchyNode() 34 | associatedNode = shNode.GetItemDataNode(itemID) 35 | if associatedNode is not None and associatedNode.IsA("vtkMRMLScriptedModuleNode"): 36 | if associatedNode.GetAttribute("Type") == "ElastixPreset": 37 | iconPath = os.path.join(os.path.dirname(__file__), '../Resources/Icons/Elastix.png') 38 | if iconPath and os.path.exists(iconPath): 39 | return qt.QIcon(iconPath) 40 | # Item unknown by plugin 41 | return qt.QIcon() 42 | 43 | def tooltip(self, itemID): 44 | return "Elastix preset" -------------------------------------------------------------------------------- /Elastix/ElastixLib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lassoan/SlicerElastix/9ec57ae3b4baa613fe03e4af756a8d00ed6ff638/Elastix/ElastixLib/__init__.py -------------------------------------------------------------------------------- /Elastix/ElastixLib/database.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import shutil 3 | 4 | import qt 5 | import vtk 6 | 7 | import abc 8 | import os 9 | 10 | from typing import Callable 11 | 12 | import slicer 13 | from pathlib import Path 14 | from ElastixLib.preset import Preset, UserPreset, createPreset 15 | 16 | 17 | class ElastixDatabase(abc.ABC): 18 | 19 | @property 20 | def logCallback(self): 21 | return self._logCallback 22 | 23 | @logCallback.setter 24 | def logCallback(self, cb: Callable = None): 25 | self._logCallback = cb 26 | 27 | def getRegistrationPresetsFromXML(self, elastixParameterSetDatabasePath, presetClass): 28 | if not os.path.isfile(elastixParameterSetDatabasePath): 29 | raise ValueError("Failed to open parameter set database: " + elastixParameterSetDatabasePath) 30 | elastixParameterSetDatabaseXml = vtk.vtkXMLUtilities.ReadElementFromFile(elastixParameterSetDatabasePath) 31 | 32 | # Create python list from XML for convenience 33 | registrationPresets = [] 34 | if elastixParameterSetDatabaseXml is not None: 35 | for parameterSetIndex in range(elastixParameterSetDatabaseXml.GetNumberOfNestedElements()): 36 | parameterSetXml = elastixParameterSetDatabaseXml.GetNestedElement(parameterSetIndex) 37 | parameterFilesXml = parameterSetXml.FindNestedElementWithName('ParameterFiles') 38 | parameterFiles = [] 39 | for parameterFileIndex in range(parameterFilesXml.GetNumberOfNestedElements()): 40 | parameterFiles.append(os.path.join( 41 | str(Path(elastixParameterSetDatabasePath).parent), 42 | parameterFilesXml.GetNestedElement(parameterFileIndex).GetAttribute('Name')) 43 | ) 44 | parameterSetAttributes = \ 45 | [parameterSetXml.GetAttribute(attr) if parameterSetXml.GetAttribute(attr) is not None else "" for attr in ['id', 'modality', 'content', 'description', 'publications']] 46 | try: 47 | registrationPresets.append( 48 | createPreset(*parameterSetAttributes, parameterFiles=parameterFiles, presetClass=presetClass) 49 | ) 50 | except FileNotFoundError as exc: 51 | msg = f"Cannot load preset. Loading failed with error: {exc}" 52 | logging.error(msg) 53 | if self.logCallback: 54 | self.logCallback(msg) 55 | continue 56 | return registrationPresets 57 | 58 | def __init__(self): 59 | self._logCallback = None 60 | self.registrationPresets = None 61 | 62 | def getRegistrationPresets(self, force_refresh=False): 63 | if self.registrationPresets and not force_refresh: 64 | return self.registrationPresets 65 | 66 | self.registrationPresets = self._getRegistrationPresets() 67 | 68 | return self.registrationPresets 69 | 70 | @abc.abstractmethod 71 | def _getRegistrationPresets(self): 72 | pass 73 | 74 | 75 | class BuiltinElastixDatabase(ElastixDatabase): 76 | 77 | # load txt files into slicer scene 78 | DATABASE_FILE = os.path.abspath( 79 | os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'Resources', 'RegistrationParameters', 80 | 'ElastixParameterSetDatabase.xml')) 81 | 82 | def getPresetsDir(self): 83 | return str(Path(self.DATABASE_FILE).parent) 84 | 85 | def _getRegistrationPresets(self): 86 | return self.getRegistrationPresetsFromXML(self.DATABASE_FILE, presetClass=Preset) 87 | 88 | 89 | class UserElastixDataBase(ElastixDatabase): 90 | 91 | DATABASE_LOCATION = Path(slicer.app.slicerUserSettingsFilePath).parent / "Elastix" 92 | 93 | @staticmethod 94 | def getAllXMLFiles(directory): 95 | import fnmatch 96 | files = [] 97 | for root, dirnames, filenames in os.walk(directory): 98 | for filename in fnmatch.filter(filenames, '*{}'.format(".xml")): 99 | files.append(os.path.join(root, filename)) 100 | return files 101 | 102 | def __init__(self): 103 | self.DATABASE_LOCATION.mkdir(exist_ok=True) 104 | self._presetLocations = {} 105 | super().__init__() 106 | 107 | def getPresetsDir(self): 108 | return str(self.DATABASE_LOCATION) 109 | 110 | def _getRegistrationPresets(self): 111 | xml_files = self.getAllXMLFiles(self.DATABASE_LOCATION) 112 | registrationPresets = [] 113 | for xml_file in xml_files: 114 | presets = self.getRegistrationPresetsFromXML(xml_file, presetClass=UserPreset) 115 | if len(presets) > 1: 116 | raise RuntimeError("The User presets are intended to have one preset per .xml file only.") 117 | for preset in presets: 118 | self._presetLocations[preset] = str(Path(xml_file).parent) 119 | registrationPresets.extend(presets) 120 | return registrationPresets 121 | 122 | def deletePreset(self, preset: UserPreset): 123 | path = self._presetLocations.pop(preset) 124 | shutil.rmtree(path) 125 | 126 | 127 | class InSceneElastixDatabase(ElastixDatabase): 128 | 129 | def _getRegistrationPresets(self): 130 | registrationPresets = [] 131 | 132 | nodes = filter(lambda n: n.GetAttribute('Type') == 'ElastixPreset', 133 | slicer.util.getNodesByClass('vtkMRMLTextNode')) 134 | 135 | from ElastixLib.preset import getInScenePreset 136 | for node in nodes: 137 | registrationPresets.append(getInScenePreset(node)) 138 | 139 | return registrationPresets 140 | -------------------------------------------------------------------------------- /Elastix/ElastixLib/utils.py: -------------------------------------------------------------------------------- 1 | import slicer 2 | import qt 3 | 4 | 5 | def showFolder(path): 6 | qt.QDesktopServices().openUrl(qt.QUrl("file:///" + path, qt.QUrl.TolerantMode)) 7 | 8 | 9 | def createTempDirectory(): 10 | tempDir = qt.QDir(getTempDirectoryBase()) 11 | tempDirName = qt.QDateTime().currentDateTime().toString("yyyyMMdd_hhmmss_zzz") 12 | fileInfo = qt.QFileInfo(qt.QDir(tempDir), tempDirName) 13 | return createDirectory(fileInfo.absoluteFilePath()) 14 | 15 | 16 | def getTempDirectoryBase(): 17 | tempDir = qt.QDir(slicer.app.temporaryPath) 18 | fileInfo = qt.QFileInfo(qt.QDir(tempDir), "Elastix") 19 | return createDirectory(fileInfo.absoluteFilePath()) 20 | 21 | 22 | def createDirectory(path): 23 | if qt.QDir().mkpath(path): 24 | return path 25 | else: 26 | raise RuntimeError(f"Failed to create directory {path}") 27 | 28 | 29 | def getContentSuffixes(content, presets): 30 | numbers = [] 31 | for oPreset in presets: 32 | oContent = oPreset.getContent() 33 | if content == oContent or oContent.startswith(content): 34 | if oContent.startswith(content): 35 | stripped = oContent.replace(content, "").strip() 36 | if stripped.isdigit(): 37 | numbers.append(int(stripped)) 38 | return numbers -------------------------------------------------------------------------------- /Elastix/Resources/Icons/Elastix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lassoan/SlicerElastix/9ec57ae3b4baa613fe03e4af756a8d00ed6ff638/Elastix/Resources/Icons/Elastix.png -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Bsplines_parameter-file.txt: -------------------------------------------------------------------------------- 1 | // **************** Image Types ****************************** 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // **************** Main Components ************************** 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (Interpolator "BSplineInterpolator") 10 | (ResampleInterpolator "FinalBSplineInterpolator") 11 | (Resampler "DefaultResampler") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Optimizer "AdaptiveStochasticGradientDescent") 15 | (Transform "BSplineTransform") 16 | (Metric "AdvancedMattesMutualInformation") 17 | 18 | // ***************** Transformation ************************** 19 | 20 | // next line variable in study: from 5 - 40 21 | (FinalGridSpacingInPhysicalUnits 15) 22 | (GridSpacingSchedule 4 2 1 ) 23 | (HowToCombineTransforms "Compose") 24 | 25 | //Save composite ITK transform 26 | (ITKTransformOutputFileNameExtension "h5") 27 | (WriteITKCompositeTransform "true") 28 | 29 | // ******************* Similarity measure ********************* 30 | 31 | (NumberOfHistogramBins 32 ) 32 | (ErodeMask "false") 33 | 34 | // ******************** Multiresolution ********************** 35 | 36 | (NumberOfResolutions 3) 37 | (ImagePyramidSchedule 4 4 2 2 2 1 1 1 1 ) 38 | 39 | // ******************* Optimizer **************************** 40 | 41 | (MaximumNumberOfIterations 500) 42 | 43 | // **************** Image sampling ********************** 44 | 45 | (NumberOfSpatialSamples 2048) 46 | (NewSamplesEveryIteration "true") 47 | (ImageSampler "RandomCoordinate") 48 | 49 | // ************* Interpolation and Resampling **************** 50 | 51 | (BSplineInterpolationOrder 1) 52 | (FinalBSplineInterpolationOrder 3) 53 | (DefaultPixelValue 0) 54 | (WriteResultImage "true") 55 | (ResultImagePixelType "short") 56 | (ResultImageFormat "mhd") -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Deformable.txt: -------------------------------------------------------------------------------- 1 | (FixedInternalImagePixelType "float") 2 | (MovingInternalImagePixelType "float") 3 | 4 | // **************** Main Components ************************** 5 | 6 | (Registration "MultiMetricMultiResolutionRegistration") 7 | (Interpolator "BSplineInterpolator") 8 | (ResampleInterpolator "FinalBSplineInterpolator") 9 | (Resampler "DefaultResampler") 10 | 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | 14 | (Optimizer "AdaptiveStochasticGradientDescent") 15 | (Transform "BSplineTransform") 16 | (Metric "AdvancedMattesMutualInformation" "TransformBendingEnergyPenalty") 17 | (Metric0Weight 1) 18 | (Metric1Weight 50) // OPTIMIZED BY QUANTITATIVE MEASURES 19 | 20 | // ***************** Transformation ************************** 21 | 22 | (GridSpacingSchedule 4 2 1) 23 | (FinalGridSpacingInPhysicalUnits 15) 24 | (HowToCombineTransforms "Compose") 25 | 26 | //Save composite ITK transform 27 | (ITKTransformOutputFileNameExtension "h5") 28 | (WriteITKCompositeTransform "true") 29 | 30 | // ******************* Similarity measure ********************* 31 | 32 | (NumberOfHistogramBins 60) // OPTIMIZED BY QUANTITATIVE MEASURES 33 | 34 | // ******************** Multiresolution ********************** 35 | 36 | (NumberOfResolutions 3) 37 | (ImagePyramidSchedule 8 8 2 4 4 1 1 1 1) // ACCOUNTING FOR ANISOTROPIC RESOLUTION 38 | 39 | // ******************* Optimizer **************************** 40 | 41 | (MaximumNumberOfIterations 5000) // COULD PROBABLY BE LOWERED, ESPECIALLY FOR THE FIRST LEVELS OF THE IMAGE PYRAMID 42 | 43 | // **************** Image sampling ********************** 44 | 45 | (NumberOfSpatialSamples 10000) // COULD PROBABLY BE LOWERED, ESPECIALLY FOR THE FIRST LEVELS OF THE IMAGE PYRAMID 46 | (NewSamplesEveryIteration "true") 47 | (ImageSampler "MultiInputRandomCoordinate") 48 | (SampleRegionSize 40) // OPTIMIZED BY QUANTITATIVE MEASURES 49 | (UseRandomSampleRegion "true") 50 | (MaximumNumberOfSamplingAttempts 5) 51 | (RequiredRatioOfValidSamples 0.05) 52 | 53 | // ************* Interpolation and Resampling **************** 54 | 55 | (BSplineInterpolationOrder 1) 56 | (FinalBSplineInterpolationOrder 3) 57 | 58 | (ShowExactMetricValue "false") 59 | (WriteTransformParametersEachResolution "true") 60 | //(WriteResultImageAfterEachResolution "true") 61 | //(WritePyramidImagesAfterEachResolution "true") 62 | 63 | (DefaultPixelValue 0) 64 | (WriteResultImage "true") 65 | (ResultImagePixelType "short") 66 | (ResultImageFormat "mhd") 67 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0000affine.txt: -------------------------------------------------------------------------------- 1 | // Description: affine, MI, ASGD 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "AdaptiveStochasticGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "AffineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | 24 | (HowToCombineTransforms "Compose") 25 | 26 | //Save composite ITK transform 27 | (ITKTransformOutputFileNameExtension "h5") 28 | (WriteITKCompositeTransform "true") 29 | (AutomaticTransformInitialization "true") 30 | (AutomaticScalesEstimation "true") 31 | 32 | (WriteTransformParametersEachIteration "false") 33 | (WriteResultImage "false") 34 | (CompressResultImage "true") 35 | (WriteResultImageAfterEachResolution "false") 36 | (ShowExactMetricValue "false") 37 | 38 | //Maximum number of iterations in each resolution level: 39 | (MaximumNumberOfIterations 500 ) 40 | 41 | //Number of grey level bins in each resolution level: 42 | (NumberOfHistogramBins 32 ) 43 | (FixedLimitRangeRatio 0.0) 44 | (MovingLimitRangeRatio 0.0) 45 | (FixedKernelBSplineOrder 3) 46 | (MovingKernelBSplineOrder 3) 47 | 48 | //Number of spatial samples used to compute the mutual information in each resolution level: 49 | (ImageSampler "RandomCoordinate") 50 | (FixedImageBSplineInterpolationOrder 1 ) 51 | (UseRandomSampleRegion "false") 52 | (NumberOfSpatialSamples 2000 ) 53 | (NewSamplesEveryIteration "true") 54 | (CheckNumberOfSamples "true") 55 | (MaximumNumberOfSamplingAttempts 10) 56 | 57 | //Order of B-Spline interpolation used in each resolution level: 58 | (BSplineInterpolationOrder 1) 59 | 60 | //Order of B-Spline interpolation used for applying the final deformation: 61 | (FinalBSplineInterpolationOrder 3) 62 | 63 | //Default pixel value for pixels that come from outside the picture: 64 | (DefaultPixelValue 0) 65 | 66 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 67 | (SP_A 20.0 ) 68 | 69 | 70 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0000bspline.txt: -------------------------------------------------------------------------------- 1 | // Description: bspline, LMI, SGD 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "BSplineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 5) 23 | (FinalGridSpacingInPhysicalUnits 5.0 5.0 5.0) 24 | 25 | (HowToCombineTransforms "Compose") 26 | 27 | //Save composite ITK transform 28 | (ITKTransformOutputFileNameExtension "h5") 29 | (WriteITKCompositeTransform "true") 30 | 31 | (WriteTransformParametersEachIteration "false") 32 | (WriteResultImage "false") 33 | (CompressResultImage "true") 34 | (WriteResultImageAfterEachResolution "false") 35 | (ShowExactMetricValue "false") 36 | 37 | // Option supported in elastix 4.1: 38 | (UseFastAndLowMemoryVersion "true") 39 | 40 | //Maximum number of iterations in each resolution level: 41 | (MaximumNumberOfIterations 2000 ) 42 | 43 | //Number of grey level bins in each resolution level: 44 | (NumberOfHistogramBins 32 ) 45 | (FixedLimitRangeRatio 0.0) 46 | (MovingLimitRangeRatio 0.0) 47 | (FixedKernelBSplineOrder 3) 48 | (MovingKernelBSplineOrder 3) 49 | 50 | //Number of spatial samples used to compute the mutual information in each resolution level: 51 | (ImageSampler "RandomCoordinate") 52 | (FixedImageBSplineInterpolationOrder 1 ) 53 | (UseRandomSampleRegion "true") 54 | (SampleRegionSize 50.0 50.0 50.0) 55 | (NumberOfSpatialSamples 2000 ) 56 | (NewSamplesEveryIteration "true") 57 | (CheckNumberOfSamples "true") 58 | (MaximumNumberOfSamplingAttempts 10) 59 | 60 | //Order of B-Spline interpolation used in each resolution level: 61 | (BSplineInterpolationOrder 1) 62 | 63 | //Order of B-Spline interpolation used for applying the final deformation: 64 | (FinalBSplineInterpolationOrder 3) 65 | 66 | //Default pixel value for pixels that come from outside the picture: 67 | (DefaultPixelValue 0) 68 | 69 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 70 | (SP_a 10000.0 ) 71 | 72 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 73 | (SP_A 100.0 ) 74 | 75 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 76 | (SP_alpha 0.6 ) 77 | 78 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001affine.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, affine 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "AffineTransform") 19 | 20 | (ErodeMask "false") 21 | 22 | (AutomaticScalesEstimation "true") 23 | (AutomaticTransformInitialization "false") 24 | 25 | (NumberOfResolutions 4) 26 | 27 | (HowToCombineTransforms "Compose") 28 | 29 | //Save composite ITK transform 30 | (ITKTransformOutputFileNameExtension "h5") 31 | (WriteITKCompositeTransform "true") 32 | 33 | (WriteResultImage "false") 34 | (WriteResultImageAfterEachResolution "false") 35 | (WriteTransformParametersEachIteration "false") 36 | (WriteTransformParametersEachResolution "true") 37 | 38 | //Maximum number of iterations in each resolution level: 39 | (MaximumNumberOfIterations 2000) 40 | 41 | //Number of grey level bins in each resolution level: 42 | (NumberOfHistogramBins 32 ) 43 | (FixedKernelBSplineOrder 3) 44 | (MovingKernelBSplineOrder 3) 45 | (FixedLimitRangeRatio 0.0) 46 | (MovingLimitRangeRatio 0.0) 47 | 48 | // sampler: 49 | (ImageSampler "RandomCoordinate") 50 | (FixedImageBSplineInterpolationOrder 1 ) 51 | (UseRandomSampleRegion "true") 52 | (SampleRegionSize 50.0) 53 | (CheckNumberOfSamples "false") 54 | (NewSamplesEveryIteration "true" ) 55 | 56 | //Number of spatial samples used to compute the mutual information in each resolution level: 57 | (NumberOfSpatialSamples 2000 ) 58 | 59 | //Order of B-Spline interpolation used in each resolution level: 60 | (BSplineInterpolationOrder 1 ) 61 | 62 | //Order of B-Spline interpolation used for applying the final deformation: 63 | (FinalBSplineInterpolationOrder 3) 64 | 65 | //Default pixel value for pixels that come from outside the picture: 66 | (DefaultPixelValue 0) 67 | 68 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 69 | (SP_a 2000.0) 70 | 71 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 72 | (SP_A 200.0) 73 | 74 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 75 | (SP_alpha 0.6 ) 76 | 77 | 78 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001bspline04.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, bspline4 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "BSplineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | (FinalGridSpacingInPhysicalUnits 4.0) 24 | (GridSpacingSchedule 8.0 4.0 2.0 1.0) 25 | 26 | (HowToCombineTransforms "Compose") 27 | 28 | //Save composite ITK transform 29 | (ITKTransformOutputFileNameExtension "h5") 30 | (WriteITKCompositeTransform "true") 31 | 32 | (WriteResultImage "false") 33 | (WriteResultImageAfterEachResolution "false") 34 | (WriteTransformParametersEachIteration "false") 35 | (WriteTransformParametersEachResolution "true") 36 | 37 | //Maximum number of iterations in each resolution level: 38 | (MaximumNumberOfIterations 2000 ) 39 | 40 | //Number of grey level bins in each resolution level: 41 | (NumberOfHistogramBins 32 ) 42 | (FixedLimitRangeRatio 0.0) 43 | (MovingLimitRangeRatio 0.0) 44 | (FixedKernelBSplineOrder 3) 45 | (MovingKernelBSplineOrder 3) 46 | 47 | 48 | //Number of spatial samples used to compute the mutual information in each resolution level: 49 | (ImageSampler "RandomCoordinate") 50 | (NumberOfSpatialSamples 2000 ) 51 | (FixedImageBSplineInterpolationOrder 1) 52 | (UseRandomSampleRegion "true") 53 | (SampleRegionSize 50.0) 54 | (CheckNumberOfSamples "false") 55 | (NewSamplesEveryIteration "true") 56 | 57 | //Order of B-Spline interpolation used in each resolution level: 58 | (BSplineInterpolationOrder 1) 59 | 60 | //Order of B-Spline interpolation used for applying the final deformation: 61 | (FinalBSplineInterpolationOrder 3) 62 | 63 | //Default pixel value for pixels that come from outside the picture: 64 | (DefaultPixelValue 0) 65 | 66 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 67 | (SP_a 2000.0 ) 68 | 69 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 70 | (SP_A 200.0 ) 71 | 72 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 73 | (SP_alpha 0.6 ) 74 | 75 | 76 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001bspline08.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, bspline8 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "BSplineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | (FinalGridSpacingInPhysicalUnits 8.0) 24 | (GridSpacingSchedule 8.0 4.0 2.0 1.0) 25 | 26 | (HowToCombineTransforms "Compose") 27 | 28 | //Save composite ITK transform 29 | (ITKTransformOutputFileNameExtension "h5") 30 | (WriteITKCompositeTransform "true") 31 | 32 | (WriteResultImage "false") 33 | (WriteResultImageAfterEachResolution "false") 34 | (WriteTransformParametersEachIteration "false") 35 | (WriteTransformParametersEachResolution "true") 36 | 37 | //Maximum number of iterations in each resolution level: 38 | (MaximumNumberOfIterations 2000 ) 39 | 40 | //Number of grey level bins in each resolution level: 41 | (NumberOfHistogramBins 32 ) 42 | (FixedLimitRangeRatio 0.0) 43 | (MovingLimitRangeRatio 0.0) 44 | (FixedKernelBSplineOrder 3) 45 | (MovingKernelBSplineOrder 3) 46 | 47 | 48 | //Number of spatial samples used to compute the mutual information in each resolution level: 49 | (ImageSampler "RandomCoordinate") 50 | (NumberOfSpatialSamples 2000 ) 51 | (FixedImageBSplineInterpolationOrder 1) 52 | (UseRandomSampleRegion "true") 53 | (SampleRegionSize 50.0) 54 | (CheckNumberOfSamples "false") 55 | (NewSamplesEveryIteration "true") 56 | 57 | //Order of B-Spline interpolation used in each resolution level: 58 | (BSplineInterpolationOrder 1) 59 | 60 | //Order of B-Spline interpolation used for applying the final deformation: 61 | (FinalBSplineInterpolationOrder 3) 62 | 63 | //Default pixel value for pixels that come from outside the picture: 64 | (DefaultPixelValue 0) 65 | 66 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 67 | (SP_a 2000.0 ) 68 | 69 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 70 | (SP_A 200.0 ) 71 | 72 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 73 | (SP_alpha 0.6 ) 74 | 75 | 76 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001bspline16.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, bspline16 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "BSplineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | (FinalGridSpacingInPhysicalUnits 16.0) 24 | (GridSpacingSchedule 4.0 4.0 2.0 1.0) 25 | 26 | (HowToCombineTransforms "Compose") 27 | 28 | //Save composite ITK transform 29 | (ITKTransformOutputFileNameExtension "h5") 30 | (WriteITKCompositeTransform "true") 31 | 32 | (WriteResultImage "false") 33 | (WriteResultImageAfterEachResolution "false") 34 | (WriteTransformParametersEachIteration "false") 35 | (WriteTransformParametersEachResolution "true") 36 | 37 | //Maximum number of iterations in each resolution level: 38 | (MaximumNumberOfIterations 2000 ) 39 | 40 | //Number of grey level bins in each resolution level: 41 | (NumberOfHistogramBins 32 ) 42 | (FixedLimitRangeRatio 0.0) 43 | (MovingLimitRangeRatio 0.0) 44 | (FixedKernelBSplineOrder 3) 45 | (MovingKernelBSplineOrder 3) 46 | 47 | 48 | //Number of spatial samples used to compute the mutual information in each resolution level: 49 | (ImageSampler "RandomCoordinate") 50 | (NumberOfSpatialSamples 2000 ) 51 | (FixedImageBSplineInterpolationOrder 1) 52 | (UseRandomSampleRegion "true") 53 | (SampleRegionSize 50.0) 54 | (CheckNumberOfSamples "false") 55 | (NewSamplesEveryIteration "true") 56 | 57 | //Order of B-Spline interpolation used in each resolution level: 58 | (BSplineInterpolationOrder 1) 59 | 60 | //Order of B-Spline interpolation used for applying the final deformation: 61 | (FinalBSplineInterpolationOrder 3) 62 | 63 | //Default pixel value for pixels that come from outside the picture: 64 | (DefaultPixelValue 0) 65 | 66 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 67 | (SP_a 2000.0 ) 68 | 69 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 70 | (SP_A 200.0 ) 71 | 72 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 73 | (SP_alpha 0.6 ) 74 | 75 | 76 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001bspline32.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, bspline32 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "BSplineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | (FinalGridSpacingInPhysicalUnits 32.0) 24 | (GridSpacingSchedule 2.0 2.0 2.0 1.0) 25 | 26 | (HowToCombineTransforms "Compose") 27 | 28 | //Save composite ITK transform 29 | (ITKTransformOutputFileNameExtension "h5") 30 | (WriteITKCompositeTransform "true") 31 | 32 | (WriteResultImage "false") 33 | (WriteResultImageAfterEachResolution "false") 34 | (WriteTransformParametersEachIteration "false") 35 | (WriteTransformParametersEachResolution "true") 36 | 37 | //Maximum number of iterations in each resolution level: 38 | (MaximumNumberOfIterations 2000 ) 39 | 40 | //Number of grey level bins in each resolution level: 41 | (NumberOfHistogramBins 32 ) 42 | (FixedLimitRangeRatio 0.0) 43 | (MovingLimitRangeRatio 0.0) 44 | (FixedKernelBSplineOrder 3) 45 | (MovingKernelBSplineOrder 3) 46 | 47 | 48 | //Number of spatial samples used to compute the mutual information in each resolution level: 49 | (ImageSampler "RandomCoordinate") 50 | (NumberOfSpatialSamples 2000 ) 51 | (FixedImageBSplineInterpolationOrder 1) 52 | (UseRandomSampleRegion "true") 53 | (SampleRegionSize 50.0) 54 | (CheckNumberOfSamples "false") 55 | (NewSamplesEveryIteration "true") 56 | 57 | //Order of B-Spline interpolation used in each resolution level: 58 | (BSplineInterpolationOrder 1) 59 | 60 | //Order of B-Spline interpolation used for applying the final deformation: 61 | (FinalBSplineInterpolationOrder 3) 62 | 63 | //Default pixel value for pixels that come from outside the picture: 64 | (DefaultPixelValue 0) 65 | 66 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 67 | (SP_a 2000.0 ) 68 | 69 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 70 | (SP_A 200.0 ) 71 | 72 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 73 | (SP_alpha 0.6 ) 74 | 75 | 76 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001bspline64.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, bspline64 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "BSplineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | (FinalGridSpacingInPhysicalUnits 64.0) 24 | (GridSpacingSchedule 1.0 1.0 1.0 1.0) 25 | 26 | (HowToCombineTransforms "Compose") 27 | 28 | //Save composite ITK transform 29 | (ITKTransformOutputFileNameExtension "h5") 30 | (WriteITKCompositeTransform "true") 31 | 32 | (WriteResultImage "false") 33 | (WriteResultImageAfterEachResolution "false") 34 | (WriteTransformParametersEachIteration "false") 35 | (WriteTransformParametersEachResolution "true") 36 | 37 | //Maximum number of iterations in each resolution level: 38 | (MaximumNumberOfIterations 2000 ) 39 | 40 | //Number of grey level bins in each resolution level: 41 | (NumberOfHistogramBins 32 ) 42 | (FixedLimitRangeRatio 0.0) 43 | (MovingLimitRangeRatio 0.0) 44 | (FixedKernelBSplineOrder 3) 45 | (MovingKernelBSplineOrder 3) 46 | 47 | 48 | //Number of spatial samples used to compute the mutual information in each resolution level: 49 | (ImageSampler "RandomCoordinate") 50 | (NumberOfSpatialSamples 2000 ) 51 | (FixedImageBSplineInterpolationOrder 1) 52 | (UseRandomSampleRegion "true") 53 | (SampleRegionSize 50.0) 54 | (CheckNumberOfSamples "false") 55 | (NewSamplesEveryIteration "true") 56 | 57 | //Order of B-Spline interpolation used in each resolution level: 58 | (BSplineInterpolationOrder 1) 59 | 60 | //Order of B-Spline interpolation used for applying the final deformation: 61 | (FinalBSplineInterpolationOrder 3) 62 | 63 | //Default pixel value for pixels that come from outside the picture: 64 | (DefaultPixelValue 0) 65 | 66 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 67 | (SP_a 2000.0 ) 68 | 69 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 70 | (SP_A 200.0 ) 71 | 72 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 73 | (SP_alpha 0.6 ) 74 | 75 | 76 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001rigid.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, euler 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "EulerTransform") 19 | 20 | (ErodeMask "false") 21 | 22 | (AutomaticScalesEstimation "true") 23 | (AutomaticTransformInitialization "false") 24 | 25 | (NumberOfResolutions 4) 26 | 27 | (HowToCombineTransforms "Compose") 28 | 29 | //Save composite ITK transform 30 | (ITKTransformOutputFileNameExtension "h5") 31 | (WriteITKCompositeTransform "true") 32 | 33 | (WriteResultImage "false") 34 | (WriteResultImageAfterEachResolution "false") 35 | (WriteTransformParametersEachIteration "false") 36 | (WriteTransformParametersEachResolution "true") 37 | 38 | //Maximum number of iterations in each resolution level: 39 | (MaximumNumberOfIterations 2000) 40 | 41 | //Number of grey level bins in each resolution level: 42 | (NumberOfHistogramBins 32 ) 43 | (FixedKernelBSplineOrder 3) 44 | (MovingKernelBSplineOrder 3) 45 | (FixedLimitRangeRatio 0.0) 46 | (MovingLimitRangeRatio 0.0) 47 | 48 | // sampler: 49 | (ImageSampler "RandomCoordinate") 50 | (FixedImageBSplineInterpolationOrder 1 ) 51 | (UseRandomSampleRegion "true") 52 | (SampleRegionSize 50.0) 53 | (CheckNumberOfSamples "false") 54 | (NewSamplesEveryIteration "true" ) 55 | 56 | //Number of spatial samples used to compute the mutual information in each resolution level: 57 | (NumberOfSpatialSamples 2000 ) 58 | 59 | //Order of B-Spline interpolation used in each resolution level: 60 | (BSplineInterpolationOrder 1 ) 61 | 62 | //Order of B-Spline interpolation used for applying the final deformation: 63 | (FinalBSplineInterpolationOrder 3) 64 | 65 | //Default pixel value for pixels that come from outside the picture: 66 | (DefaultPixelValue 0) 67 | 68 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 69 | (SP_a 2000.0) 70 | 71 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 72 | (SP_A 200.0) 73 | 74 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 75 | (SP_alpha 0.6 ) 76 | 77 | 78 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0001translation.txt: -------------------------------------------------------------------------------- 1 | // Description: elastixpaper, translation 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "TranslationTransform") 19 | 20 | (ErodeMask "false") 21 | 22 | (AutomaticScalesEstimation "true") 23 | (AutomaticTransformInitialization "true") 24 | 25 | (NumberOfResolutions 4) 26 | 27 | (HowToCombineTransforms "Compose") 28 | 29 | //Save composite ITK transform 30 | (ITKTransformOutputFileNameExtension "h5") 31 | (WriteITKCompositeTransform "true") 32 | 33 | (WriteResultImage "false") 34 | (WriteResultImageAfterEachResolution "false") 35 | (WriteTransformParametersEachIteration "false") 36 | (WriteTransformParametersEachResolution "true") 37 | 38 | //Maximum number of iterations in each resolution level: 39 | (MaximumNumberOfIterations 2000) 40 | 41 | //Number of grey level bins in each resolution level: 42 | (NumberOfHistogramBins 32 ) 43 | (FixedKernelBSplineOrder 3) 44 | (MovingKernelBSplineOrder 3) 45 | (FixedLimitRangeRatio 0.0) 46 | (MovingLimitRangeRatio 0.0) 47 | 48 | // sampler: 49 | (ImageSampler "RandomCoordinate") 50 | (FixedImageBSplineInterpolationOrder 1 ) 51 | (UseRandomSampleRegion "true") 52 | (SampleRegionSize 50.0) 53 | (CheckNumberOfSamples "false") 54 | (NewSamplesEveryIteration "true" ) 55 | 56 | //Number of spatial samples used to compute the mutual information in each resolution level: 57 | (NumberOfSpatialSamples 2000 ) 58 | 59 | //Order of B-Spline interpolation used in each resolution level: 60 | (BSplineInterpolationOrder 1 ) 61 | 62 | //Order of B-Spline interpolation used for applying the final deformation: 63 | (FinalBSplineInterpolationOrder 3) 64 | 65 | //Default pixel value for pixels that come from outside the picture: 66 | (DefaultPixelValue 0) 67 | 68 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 69 | (SP_a 2000.0) 70 | 71 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 72 | (SP_A 200.0) 73 | 74 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 75 | (SP_alpha 0.6 ) 76 | 77 | 78 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0002.fs.MI.rigid.Full.txt: -------------------------------------------------------------------------------- 1 | //ImageTypes 2 | (FixedInternalImagePixelType "float") 3 | (FixedImageDimension 3) 4 | (MovingInternalImagePixelType "float") 5 | (MovingImageDimension 3) 6 | 7 | //Components 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedSmoothingImagePyramid") 10 | (MovingImagePyramid "MovingSmoothingImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedMattesMutualInformation") 13 | (Optimizer "FullSearch") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "EulerTransform") 17 | 18 | // ********** Pyramid 19 | 20 | // Total number of resolutions 21 | (NumberOfResolutions 1) 22 | (ImagePyramidSchedule 0 0 0) 23 | 24 | // ********** Transform 25 | 26 | (AutomaticTransformInitialization "true") 27 | (HowToCombineTransforms "Compose") 28 | 29 | //Save composite ITK transform 30 | (ITKTransformOutputFileNameExtension "h5") 31 | (WriteITKCompositeTransform "true") 32 | 33 | 34 | // ********** Optimizer 35 | (FullSearchSpace0 "t_z" 5 -10.0 30.0 0.1) 36 | //(FullSearchSpace0 "t_x" 3 -10.0 20.0 0.1) 37 | 38 | 39 | // ********** Metric 40 | 41 | //Number of grey level bins in each resolution level: 42 | (NumberOfHistogramBins 32) 43 | (FixedLimitRangeRatio 0.0) 44 | (MovingLimitRangeRatio 0.0) 45 | (FixedKernelBSplineOrder 1) 46 | (MovingKernelBSplineOrder 3) 47 | 48 | 49 | // ********** Several 50 | 51 | (WriteTransformParametersEachIteration "false") 52 | (WriteTransformParametersEachResolution "false") 53 | (WriteResultImage "false") 54 | (ShowExactMetricValue "false") 55 | (ErodeMask "true") 56 | (UseDifferentiableOverlap "false") 57 | 58 | 59 | // ********** ImageSampler 60 | 61 | //Number of spatial samples used to compute the mutual information in each resolution level: 62 | (ImageSampler "Full") 63 | (NewSamplesEveryIteration "false") 64 | 65 | 66 | // ********** Interpolator and Resampler 67 | 68 | //Order of B-Spline interpolation used in each resolution level: 69 | (BSplineInterpolationOrder 1) 70 | 71 | //Order of B-Spline interpolation used for applying the final deformation: 72 | (FinalBSplineInterpolationOrder 3) 73 | 74 | //Default pixel value for pixels that come from outside the picture: 75 | (DefaultPixelValue 0) 76 | 77 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0002.fs.MI.rigid.Random.txt: -------------------------------------------------------------------------------- 1 | //ImageTypes 2 | (FixedInternalImagePixelType "float") 3 | (FixedImageDimension 3) 4 | (MovingInternalImagePixelType "float") 5 | (MovingImageDimension 3) 6 | 7 | //Components 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedSmoothingImagePyramid") 10 | (MovingImagePyramid "MovingSmoothingImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedMattesMutualInformation") 13 | (Optimizer "FullSearch") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "EulerTransform") 17 | 18 | // ********** Pyramid 19 | 20 | // Total number of resolutions 21 | (NumberOfResolutions 1) 22 | (ImagePyramidSchedule 0 0 0) 23 | 24 | 25 | // ********** Transform 26 | 27 | (AutomaticTransformInitialization "true") 28 | (HowToCombineTransforms "Compose") 29 | 30 | //Save composite ITK transform 31 | (ITKTransformOutputFileNameExtension "h5") 32 | (WriteITKCompositeTransform "true") 33 | 34 | 35 | // ********** Optimizer 36 | (FullSearchSpace0 "t_z" 5 -10.0 30.0 0.1) 37 | //(FullSearchSpace0 "t_x" 3 -10.0 20.0 0.1) 38 | 39 | 40 | // ********** Metric 41 | 42 | //Number of grey level bins in each resolution level: 43 | (NumberOfHistogramBins 32) 44 | (FixedLimitRangeRatio 0.0) 45 | (MovingLimitRangeRatio 0.0) 46 | (FixedKernelBSplineOrder 1) 47 | (MovingKernelBSplineOrder 3) 48 | 49 | 50 | // ********** Several 51 | 52 | (WriteTransformParametersEachIteration "false") 53 | (WriteTransformParametersEachResolution "false") 54 | (WriteResultImage "false") 55 | (ShowExactMetricValue "false") 56 | (ErodeMask "true") 57 | (UseDifferentiableOverlap "false") 58 | 59 | 60 | // ********** ImageSampler 61 | 62 | //Number of spatial samples used to compute the mutual information in each resolution level: 63 | (ImageSampler "Random") 64 | (NumberOfSpatialSamples 100000) 65 | (NewSamplesEveryIteration "false") 66 | 67 | 68 | // ********** Interpolator and Resampler 69 | 70 | //Order of B-Spline interpolation used in each resolution level: 71 | (BSplineInterpolationOrder 1) 72 | 73 | //Order of B-Spline interpolation used for applying the final deformation: 74 | (FinalBSplineInterpolationOrder 3) 75 | 76 | //Default pixel value for pixels that come from outside the picture: 77 | (DefaultPixelValue 0) 78 | 79 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0002.fs.MI.rigid.RandomCoordinate.txt: -------------------------------------------------------------------------------- 1 | //ImageTypes 2 | (FixedInternalImagePixelType "float") 3 | (FixedImageDimension 3) 4 | (MovingInternalImagePixelType "float") 5 | (MovingImageDimension 3) 6 | 7 | //Components 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedSmoothingImagePyramid") 10 | (MovingImagePyramid "MovingSmoothingImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedMattesMutualInformation") 13 | (Optimizer "FullSearch") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "EulerTransform") 17 | 18 | // ********** Pyramid 19 | 20 | // Total number of resolutions 21 | (NumberOfResolutions 1) 22 | (ImagePyramidSchedule 0 0 0) 23 | 24 | 25 | // ********** Transform 26 | 27 | (AutomaticTransformInitialization "true") 28 | (HowToCombineTransforms "Compose") 29 | 30 | //Save composite ITK transform 31 | (ITKTransformOutputFileNameExtension "h5") 32 | (WriteITKCompositeTransform "true") 33 | 34 | 35 | // ********** Optimizer 36 | (FullSearchSpace0 "t_z" 5 -10.0 30.0 0.1) 37 | //(FullSearchSpace0 "t_x" 3 -10.0 20.0 0.1) 38 | 39 | 40 | // ********** Metric 41 | 42 | //Number of grey level bins in each resolution level: 43 | (NumberOfHistogramBins 32) 44 | (FixedLimitRangeRatio 0.0) 45 | (MovingLimitRangeRatio 0.0) 46 | (FixedKernelBSplineOrder 1) 47 | (MovingKernelBSplineOrder 3) 48 | 49 | 50 | // ********** Several 51 | 52 | (WriteTransformParametersEachIteration "false") 53 | (WriteTransformParametersEachResolution "false") 54 | (WriteResultImage "false") 55 | (ShowExactMetricValue "false") 56 | (ErodeMask "true") 57 | (UseDifferentiableOverlap "false") 58 | 59 | 60 | // ********** ImageSampler 61 | 62 | //Number of spatial samples used to compute the mutual information in each resolution level: 63 | (ImageSampler "RandomCoordinate") 64 | (NumberOfSpatialSamples 100000) 65 | (NewSamplesEveryIteration "false") 66 | 67 | 68 | // ********** Interpolator and Resampler 69 | 70 | //Order of B-Spline interpolation used in each resolution level: 71 | (BSplineInterpolationOrder 1) 72 | 73 | //Order of B-Spline interpolation used for applying the final deformation: 74 | (FinalBSplineInterpolationOrder 3) 75 | 76 | //Default pixel value for pixels that come from outside the picture: 77 | (DefaultPixelValue 0) 78 | 79 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.affine.txt: -------------------------------------------------------------------------------- 1 | //ImageTypes 2 | (FixedInternalImagePixelType "float") 3 | (FixedImageDimension 3) 4 | (MovingInternalImagePixelType "float") 5 | (MovingImageDimension 3) 6 | 7 | //Components 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedSmoothingImagePyramid") 10 | (MovingImagePyramid "MovingSmoothingImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedMattesMutualInformation") 13 | (Optimizer "StandardGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "AffineTransform") 17 | 18 | // ********** Pyramid 19 | 20 | // Total number of resolutions 21 | (NumberOfResolutions 4) 22 | 23 | 24 | // ********** Transform 25 | 26 | (AutomaticTransformInitialization "true") 27 | (AutomaticScalesEstimation "true") 28 | (HowToCombineTransforms "Compose") 29 | 30 | //Save composite ITK transform 31 | (ITKTransformOutputFileNameExtension "h5") 32 | (WriteITKCompositeTransform "true") 33 | 34 | 35 | // ********** Optimizer 36 | 37 | // Maximum number of iterations in each resolution level: 38 | (MaximumNumberOfIterations 1000) 39 | 40 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 41 | (SP_a 500.0) 42 | 43 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 44 | (SP_alpha 0.602) 45 | 46 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 47 | (SP_A 50.0) 48 | 49 | 50 | // ********** Metric 51 | 52 | //Number of grey level bins in each resolution level: 53 | (NumberOfHistogramBins 32) 54 | (FixedLimitRangeRatio 0.0) 55 | (MovingLimitRangeRatio 0.0) 56 | (FixedKernelBSplineOrder 1) 57 | (MovingKernelBSplineOrder 3) 58 | 59 | 60 | // ********** Several 61 | 62 | (WriteTransformParametersEachIteration "false") 63 | (WriteTransformParametersEachResolution "false") 64 | (WriteResultImage "false") 65 | (ShowExactMetricValue "false") 66 | (ErodeFixedMask "false") 67 | (ErodeMovingMask "false") 68 | (UseDifferentiableOverlap "false") 69 | 70 | 71 | // ********** ImageSampler 72 | 73 | //Number of spatial samples used to compute the mutual information in each resolution level: 74 | (ImageSampler "RandomSparseMask") 75 | (NumberOfSpatialSamples 2048) 76 | (NewSamplesEveryIteration "true") 77 | 78 | 79 | // ********** Interpolator and Resampler 80 | 81 | //Order of B-Spline interpolation used in each resolution level: 82 | (BSplineInterpolationOrder 1) 83 | 84 | //Order of B-Spline interpolation used for applying the final deformation: 85 | (FinalBSplineInterpolationOrder 3) 86 | 87 | //Default pixel value for pixels that come from outside the picture: 88 | (DefaultPixelValue 0) 89 | 90 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R1-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 1) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R1-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 1) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R2-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 2) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R2-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 2) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R3-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 3) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0 1.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R3-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 3) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 4.0 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R4-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 4) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0 1.0 1.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R4-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 4) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 8.0 4.0 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R5-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 5) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0 1.0 1.0 1.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R5-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 5) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 16.0 8.0 4.0 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R6-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 6) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0 1.0 1.0 1.0 1.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R6-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 6) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 16.0 16.0 8.0 4.0 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R7-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 7) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0 1.0 1.0 1.0 1.0 1.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R7-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 7) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 16.0 16.0 16.0 8.0 4.0 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R8-fg.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 8) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0003.bs-R8-ug.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 8) 26 | // default schedule: isotropic upsampling with factor 2 27 | 28 | // ********** Transform 29 | 30 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 31 | (GridSpacingSchedule 16.0 16.0 16.0 16.0 8.0 4.0 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 1000) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 10000.0) 46 | 47 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 48 | (SP_alpha 0.602) 49 | 50 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_A 50.0) 52 | 53 | 54 | // ********** Metric 55 | 56 | //Number of grey level bins in each resolution level: 57 | (NumberOfHistogramBins 32) 58 | (FixedLimitRangeRatio 0.0) 59 | (MovingLimitRangeRatio 0.0) 60 | (FixedKernelBSplineOrder 1) 61 | (MovingKernelBSplineOrder 3) 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WriteResultImage "false") 70 | (ShowExactMetricValue "false") 71 | (ErodeMask "false") 72 | 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomSparseMask") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "false") 81 | 82 | 83 | // ********** Interpolator and Resampler 84 | 85 | //Order of B-Spline interpolation used in each resolution level: 86 | (BSplineInterpolationOrder 1) 87 | 88 | //Order of B-Spline interpolation used for applying the final deformation: 89 | (FinalBSplineInterpolationOrder 3) 90 | 91 | //Default pixel value for pixels that come from outside the picture: 92 | (DefaultPixelValue 0) 93 | 94 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0010affine.txt: -------------------------------------------------------------------------------- 1 | // Description: affine, MI, ASGD 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "AdaptiveStochasticGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "AffineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | 24 | (HowToCombineTransforms "Compose") 25 | 26 | //Save composite ITK transform 27 | (ITKTransformOutputFileNameExtension "h5") 28 | (WriteITKCompositeTransform "true") 29 | (AutomaticTransformInitialization "true") 30 | (AutomaticScalesEstimation "true") 31 | (AutomaticTransformInitializationMethod "CenterOfGravity" ) 32 | 33 | (WriteTransformParametersEachIteration "false") 34 | (WriteResultImage "false") 35 | (CompressResultImage "true") 36 | (WriteResultImageAfterEachResolution "false") 37 | (ShowExactMetricValue "false") 38 | 39 | //Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | //Number of grey level bins in each resolution level: 43 | (NumberOfHistogramBins 32 ) 44 | (FixedLimitRangeRatio 0.0) 45 | (MovingLimitRangeRatio 0.0) 46 | (FixedKernelBSplineOrder 3) 47 | (MovingKernelBSplineOrder 3) 48 | 49 | //Number of spatial samples used to compute the mutual information in each resolution level: 50 | (ImageSampler "Random") 51 | (NumberOfSpatialSamples 2000 ) 52 | (NewSamplesEveryIteration "true") 53 | (CheckNumberOfSamples "true") 54 | (MaximumNumberOfSamplingAttempts 10) 55 | 56 | //Order of B-Spline interpolation used in each resolution level: 57 | (BSplineInterpolationOrder 1) 58 | 59 | //Order of B-Spline interpolation used for applying the final deformation: 60 | (FinalBSplineInterpolationOrder 3) 61 | 62 | //Default pixel value for pixels that come from outside the picture: 63 | (DefaultPixelValue 0) 64 | 65 | (MaximumStepLength 4.0) 66 | 67 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0010bspline.txt: -------------------------------------------------------------------------------- 1 | // Description: bspline, localised MI 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (FixedImageDimension 3) 6 | (MovingInternalImagePixelType "float") 7 | (MovingImageDimension 3) 8 | 9 | //Components 10 | (Registration "MultiResolutionRegistration") 11 | (FixedImagePyramid "FixedSmoothingImagePyramid") 12 | (MovingImagePyramid "MovingSmoothingImagePyramid") 13 | (Interpolator "BSplineInterpolator") 14 | (Metric "AdvancedMattesMutualInformation") 15 | (Optimizer "StandardGradientDescent") 16 | (ResampleInterpolator "FinalBSplineInterpolator") 17 | (Resampler "DefaultResampler") 18 | (Transform "BSplineTransform") 19 | 20 | (ErodeMask "false" ) 21 | 22 | (NumberOfResolutions 4) 23 | (FinalGridSpacingInPhysicalUnits 15.0 15.0 15.0) 24 | (GridSpacingSchedule 4 4 2 1) 25 | 26 | (HowToCombineTransforms "Compose") 27 | 28 | //Save composite ITK transform 29 | (ITKTransformOutputFileNameExtension "h5") 30 | (WriteITKCompositeTransform "true") 31 | 32 | (WriteTransformParametersEachIteration "false") 33 | (WriteTransformParametersEachResolution "false") 34 | (WriteResultImage "false") 35 | (CompressResultImage "true") 36 | (WriteResultImageAfterEachResolution "false") 37 | (ShowExactMetricValue "false") 38 | 39 | //Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 2000 ) 41 | 42 | //Number of grey level bins in each resolution level: 43 | (NumberOfHistogramBins 32 ) 44 | (FixedLimitRangeRatio 0.0) 45 | (MovingLimitRangeRatio 0.0) 46 | (FixedKernelBSplineOrder 3) 47 | (MovingKernelBSplineOrder 3) 48 | (UseFastAndLowMemoryVersion "true") 49 | 50 | //Number of spatial samples used to compute the mutual information in each resolution level: 51 | (ImageSampler "RandomCoordinate") 52 | (FixedImageBSplineInterpolationOrder 1 ) 53 | (UseRandomSampleRegion "true") 54 | (SampleRegionSize 50.0 50.0 50.0) 55 | (NumberOfSpatialSamples 2000 ) 56 | (NewSamplesEveryIteration "true") 57 | (CheckNumberOfSamples "true") 58 | (MaximumNumberOfSamplingAttempts 10) 59 | 60 | //Order of B-Spline interpolation used in each resolution level: 61 | (BSplineInterpolationOrder 1) 62 | 63 | //Order of B-Spline interpolation used for applying the final deformation: 64 | (FinalBSplineInterpolationOrder 3) 65 | 66 | //Default pixel value for pixels that come from outside the picture: 67 | (DefaultPixelValue 0) 68 | 69 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 70 | (SP_a 10000.0 ) 71 | 72 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 73 | (SP_A 100.0 ) 74 | 75 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 76 | (SP_alpha 0.6 ) 77 | 78 | 79 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0013Powell_NGC_singleImage.txt: -------------------------------------------------------------------------------- 1 | 2 | (FixedInternalImagePixelType "float") 3 | (MovingInternalImagePixelType "float") 4 | 5 | // **************** Main Components ************************** 6 | 7 | (Registration "MultiResolutionRegistration") 8 | (Interpolator "RayCastInterpolator") 9 | (ResampleInterpolator "FinalRayCastInterpolator") 10 | (Resampler "DefaultResampler") 11 | 12 | (FixedImagePyramid "FixedRecursiveImagePyramid") 13 | (MovingImagePyramid "MovingRecursiveImagePyramid") 14 | 15 | (Optimizer "Powell") 16 | (Transform "EulerTransform") 17 | (Metric "NormalizedGradientCorrelation") 18 | 19 | // ***************** Transformation ************************** 20 | 21 | (Scales 57.3) 22 | (AutomaticTransformInitialization "false") 23 | (HowToCombineTransforms "Compose") 24 | 25 | //Save composite ITK transform 26 | (ITKTransformOutputFileNameExtension "h5") 27 | (WriteITKCompositeTransform "true") 28 | (CenterOfRotationPoint 0.0 0.0 0.0) 29 | 30 | // ******************* Similarity measure ********************* 31 | 32 | (UseNormalization "true") 33 | 34 | // ******************** Multiresolution ********************** 35 | 36 | (NumberOfResolutions 1) 37 | 38 | // ******************* Optimizer **************************** 39 | 40 | (MaximumNumberOfIterations 10) 41 | (MaximumStepLength 1.0) 42 | (StepTolerance 0.0001) 43 | (ValueTolerance 0.000001) 44 | 45 | // **************** Image sampling ********************** 46 | 47 | (ImageSampler "Full") 48 | (NewSamplesEveryIteration "false") 49 | 50 | // ************* Interpolation and Resampling **************** 51 | 52 | (Origin -145.498 -146.889 381.766) 53 | 54 | (Interpolator0PreParameters -0.009475 -0.006807 -0.030067 0.0 0.0 0.0) 55 | (ResampleInterpolator0PreParameters -0.009475 -0.006807 -0.030067 0.0 0.0 0.0) 56 | 57 | (Interpolator0FocalPoint 0.54 -0.85 -813.234) 58 | (ResampleInterpolator0FocalPoint 0.54 -0.85 -813.234) 59 | 60 | (Threshold 1000) 61 | 62 | (DefaultPixelValue 0) 63 | 64 | (WriteResultImage "true") 65 | (WriteTransformParametersEachIteration "true") 66 | 67 | (ResultImagePixelType "float") 68 | (ResultImageFormat "mhd") 69 | 70 | 71 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0032_bsplines.txt: -------------------------------------------------------------------------------- 1 | (FixedInternalImagePixelType "short") 2 | (MovingInternalImagePixelType "short") 3 | 4 | // **************** Main Components ************************** 5 | 6 | (Registration "MultiResolutionRegistration") 7 | (Interpolator "BSplineInterpolator") 8 | (ResampleInterpolator "FinalBSplineInterpolator") 9 | (Resampler "DefaultResampler") 10 | (FixedImagePyramid "FixedRecursiveImagePyramid") 11 | (MovingImagePyramid "MovingRecursiveImagePyramid") 12 | (Optimizer "AdaptiveStochasticGradientDescent") 13 | (Transform "BSplineTransform") 14 | (Metric "AdvancedMattesMutualInformation") 15 | 16 | // ***************** Transformation ************************** 17 | 18 | (FinalGridSpacingInPhysicalUnits 40) 19 | //(FinalGridSpacingInVoxels 16) 20 | 21 | // By default the grid spacing is halved after every resolution, 22 | // such that the final grid spacing is obtained in the last 23 | // resolution level. You can also specify your own schedule, 24 | // if you uncomment the following line: 25 | //(GridSpacingSchedule 4.0 4.0 2.0 1.0) 26 | // This setting can also be supplied per dimension. 27 | 28 | (HowToCombineTransforms "Compose") 29 | 30 | //Save composite ITK transform 31 | (ITKTransformOutputFileNameExtension "h5") 32 | (WriteITKCompositeTransform "true") 33 | 34 | // ******************* Similarity measure ********************* 35 | 36 | (NumberOfHistogramBins 32) 37 | (ErodeMask "false") 38 | 39 | // ******************** Multiresolution ********************** 40 | 41 | (NumberOfResolutions 3) 42 | (ImagePyramidSchedule 4 4 4 2 2 2 1 1 1 ) 43 | 44 | // ******************* Optimizer **************************** 45 | 46 | (MaximumNumberOfIterations 500) 47 | 48 | // **************** Image sampling ********************** 49 | 50 | // Number of spatial samples used to compute the mutual 51 | // information (and its derivative) in each iteration. 52 | // With an AdaptiveStochasticGradientDescent optimizer, 53 | // in combination with the two options below, around 2000 54 | // samples may already suffice. 55 | (NumberOfSpatialSamples 5000) 56 | (NewSamplesEveryIteration "true") 57 | (ImageSampler "Random") 58 | 59 | // ************* Interpolation and Resampling **************** 60 | 61 | (BSplineInterpolationOrder 1) 62 | (FinalBSplineInterpolationOrder 1) 63 | (DefaultPixelValue 0) 64 | (WriteResultImage "true") 65 | (ResultImagePixelType "unsigned short") 66 | (ResultImageFormat "mhd") 67 | (CompressResultImage "true") 68 | 69 | 70 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0032_rigid.txt: -------------------------------------------------------------------------------- 1 | (FixedInternalImagePixelType "short") 2 | (MovingInternalImagePixelType "short") 3 | 4 | // **************** Main Components ************************** 5 | 6 | (Registration "MultiResolutionRegistration") 7 | (Interpolator "BSplineInterpolator") 8 | (ResampleInterpolator "FinalBSplineInterpolator") 9 | (Resampler "DefaultResampler") 10 | 11 | (FixedImagePyramid "FixedRecursiveImagePyramid") 12 | (MovingImagePyramid "MovingRecursiveImagePyramid") 13 | 14 | (Optimizer "AdaptiveStochasticGradientDescent") 15 | (Transform "EulerTransform") 16 | (Metric "AdvancedMattesMutualInformation") 17 | 18 | // ***************** Transformation ************************** 19 | 20 | (AutomaticScalesEstimation "true") 21 | (AutomaticTransformInitialization "true") 22 | (HowToCombineTransforms "Compose") 23 | 24 | //Save composite ITK transform 25 | (ITKTransformOutputFileNameExtension "h5") 26 | (WriteITKCompositeTransform "true") 27 | 28 | // ******************* Similarity measure ********************* 29 | 30 | (NumberOfHistogramBins 32) 31 | (ErodeMask "false") 32 | 33 | // ******************** Multiresolution ********************** 34 | 35 | (NumberOfResolutions 3) 36 | (ImagePyramidSchedule 4 4 4 2 2 2 1 1 1 ) 37 | 38 | // ******************* Optimizer **************************** 39 | 40 | (MaximumNumberOfIterations 250) 41 | 42 | // The step size of the optimizer, in mm. By default the voxel size is used. 43 | // which usually works well. In case of unusual high-resolution images 44 | // (eg histology) it is necessary to increase this value a bit, to the size 45 | // of the "smallest visible structure" in the image: 46 | //(MaximumStepLength 1.0) 47 | 48 | // **************** Image sampling ********************** 49 | 50 | (NumberOfSpatialSamples 10000) 51 | (NewSamplesEveryIteration "true") 52 | (ImageSampler "Random") 53 | 54 | // ************* Interpolation and Resampling **************** 55 | 56 | (BSplineInterpolationOrder 1) 57 | (FinalBSplineInterpolationOrder 1) 58 | (DefaultPixelValue 0) 59 | (WriteResultImage "false") 60 | (ResultImagePixelType "unsigned short") 61 | (ResultImageFormat "mhd") 62 | (CompressResultImage "true") 63 | 64 | 65 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0033bspline.txt: -------------------------------------------------------------------------------- 1 | // BSplinePar 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // **************** Main Components ************************** 7 | 8 | //(Registration "MultiResolutionRegistration") 9 | (Registration "MultiMetricMultiResolutionRegistration") 10 | (Interpolator "BSplineInterpolator") 11 | (ResampleInterpolator "FinalBSplineInterpolator") 12 | (Resampler "DefaultResampler") 13 | 14 | //(FixedImagePyramid "FixedRecursiveImagePyramid") 15 | //(MovingImagePyramid "MovingRecursiveImagePyramid") 16 | (FixedImagePyramid "FixedSmoothingImagePyramid") 17 | (MovingImagePyramid "MovingSmoothingImagePyramid") 18 | 19 | (Optimizer "AdaptiveStochasticGradientDescent") 20 | (Transform "BSplineTransform") 21 | (Metric "AdvancedMattesMutualInformation" "TransformBendingEnergyPenalty") 22 | 23 | 24 | // ***************** Transformation ************************** 25 | 26 | //(FinalGridSpacingInPhysicalUnits 4) 27 | 28 | (FinalGridSpacingInVoxels 5 5 5) 29 | (GridSpacingSchedule 8 4 2 1) 30 | 31 | //(GridSpacingSchedule 2 2 1 1) 32 | //(GridSpacingSchedule 6.0 4.0 2.5 1.0) 33 | 34 | (HowToCombineTransforms "Compose") 35 | 36 | //Save composite ITK transform 37 | (ITKTransformOutputFileNameExtension "h5") 38 | (WriteITKCompositeTransform "true") 39 | 40 | // ******************* Similarity measure ********************* 41 | 42 | (NumberOfHistogramBins 32) 43 | 44 | // If you use a mask, this option is important. 45 | // If the mask serves as region of interest, set it to false. 46 | // If the mask indicates which pixels are valid, then set it to true. 47 | // If you do not use a mask, the option doesn't matter. 48 | (ErodeMask "false") 49 | (Metric0Weight 1.0) 50 | (Metric1Weight 0.2) 51 | 52 | // ******************** Multiresolution ********************** 53 | 54 | (NumberOfResolutions 4) 55 | 56 | //(ImagePyramidSchedule 0 0 0 0 0 0 0 0 0 0 0 0) 57 | (FixedImagePyramidSchedule 0 0 0 0 0 0 0 0 0 0 0 0) 58 | (MovingImagePyramidSchedule 1 1 1 1 1 1 0 0 0 0 0 0) 59 | 60 | // ******************* Optimizer **************************** 61 | 62 | (MaximumNumberOfIterations 1000) 63 | 64 | 65 | (MaximumStepLength 0.015) 66 | // the voxel size one -> 0.07 67 | // **************** Image sampling ********************** 68 | 69 | (NumberOfSpatialSamples 2048) 70 | 71 | (NewSamplesEveryIteration "true") 72 | (ImageSampler "RandomCoordinate") 73 | 74 | 75 | // ************* Interpolation and Resampling **************** 76 | 77 | (BSplineInterpolationOrder 1) 78 | (FinalBSplineInterpolationOrder 3) 79 | 80 | (DefaultPixelValue 0) 81 | 82 | // Choose whether to generate the deformed moving image. 83 | // You can save some time by setting this to false, if you are 84 | // not interested in the final deformed moving image, but only 85 | // want to analyze the deformation field for example. 86 | (WriteResultImage "true") 87 | 88 | // The pixel type and format of the resulting deformed moving image 89 | (ResultImagePixelType "float") 90 | (ResultImageFormat "mhd") 91 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0033similarity.txt: -------------------------------------------------------------------------------- 1 | // SimilarityTransform 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // **************** Main Components ************************** 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (Interpolator "BSplineInterpolator") 10 | (ResampleInterpolator "FinalBSplineInterpolator") 11 | (Resampler "DefaultResampler") 12 | 13 | //(FixedImagePyramid "FixedSmoothingImagePyramid") 14 | //(MovingImagePyramid "MovingSmoothingImagePyramid") 15 | (FixedImagePyramid "FixedRecursiveImagePyramid") 16 | (MovingImagePyramid "MovingRecursiveImagePyramid") 17 | 18 | (Optimizer "AdaptiveStochasticGradientDescent") 19 | (Transform "SimilarityTransform") 20 | (Metric "AdvancedMattesMutualInformation") 21 | //(Metric "AdvancedNormalizedCorrelation") 22 | 23 | 24 | // ***************** Transformation ************************** 25 | 26 | (AutomaticScalesEstimation "true") 27 | 28 | (AutomaticTransformInitializationMethod "CenterOfGravity") 29 | 30 | (AutomaticTransformInitialization "true") 31 | 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ******************* Similarity measure ********************* 40 | 41 | (NumberOfHistogramBins 32) 42 | 43 | // If you use a mask, this option is important. 44 | // If the mask serves as region of interest, set it to false. 45 | // If the mask indicates which pixels are valid, then set it to true. 46 | (ErodeMask "false") 47 | 48 | 49 | // ******************** Multiresolution ********************** 50 | 51 | (NumberOfResolutions 2) 52 | 53 | (ImagePyramidSchedule 1 1 1 1 1 1 1 1 1 1 1 1) 54 | 55 | 56 | // ******************* Optimizer **************************** 57 | 58 | (MaximumNumberOfIterations 1000) 59 | 60 | (MaximumStepLength 0.2) 61 | 62 | 63 | // **************** Image sampling ********************** 64 | 65 | (NumberOfSpatialSamples 2048) 66 | 67 | (NewSamplesEveryIteration "true") 68 | (ImageSampler "RandomCoordinate") 69 | //(ImageSampler "Random") 70 | 71 | // ************* Interpolation and Resampling **************** 72 | 73 | (BSplineInterpolationOrder 1) 74 | (FinalBSplineInterpolationOrder 3) 75 | 76 | (DefaultPixelValue 0) 77 | 78 | // Choose whether to generate the deformed moving image. 79 | // You can save some time by setting this to false, if you are 80 | // only interested in the final (nonrigidly) deformed moving image 81 | // for example. 82 | (WriteResultImage "true") 83 | 84 | // The pixel type and format of the resulting deformed moving image 85 | (ResultImagePixelType "float") 86 | (ResultImageFormat "mhd") 87 | 88 | 89 | (RequiredRatioOfValidSamples 0.001) -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0043rigid.txt: -------------------------------------------------------------------------------- 1 | //Parameter file 2 | 3 | //**********ImageTypes********** 4 | 5 | // The internal pixel type, used for internal computations 6 | // Leave to float in general. 7 | // NB: this is not the type of the input images! The pixel 8 | // type of the input images is automatically read from the 9 | // images themselves. 10 | // This setting can be changed to "short" to save some memory 11 | // in case of very large 3D images. 12 | (FixedInternalImagePixelType "float") 13 | (MovingInternalImagePixelType "float") 14 | 15 | //*********Components********** 16 | 17 | (Registration "MultiResolutionRegistration") 18 | 19 | //***Interpolator 20 | //(Interpolator "BSplineInterpolator") 21 | (Interpolator "LinearInterpolator") 22 | //***Resampler 23 | (Resampler "DefaultResampler") 24 | (ResampleInterpolator "FinalBSplineInterpolator") 25 | //(ResampleInterpolator "LinearInterpolator") 26 | 27 | (FixedImagePyramid "FixedRecursiveImagePyramid") 28 | (MovingImagePyramid "MovingRecursiveImagePyramid") 29 | //(FixedImagePyramid "FixedSmoothingImagePyramid") 30 | //(MovingImagePyramid "MovingSmoothingImagePyramid") 31 | //(FixedImagePyramid "FixedShrinkingImagePyramid") 32 | //(MovingImagePyramid "MovingShrinkingImagePyramid") 33 | 34 | // The following components are most important: 35 | // The optimizer AdaptiveStochasticGradientDescent (ASGD) works 36 | // quite ok in general. The Transform and Metric are important 37 | // and need to be chosen careful for each application. See manual. 38 | (Transform "EulerTransform") 39 | (Sampler "RandomCoordinate") 40 | (Optimizer "AdaptiveStochasticGradientDescent") 41 | (Metric "AdvancedMattesMutualInformation") 42 | 43 | //************Transform************ 44 | 45 | // Scales the rotations compared to the translations, to make 46 | // sure they are in the same range. In general, it's best to 47 | // use automatic scales estimation: 48 | (AutomaticScalesEstimation "true") 49 | 50 | // Automatically guess an initial translation by aligning the 51 | // geometric centers of the fixed and moving. 52 | (AutomaticTransformInitialization "true") 53 | 54 | // Whether transforms are combined by composition or by addition. 55 | // In generally, Compose is the best option in most cases. 56 | // It does not influence the results very much. 57 | (HowToCombineTransforms "Compose") 58 | 59 | //Save composite ITK transform 60 | (ITKTransformOutputFileNameExtension "h5") 61 | (WriteITKCompositeTransform "true") 62 | //(AutomaticTransformInitializationMethod "CenterOfGravity") 63 | 64 | 65 | //************Similarity Measure************ 66 | 67 | // Number of grey level bins in each resolution level, 68 | // for the mutual information. 16 or 32 usually works fine. 69 | // You could also employ a hierarchical strategy: 70 | (NumberOfHistogramBins 16 32 32 64) 71 | //(NumberOfHistogramBins 32) 72 | 73 | 74 | //**************Multiresolution ********************** 75 | 76 | // The number of resolutions. 1 Is only enough if the expected 77 | // deformations are small. 3 or 4 mostly works fine. For large 78 | // images and large deformations, 5 or 6 may even be useful. 79 | (NumberOfResolutions 4) 80 | (ImagePyramidSchedule 8 8 8 4 4 4 2 2 2 1 1 1 ) 81 | //(FinalGridSpacingInVoxels 1.0 1.0 1.0) 82 | //(GridSpacingSchedule 6.0 6.0 6.0 3.0 3.0 3.0 1.0 1.0 1.0) 83 | // Make sure that the number of elements equals the number 84 | // of resolutions times the image dimension 85 | 86 | 87 | // ******************* Optimizer **************************** 88 | 89 | // Maximum number of iterations in each resolution level: 90 | // 200-500 works usually fine for rigid registration. 91 | // For more robustness, you may increase this to 1000-2000. 92 | (MaximumNumberOfIterations 1000 1000 1500 1500) 93 | 94 | // The step size of the optimizer, in mm. By default the voxel size is used. 95 | // which usually works well. In case of unusual high-resolution images 96 | // (eg histology) it is necessary to increase this value a bit, to the size 97 | // of the "smallest visible structure" in the image: 98 | //(MaximumStepLength 1.0) 99 | 100 | 101 | //************Image Sampling************ 102 | 103 | // Number of spatial samples used to compute the mutual 104 | // information (and its derivative) in each iteration. 105 | // With an AdaptiveStochasticGradientDescent optimizer, 106 | // in combination with the two options below, around 2000 107 | // samples may already suffice. 108 | (NumberOfSpatialSamples 2048) 109 | 110 | // Refresh these spatial samples in every iteration, and select 111 | // them randomly. See the manual for information on other sampling 112 | // strategies. 113 | (NewSamplesEveryIteration "true") 114 | (ImageSampler "RandomCoordinate") 115 | 116 | (FixedImageBSplineInterpolationOrder 1) 117 | (UseRandomSampleRegion "true") 118 | //(SampleRegionSize 50 50 50) 119 | 120 | // ************* Interpolation and Resampling **************** 121 | 122 | // Order of B-Spline interpolation used during registration/optimisation. 123 | // It may improve accuracy if you set this to 3. Never use 0. 124 | // An order of 1 gives linear interpolation. This is in most 125 | // applications a good choice. 126 | (BSplineInterpolationOrder 1) 127 | 128 | // Order of B-Spline interpolation used for applying the final 129 | // deformation. 130 | // 3 gives good accuracy; recommended in most cases. 131 | // 1 gives worse accuracy (linear interpolation) 132 | // 0 gives worst accuracy, but is appropriate for binary images 133 | // (masks, segmentations); equivalent to nearest neighbor interpolation. 134 | (FinalBSplineInterpolationOrder 3) 135 | 136 | //Default pixel value for pixels that come from outside the picture: 137 | (DefaultPixelValue -1024) 138 | 139 | //************Output*************** 140 | 141 | // Write resulting images. You can save some time by setting this to false, if you are only interested in the final deformed moving image for example. 142 | (WriteResultImage "true") 143 | 144 | //***********MiscVisulaization 145 | (WriteTransformParametersEachIteration "false" "false" "false" "false") 146 | (WriteTransformParametersEachResolution "true" "true" "true" "true") 147 | 148 | // Define output format 149 | //(ResultImagePixelType "double") 150 | (ResultImageFormat "mhd") 151 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0044Affine.txt: -------------------------------------------------------------------------------- 1 | // Affine Tranformation 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (MovingInternalImagePixelType "float") 6 | 7 | //Components 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (ResampleInterpolator "FinalBSplineInterpolator") 13 | (Resampler "DefaultResampler") 14 | (Transform "AffineTransform") 15 | (Optimizer "AdaptiveStochasticGradientDescent") 16 | (Metric "AdvancedMattesMutualInformation") 17 | 18 | 19 | // Scales the rotations compared to the translations, to make 20 | // sure they are in the same range. The higher this parameter, 21 | // the smaller the changes in rotation angle in each iteration. 22 | // If you have the feeling that rotations are not found by elastix, 23 | // decrease it; if elastix crashes after a few iterations, with 24 | // the message that all samples map outside the moving image 25 | // buffer, you may have to increase this parameter. 26 | //(Scales 50000.0) 27 | // Better use automatic scales estimation 28 | (AutomaticScalesEstimation "true") 29 | // Automatically guess an initial translation. 30 | (AutomaticTransformInitialization "true") 31 | 32 | // The number of resolutions. 33 | // 1 Is only enough if the expected deformations are small. 3 or 4 mostly works fine. 34 | // Less smoothing in Z-direction 35 | (NumberOfResolutions 3) 36 | (ImagePyramidSchedule 4 4 4 2 2 2 1 1 1 ) 37 | 38 | // If you use a mask, this option is important. You can 39 | // set it for each resolution differently. 40 | // If the mask serves as region of interest, set it to false. 41 | // If the mask indicates which pixels are valid, then set it to true. 42 | // If you do not use a mask, the option doesn't matter. 43 | (ErodeMask "false" ) 44 | 45 | // Whether transforms are combined by composition or by addition. 46 | // In generally, Compose is the best option in most cases. 47 | // It does not influence the results very much. 48 | (HowToCombineTransforms "Compose") 49 | 50 | //Save composite ITK transform 51 | (ITKTransformOutputFileNameExtension "h5") 52 | (WriteITKCompositeTransform "true") 53 | 54 | // Number of spatial samples used 55 | (ImageSampler "RandomCoordinate") 56 | (FixedImageBSplineInterpolationOrder 3 ) 57 | (UseRandomSampleRegion "false") 58 | (NewSamplesEveryIteration "true") 59 | (CheckNumberOfSamples "false") 60 | (MaximumNumberOfSamplingAttempts 10) 61 | (NumberOfSpatialSamples 2048 ) 62 | 63 | 64 | //Number of grey level bins in each resolution level, 65 | // for the mutual information. 16 or 32 usually works fine. 66 | (NumberOfHistogramBins 32 ) 67 | (FixedLimitRangeRatio 0.0) 68 | (MovingLimitRangeRatio 0.0) 69 | (FixedKernelBSplineOrder 3) 70 | (MovingKernelBSplineOrder 3) 71 | 72 | //Order of B-Spline interpolation used in each resolution level: 73 | // It may improve accuracy if you set this to 3. Never use 0. 74 | (BSplineInterpolationOrder 1) 75 | 76 | //Order of B-Spline interpolation used for applying the final 77 | // deformation. 78 | // 3 gives good accuracy. 79 | // 1 gives worse accuracy (linear interpolation) 80 | // 0 gives worst accuracy, but may be appropriate for 81 | // binary images; this would be equivalent to nearest neighbor 82 | // interpolation. 83 | (FinalBSplineInterpolationOrder 0) 84 | 85 | //Default pixel value for pixels that come from outside the picture: 86 | (DefaultPixelValue 0) 87 | 88 | 89 | // The following parameters are for the StandardGradientDescent 90 | // optimizer. They determine the step size. 91 | // Especially SP_a needs to be tuned for each specific application. 92 | // The number of iterations is also important. 93 | 94 | //Maximum step size of the RSGD optimizer for each resolution level. 95 | // The higher you set this, the more aggressive steps are taken. 96 | (MaximumStepLength 0.7 ) 97 | 98 | (WriteTransformParametersEachIteration "false") 99 | (WriteResultImage "true") 100 | (CompressResultImage "false") 101 | (WriteResultImageAfterEachResolution "false") 102 | (ShowExactMetricValue "false") 103 | 104 | //Maximum number of iterations in each resolution level: 105 | // 100-500 works usually fine. 106 | (MaximumNumberOfIterations 512 ) 107 | 108 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 109 | // For MI, NC, NMI, you could start around a = 1000.0 110 | //(SP_a 1000.0 ) 111 | 112 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 113 | (SP_A 20.0 ) 114 | 115 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 116 | (SP_alpha 1.0 ) 117 | 118 | 119 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Par0044NonRigid.txt: -------------------------------------------------------------------------------- 1 | // B-Spline transformation 2 | 3 | //ImageTypes 4 | (FixedInternalImagePixelType "float") 5 | (MovingInternalImagePixelType "float") 6 | 7 | //Components 8 | (Registration "MultiMetricMultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid" "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid" "MovingRecursiveImagePyramid") 11 | (Transform "BSplineTransform") 12 | (Interpolator "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator" "BSplineInterpolator") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Metric "AdvancedMattesMutualInformation" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares" "AdvancedMeanSquares") 17 | 18 | (Metric0Weight 1.0) 19 | (Metric1Weight 1.0) 20 | (Metric2Weight 1.0) 21 | (Metric3Weight 1.0) 22 | (Metric4Weight 1.0) 23 | (Metric5Weight 1.0) 24 | (Metric6Weight 1.0) 25 | (Metric7Weight 1.0) 26 | (Metric8Weight 1.0) 27 | (Metric9Weight 1.0) 28 | (Metric10Weight 1.0) 29 | (Metric11Weight 1.0) 30 | 31 | // ::::::::::::::::::::::::::::: Parameters to tune ::::::::::::::::::::::::::::::::::::::: 32 | 33 | // :::: Pyramid 34 | (NumberOfResolutions 3) 35 | (ImagePyramidSchedule 4 4 4 2 2 2 1 1 1) 36 | 37 | 38 | // :::: Optimizer - StandardGradientDescent :::: 39 | 40 | // Maximum number of iterations 41 | (MaximumNumberOfIterations 2048) 42 | 43 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 44 | // MI around 1000.0 45 | (SP_a 10000.0 ) 46 | 47 | 48 | // :::: ImageSampler :::: 49 | 50 | // Number of sample (2000 - 5000) 51 | (NumberOfSpatialSamples 2048 ) 52 | 53 | // If UseRandomSampleRegion is set to "false", the sampler draws samples from the entire image domain. 54 | // When set to "true", the sampler randomly selects one voxel, and then selects the remaining 55 | // samples in a square neighbourhood (in mm) around that voxel (localized similarity measure). 56 | (UseRandomSampleRegion "true") 57 | (SampleRegionSize 50.0 50.0 50.0) 58 | 59 | 60 | // :::: Transform :::: 61 | // Grid of control points 62 | // This grid is defined by the spacing between the grid nodes, in voxel size 63 | // For each resolution level you can define a different grid spacing. This is what we call multi-grid. 64 | // The GridSpacingSchedule defines the multiplication factors for all resolution levels. 65 | (FinalGridSpacingInPhysicalUnits 12.0 12.0 12.0) 66 | (GridSpacingSchedule 4.0 4.0 4.0 2.0 2.0 2.0 1.0 1.0 1.0) 67 | 68 | 69 | // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 70 | 71 | 72 | // :::: Transform :::: 73 | // Whether transforms are combined by composition or by addition. 74 | // In generally, Compose is the best option in most cases. 75 | // It does not influence the results very much. 76 | (HowToCombineTransforms "Compose") 77 | 78 | //Save composite ITK transform 79 | (ITKTransformOutputFileNameExtension "h5") 80 | (WriteITKCompositeTransform "true") 81 | 82 | 83 | // :::: Several :::: 84 | (ErodeMask "false" ) 85 | (WriteTransformParametersEachIteration "false") 86 | (WriteResultImage "true") 87 | (CompressResultImage "true") 88 | (WriteResultImageAfterEachResolution "false") 89 | (ShowExactMetricValue "false") 90 | 91 | 92 | // :::: Metric :::: 93 | //Number of grey level bins in each resolution level: 94 | (NumberOfHistogramBins 32 ) 95 | (FixedLimitRangeRatio 0.0) 96 | (MovingLimitRangeRatio 0.0) 97 | (FixedKernelBSplineOrder 3) 98 | (MovingKernelBSplineOrder 3) 99 | (UseFastAndLowMemoryVersion "true") 100 | 101 | 102 | // :::: ImageSampler :::: 103 | (ImageSampler "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate" "RandomCoordinate") 104 | (FixedImageBSplineInterpolationOrder 1 ) 105 | (NewSamplesEveryIteration "true") 106 | (CheckNumberOfSamples "false") 107 | (MaximumNumberOfSamplingAttempts 10) 108 | 109 | 110 | // :::: Optimizer - StandardGradientDescent :::: 111 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 112 | (SP_A 100.0 ) 113 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 114 | (SP_alpha 0.6 ) 115 | 116 | 117 | // :::: Interpolator and Resampler :::: 118 | //Order of B-Spline interpolation used in each resolution level: 119 | // It may improve accuracy if you set this to 3. Never use 0. 120 | (BSplineInterpolationOrder 1) 121 | 122 | //Order of B-Spline interpolation used for applying the final 123 | // deformation. 124 | // 3 gives good accuracy. 125 | // 1 gives worse accuracy (linear interpolation) 126 | // 0 gives worst accuracy, but may be appropriate for 127 | // binary images; this would be equivalent to nearest neighbor 128 | // interpolation. 129 | (FinalBSplineInterpolationOrder 0) 130 | 131 | //Default pixel value for pixels that come from outside the picture: 132 | (DefaultPixelValue 0.000000) 133 | 134 | (MaximumStepLength 0.7) 135 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.MI.Coarse.Bspline_tuned.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedRecursiveImagePyramid") 13 | (MovingImagePyramid "MovingRecursiveImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 5) 26 | (ImagePyramidSchedule 16 16 16 8 8 8 4 4 4 2 2 2 1 1 1) 27 | //16mm 8mm 4mm 2mm 1mm 28 | 29 | // ********** Transform 30 | 31 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 32 | (GridSpacingSchedule 16.0 8.0 4.0 2.0 1.0) 33 | //160mm every 10 voxel, 80mm, every 10 voxel, 40mm, every 10 voxel, 20mm, every 10 voxel, 10mm, every 10 voxel 34 | (HowToCombineTransforms "Compose") 35 | 36 | //Save composite ITK transform 37 | (ITKTransformOutputFileNameExtension "h5") 38 | (WriteITKCompositeTransform "true") 39 | 40 | 41 | // ********** Optimizer 42 | 43 | // Maximum number of iterations in each resolution level: 44 | (MaximumNumberOfIterations 500) 45 | 46 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 47 | (SP_a 10000.0 10000.0 5000.0 1000.0 1000.0) 48 | //(SP_a 8000.0 2000.0 2000.0 2000.0 2000.0) 49 | 50 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 51 | (SP_alpha 0.6) 52 | 53 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 54 | (SP_A 50.0) 55 | 56 | 57 | // ********** Metric 58 | 59 | (NumberOfHistogramBins 32 32 32 32 32) 60 | (UseFastAndLowMemoryVersion "true") 61 | 62 | 63 | // ********** Several 64 | 65 | (WriteTransformParametersEachIteration "false") 66 | (WriteTransformParametersEachResolution "true") 67 | (WriteResultImageAfterEachResolution "false") 68 | (WriteResultImage "true") 69 | (ShowExactMetricValue "false") 70 | (ErodeMask "false") 71 | 72 | 73 | // ********** ImageSampler 74 | 75 | //Number of spatial samples used to compute the mutual information in each resolution level: 76 | (ImageSampler "RandomCoordinate") 77 | (NumberOfSpatialSamples 2000) 78 | (NewSamplesEveryIteration "true") 79 | //(UseRandomSampleRegion "true") 80 | //(SampleRegionSize 50.0 50.0 50.0) 81 | //(MaximumNumberOfSamplingAttempts 50) 82 | 83 | 84 | // ********** Interpolator and Resampler 85 | 86 | //Order of B-Spline interpolation used in each resolution level: 87 | (BSplineInterpolationOrder 1) 88 | 89 | //Order of B-Spline interpolation used for applying the final deformation: 90 | (FinalBSplineInterpolationOrder 3) 91 | 92 | //Default pixel value for pixels that come from outside the picture: 93 | (DefaultPixelValue 0) 94 | 95 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.MI.Fine.Bspline_tuned.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedRecursiveImagePyramid") 13 | (MovingImagePyramid "MovingRecursiveImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedMattesMutualInformation") 16 | (Optimizer "StandardGradientDescent") 17 | (ResampleInterpolator "FinalBSplineInterpolator") 18 | (Resampler "DefaultResampler") 19 | (Transform "BSplineTransform") 20 | 21 | 22 | // ********** Pyramid 23 | 24 | // Total number of resolutions 25 | (NumberOfResolutions 2) 26 | (ImagePyramidSchedule 1 1 1 1 1 1) 27 | 28 | 29 | // ********** Transform 30 | (FinalGridSpacingInPhysicalUnits 5.0 5.0 5.0) 31 | (GridSpacingSchedule 2.0 1.0) 32 | (HowToCombineTransforms "Compose") 33 | 34 | //Save composite ITK transform 35 | (ITKTransformOutputFileNameExtension "h5") 36 | (WriteITKCompositeTransform "true") 37 | 38 | 39 | // ********** Optimizer 40 | 41 | // Maximum number of iterations in each resolution level: 42 | (MaximumNumberOfIterations 100) 43 | 44 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 45 | (SP_a 2000.0 2000.0) 46 | //(SP_a 8000.0 2000.0 2000.0 2000.0 2000.0) 47 | 48 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 49 | (SP_alpha 0.6) 50 | 51 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 52 | (SP_A 50.0) 53 | 54 | 55 | // ********** Metric 56 | 57 | (NumberOfHistogramBins 64 64) 58 | (UseFastAndLowMemoryVersion "true") 59 | 60 | 61 | // ********** Several 62 | 63 | (WriteTransformParametersEachIteration "false") 64 | (WriteTransformParametersEachResolution "true") 65 | (WriteResultImageAfterEachResolution "false") 66 | (WriteResultImage "true") 67 | (ShowExactMetricValue "false") 68 | (ErodeMask "false") 69 | 70 | 71 | // ********** ImageSampler 72 | 73 | //Number of spatial samples used to compute the mutual information in each resolution level: 74 | (ImageSampler "RandomCoordinate") 75 | (NumberOfSpatialSamples 5000) 76 | (NewSamplesEveryIteration "true") 77 | //(UseRandomSampleRegion "true") 78 | //(SampleRegionSize 50.0 50.0 50.0) 79 | //(MaximumNumberOfSamplingAttempts 50) 80 | 81 | 82 | // ********** Interpolator and Resampler 83 | 84 | //Order of B-Spline interpolation used in each resolution level: 85 | (BSplineInterpolationOrder 1) 86 | 87 | //Order of B-Spline interpolation used for applying the final deformation: 88 | (FinalBSplineInterpolationOrder 3) 89 | 90 | //Default pixel value for pixels that come from outside the picture: 91 | (DefaultPixelValue -1000) 92 | 93 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.MI.RP.Bspline_tuned.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiResolutionRegistration") 12 | (FixedImagePyramid "FixedRecursiveImagePyramid") 13 | (MovingImagePyramid "MovingRecursiveImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | //(Metric "AdvancedMattesMutualInformation") 16 | (Metric "MattesMutualInformationWithRigidityPenalty") 17 | (Optimizer "StandardGradientDescent") 18 | (ResampleInterpolator "FinalBSplineInterpolator") 19 | (Resampler "DefaultResampler") 20 | (Transform "BSplineTransform") 21 | 22 | 23 | // ********** Pyramid 24 | 25 | // Total number of resolutions 26 | // (NumberOfResolutions 2) 27 | // (ImagePyramidSchedule 4 4 4 1 1 1) 28 | (NumberOfResolutions 6) 29 | (ImagePyramidSchedule 16 16 16 8 8 8 4 4 4 2 2 2 1 1 1 1 1 1) 30 | 31 | // ********** Transform 32 | 33 | // (FinalGridSpacingInPhysicalUnits 8.0 8.0 8.0) 34 | // (GridSpacingSchedule 16.0 8.0 4.0 2.0 1.0) 35 | (FinalGridSpacingInPhysicalUnits 4.0 4.0 4.0) 36 | (GridSpacingSchedule 32.0 16.0 8.0 4.0 2.0 1.0) 37 | (HowToCombineTransforms "Compose") 38 | 39 | //Save composite ITK transform 40 | (ITKTransformOutputFileNameExtension "h5") 41 | (WriteITKCompositeTransform "true") 42 | 43 | 44 | // ********** Optimizer 45 | 46 | // Maximum number of iterations in each resolution level: 47 | (MaximumNumberOfIterations 500 500 500 500 20 20) 48 | 49 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 50 | //good(SP_a 50000.0 30000.0 10000.0 10000.0 5000.0) 51 | //from paper 52 | (SP_a 50000.0 10000.0 2000.0 500.0 100.0 100.0) 53 | 54 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 55 | (SP_alpha 0.6) 56 | 57 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 58 | (SP_A 50.0) 59 | 60 | 61 | // ********** Metric 62 | 63 | (NumberOfHistogramBins 16 32 32 32 32 32) 64 | (UseFastAndLowMemoryVersion "true") 65 | //RigidPenaly 66 | //RigidityPenaltyWeight: A parameter to weigh the rigidity penalty term against the mutual information metric. 67 | (RigidityPenaltyWeight 4.0) 68 | 69 | //LinearityConditionWeight: A parameter to weigh the linearity condition term of the rigidity term. 70 | (LinearityConditionWeight 100.0) 71 | //OrthonormalityConditionWeight: A parameter to weigh the orthonormality condition term of the rigidity term. 72 | (OrthonormalityConditionWeight 1.0) 73 | //PropernessConditionWeight: A parameter to weigh the properness condition term of the rigidity term. 74 | (PropernessConditionWeight 2.0) 75 | //UseFixedRigidityImage: flag to specify the use of the fixed rigidity image when calculating the rigidity coefficient image. 76 | (UseFixedRigidityImage "true") 77 | //FixedRigidityImageName: the name of a coefficient image to specify the rigidity index of voxels in the fixed image. 78 | (FixedRigidityImageName "/max/home00/kding/lungmech/2009_04_20_4DCTPulmonaryFunction/CASE8/resample/BeforeRT_Static-tumorphantom.nii.gz") 79 | //UseMovingRigidityImage: flag to specify the use of the moving rigidity image when calculating the rigidity coefficient image. 80 | (UseMovingRigidityImage "false") 81 | //DilateRigidityImages: flag to specify the dilation of the rigidity coefficient images. With this the region of rigidity can be extended to force rigidity of the inner region. 82 | (DilateRigidityImages "false") 83 | 84 | 85 | // ********** Several 86 | 87 | (WriteTransformParametersEachIteration "false") 88 | (WriteTransformParametersEachResolution "true") 89 | (WriteResultImageAfterEachResolution "false") 90 | (WriteResultImage "true") 91 | (ShowExactMetricValue "false") 92 | (ErodeMask "false") 93 | 94 | 95 | // ********** ImageSampler 96 | 97 | //Number of spatial samples used to compute the mutual information in each resolution level: 98 | (ImageSampler "RandomCoordinate") 99 | (NumberOfSpatialSamples 5000) 100 | (NewSamplesEveryIteration "true") 101 | //(UseRandomSampleRegion "true") 102 | //(SampleRegionSize 50.0 50.0 50.0) 103 | //(MaximumNumberOfSamplingAttempts 50) 104 | 105 | 106 | // ********** Interpolator and Resampler 107 | 108 | //Order of B-Spline interpolation used in each resolution level: 109 | (BSplineInterpolationOrder 1) 110 | 111 | //Order of B-Spline interpolation used for applying the final deformation: 112 | (FinalBSplineInterpolationOrder 3) 113 | 114 | //Default pixel value for pixels that come from outside the picture: 115 | (DefaultPixelValue 0) 116 | 117 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.NCC.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedSmoothingImagePyramid") 10 | (MovingImagePyramid "MovingSmoothingImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 6) 23 | (ImagePyramidSchedule 16 16 16 16 16 16 8 8 8 4 4 4 2 2 2 1 1 1) 24 | 25 | // ********** Transform 26 | 27 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 28 | (GridSpacingSchedule 16 8 8 4 2 1) 29 | (HowToCombineTransforms "Compose") 30 | 31 | //Save composite ITK transform 32 | (ITKTransformOutputFileNameExtension "h5") 33 | (WriteITKCompositeTransform "true") 34 | 35 | 36 | // ********** Optimizer 37 | 38 | // Maximum number of iterations in each resolution level: 39 | //(MaximumNumberOfIterations 2000) 40 | (MaximumNumberOfIterations 2000 2000 2000 2000 2000 2000) 41 | //(MaximumNumberOfIterations 1 1 1 1 1 1) 42 | //(MaximumNumberOfIterations 500) 43 | (MaximumStepLength 1.0 1.0 1.0 1.0 1.0 0.5) 44 | 45 | (AutomaticParameterEstimation "true") 46 | (UseAdaptiveStepSizes "true") 47 | 48 | 49 | // ********** Metric 50 | 51 | // Just using the default values for the NC metric 52 | 53 | 54 | // ********** Several 55 | 56 | (WriteTransformParametersEachIteration "false") 57 | (WriteTransformParametersEachResolution "false") 58 | (WriteResultImageAfterEachResolution "false") 59 | (WriteResultImage "true") 60 | (CompressResultImage "false") 61 | (ResultImageFormat "mhd") 62 | (ShowExactMetricValue "false") 63 | (ErodeMask "false") 64 | 65 | // ********** ImageSampler 66 | 67 | //Number of spatial samples used to compute the mutual information in each resolution level: 68 | (ImageSampler "RandomCoordinate") 69 | (NumberOfSpatialSamples 2000) 70 | (NewSamplesEveryIteration "true") 71 | (UseRandomSampleRegion "false") 72 | 73 | 74 | // ********** Interpolator and Resampler 75 | 76 | //Order of B-Spline interpolation used in each resolution level: 77 | (BSplineInterpolationOrder 1) 78 | 79 | //Order of B-Spline interpolation used for applying the final deformation: 80 | (FinalBSplineInterpolationOrder 3) 81 | 82 | //Default pixel value for pixels that come from outside the picture: 83 | (DefaultPixelValue 0) 84 | 85 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.NCC_EDM.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiMetricMultiResolutionRegistration") 9 | (FixedImagePyramid "FixedSmoothingImagePyramid") 10 | (MovingImagePyramid "MovingSmoothingImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation" "CorrespondingPointsEuclideanDistanceMetric") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 6) 23 | (ImagePyramidSchedule 16 16 16 16 16 16 8 8 8 4 4 4 2 2 2 1 1 1) 24 | 25 | // ********** Transform 26 | 27 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 28 | (GridSpacingSchedule 16 8 8 4 2 1) 29 | (HowToCombineTransforms "Compose") 30 | 31 | //Save composite ITK transform 32 | (ITKTransformOutputFileNameExtension "h5") 33 | (WriteITKCompositeTransform "true") 34 | 35 | 36 | // ********** Optimizer 37 | 38 | // Maximum number of iterations in each resolution level: 39 | //(MaximumNumberOfIterations 2000) 40 | (MaximumNumberOfIterations 2000 2000 2000 2000 2000 2000) 41 | //(MaximumNumberOfIterations 500) 42 | (MaximumStepLength 1.0 1.0 1.0 1.0 1.0 0.5) 43 | 44 | 45 | (AutomaticParameterEstimation "true") 46 | (UseAdaptiveStepSizes "true") 47 | 48 | // ********** Metric 49 | 50 | // Just using the default values for the NC metric 51 | 52 | (Metric0Weight 1.0) 53 | (Metric1Weight 0.05 0.05 0.05 0.05 0.005 0.000005) 54 | //(Metric1Weight 0.5 0.5 0.5 0.5 0.05 0.0005) 55 | //(Metric1Weight 50 50 0.5 0.5 0.05 0.0005) 56 | 57 | 58 | // ********** Several 59 | 60 | (WriteTransformParametersEachIteration "false") 61 | (WriteTransformParametersEachResolution "false") 62 | (WriteResultImageAfterEachResolution "false") 63 | (WriteResultImage "true") 64 | (CompressResultImage "false") 65 | (ResultImageFormat "mhd") 66 | (ShowExactMetricValue "false") 67 | (ErodeMask "false") 68 | 69 | 70 | // ********** ImageSampler 71 | 72 | //Number of spatial samples used to compute the mutual information in each resolution level: 73 | (ImageSampler "RandomCoordinate") 74 | (NumberOfSpatialSamples 2000) 75 | (NewSamplesEveryIteration "true") 76 | (UseRandomSampleRegion "false") 77 | 78 | 79 | // ********** Interpolator and Resampler 80 | 81 | //Order of B-Spline interpolation used in each resolution level: 82 | (BSplineInterpolationOrder 1) 83 | 84 | //Order of B-Spline interpolation used for applying the final deformation: 85 | (FinalBSplineInterpolationOrder 3) 86 | 87 | //Default pixel value for pixels that come from outside the picture: 88 | (DefaultPixelValue 0) 89 | 90 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0008.affine.txt: -------------------------------------------------------------------------------- 1 | (WriteResultImage "false") 2 | (AutomaticTransformInitialization "true") 3 | (HowToCombineTransforms "Compose") 4 | 5 | //Save composite ITK transform 6 | (ITKTransformOutputFileNameExtension "h5") 7 | (WriteITKCompositeTransform "true") 8 | 9 | (ErodeMask "false") 10 | 11 | (ImageSampler "RandomSparseMask") 12 | 13 | //ImageTypes 14 | (FixedInternalImagePixelType "short") 15 | (FixedImageDimension 3) 16 | (MovingInternalImagePixelType "short") 17 | (MovingImageDimension 3) 18 | 19 | //Components 20 | (Registration "MultiResolutionRegistration") 21 | (FixedImagePyramid "FixedRecursiveImagePyramid") 22 | (MovingImagePyramid "MovingRecursiveImagePyramid") 23 | (Interpolator "BSplineInterpolator") 24 | (Metric "AdvancedMattesMutualInformation") 25 | (Optimizer "StandardGradientDescent") 26 | (ResampleInterpolator "FinalBSplineInterpolator") 27 | (Resampler "DefaultResampler") 28 | (Transform "AffineTransform") 29 | 30 | //Order of B-Spline interpolation used in each resolution level: 31 | (BSplineInterpolationOrder 1) 32 | 33 | //Order of B-Spline interpolation used for applying the final deformation: 34 | (FinalBSplineInterpolationOrder 0) 35 | 36 | (AutomaticScalesEstimation "true") 37 | 38 | (NumberOfResolutions 4) 39 | 40 | //Maximum number of iterations in each resolution level: 41 | (MaximumNumberOfIterations 256) 42 | 43 | //Number of grey level bins in each resolution level: 44 | (NumberOfHistogramBins 32) 45 | 46 | (NewSamplesEveryIteration "true") 47 | (UseAllPixels "false") 48 | (WriteTransformParametersEachResolution "false") 49 | (WriteTransformParametersEachIteration "false") 50 | 51 | //Number of spatial samples used to compute the mutual information in each resolution level: 52 | (NumberOfSpatialSamples 5000) 53 | 54 | (MaximumNumberOfSamplingAttempts 10) 55 | 56 | //Default pixel value for pixels that come from outside the picture: 57 | (DefaultPixelValue 0) 58 | 59 | (ImagePyramidSchedule 8 4 4 2 1) 60 | 61 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 62 | (SP_a 500.0) 63 | 64 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 65 | (SP_A 50.0) 66 | 67 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 68 | (SP_alpha 0.602) 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0008.elastic.txt: -------------------------------------------------------------------------------- 1 | (WriteResultImage "false") 2 | (AutomaticTransformInitialization "true") 3 | 4 | (ErodeFixedMask "false") 5 | (ErodeMovingMask "false") 6 | 7 | (ImageSampler "RandomSparseMask") 8 | 9 | //ImageTypes 10 | (FixedInternalImagePixelType "short") 11 | (FixedImageDimension 3) 12 | (MovingInternalImagePixelType "short") 13 | (MovingImageDimension 3) 14 | 15 | //Components 16 | (Registration "MultiResolutionRegistration") 17 | (FixedImagePyramid "FixedRecursiveImagePyramid") 18 | (MovingImagePyramid "MovingRecursiveImagePyramid") 19 | (Interpolator "BSplineInterpolator") 20 | (Metric "AdvancedMattesMutualInformation") 21 | (Optimizer "StandardGradientDescent") 22 | (ResampleInterpolator "FinalBSplineInterpolator") 23 | (Resampler "DefaultResampler") 24 | (Transform "BSplineTransform") 25 | 26 | //Order of B-Spline interpolation used in each resolution level: 27 | (BSplineInterpolationOrder 1) 28 | 29 | //Order of B-Spline interpolation used for applying the final deformation: 30 | (FinalBSplineInterpolationOrder 0) 31 | 32 | //Final spacing of B-Spline grid (unit = size of 1 voxel): 33 | (FinalGridSpacingInVoxels 8.0) 34 | 35 | (ImagePyramidSchedule 8 4 4 2 1) 36 | (GridSpacingSchedule 8.0 4.0 4.0 2.0 1.0) 37 | 38 | (MaximumNumberOfSamplingAttempts 10) 39 | 40 | (WriteResultImageAfterEachResolution "false") 41 | 42 | (NumberOfResolutions 5) 43 | 44 | //Maximum number of iterations in each resolution level: 45 | (MaximumNumberOfIterations 256 256 256 256 256) 46 | //(MaximumNumberOfIterations 512 512 512 512 512) 47 | 48 | //Number of grey level bins in each resolution level: 49 | (NumberOfHistogramBins 32 32 32 32 32) 50 | 51 | (NewSamplesEveryIteration "true" "true" "true" "true" "true") 52 | (UseAllPixels "false") 53 | (WriteTransformParametersEachIteration "false") 54 | (ShowExactMetricValue "false" "false" "false" "false" "false") 55 | 56 | //Number of spatial samples used to compute the mutual information in each resolution level: 57 | (NumberOfSpatialSamples 4096 4096 4096 4096 4096) 58 | 59 | //Order of B-Spline interpolation used in each resolution level: 60 | (BSplineInterpolationOrder 1 1 1 1 1) 61 | 62 | //Order of B-Spline interpolation used for applying the final deformation: 63 | (FinalBSplineInterpolationOrder 3) 64 | 65 | //Default pixel value for pixels that come from outside the picture: 66 | (DefaultPixelValue 0) 67 | 68 | //SP: Param_a in each resolution level. a_k = a/(A+k+1)^alpha 69 | (SP_a 2000.0 7000.0 20000.0 20000.0 30000.0) 70 | 71 | //SP: Param_A in each resolution level. a_k = a/(A+k+1)^alpha 72 | (SP_A 50.0 50.0 50.0 50.0 50.0) 73 | 74 | //SP: Param_alpha in each resolution level. a_k = a/(A+k+1)^alpha 75 | (SP_alpha 0.602 0.602 0.602 0.602 0.602) 76 | 77 | //Save composite ITK transform 78 | (ITKTransformOutputFileNameExtension "h5") 79 | (WriteITKCompositeTransform "true") 80 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0009.affine.txt: -------------------------------------------------------------------------------- 1 | // Parameter file for affine registration 2 | // as used in: Artaechevarria X, Munoz-Barrutia A, Ortiz-de-Solorzano C., 3 | // "Combination strategies in multi-atlas image segmentation: application to brain MR data," 4 | // IEEE Trans Med Imaging. 2009 Aug;28(8):1266-77. 5 | 6 | // The internal pixel type, used for computations 7 | // Leave to float in general 8 | (FixedInternalImagePixelType "float") 9 | (MovingInternalImagePixelType "float") 10 | 11 | // The dimensions of the fixed and moving image 12 | (FixedImageDimension 3) 13 | (MovingImageDimension 3) 14 | 15 | //Components 16 | 17 | // The following components should be left as they are: 18 | (Registration "MultiResolutionRegistration") 19 | (FixedImagePyramid "FixedRecursiveImagePyramid") 20 | (MovingImagePyramid "MovingRecursiveImagePyramid") 21 | (Interpolator "BSplineInterpolator") 22 | (ResampleInterpolator "FinalBSplineInterpolator") 23 | (Resampler "DefaultResampler") 24 | 25 | // You may change these: 26 | // The optimizer RegularStepGradientDescent (RSGD) works quite ok 27 | // in general. You may also use the StandardGradientDescent, 28 | // like in parameters_Rigid.txt. The Transform and Metric 29 | // are important and need to be chosen careful for each application. 30 | (Optimizer "RegularStepGradientDescent") 31 | (Transform "AffineTransform") 32 | (Metric "AdvancedMattesMutualInformation") 33 | 34 | // Scales the rotations compared to the translations, to make 35 | // sure they are in the same range. The higher this parameter, 36 | // the smaller the changes in rotation angle in each iteration. 37 | // If you have the feeling that rotations are not found by elastix, 38 | // decrease it; if elastix crashes after a few iterations, with 39 | // the message that all samples map outside the moving image 40 | // buffer, you may have to increase this parameter. 41 | (Scales 50000.0) 42 | 43 | // Automatically guess an initial translation. Not needed/recommended 44 | // here, because we already did a rigid registration before! 45 | (AutomaticTransformInitialization "false") 46 | 47 | // Choose another center of rotation for the AffineTransform, 48 | // if you like. Uncomment if you want that. 49 | //(CenterOfRotation 10 10 10) 50 | 51 | // The number of resolutions. 1 Is only enough if the expected 52 | // deformations are small. 3 or 4 mostly works fine. 53 | (NumberOfResolutions 3) 54 | 55 | // The pixel type of the resulting image 56 | (ResultImagePixelType "short") 57 | 58 | // If you use a mask, this option is important. You can 59 | // set it for each resolution differently. 60 | // If the mask serves as region of interest, set it to false. 61 | // If the mask indicates which pixels are valid, then set it to true. 62 | // If you do not use a mask, the option doesn't matter. 63 | (ErodeMask "false" "false" "false") 64 | 65 | // Whether transforms are combined by composition or by addition. 66 | // In general, Compose is the best option in most cases. 67 | // It does not influence the results very much. 68 | (HowToCombineTransforms "Compose") 69 | 70 | //Save composite ITK transform 71 | (ITKTransformOutputFileNameExtension "h5") 72 | (WriteITKCompositeTransform "true") 73 | 74 | // Number of spatial samples used to compute the mutual 75 | // information in each resolution level. 76 | // With the RegularStepGradientDescentOptimizer in general 77 | // you need to set this to some fixed fraction of the total 78 | // number of voxels in the image. Say 20%, at least. 79 | // In the first resolutions the images are smaller so you 80 | // may use less samples. 81 | (NumberOfSpatialSamples 30000 80000 100000) 82 | 83 | // Pick the samples (pseudo)randomly. Use "Full" if you want 84 | // to use all voxels to compute metric. (then the previous 85 | // option makes of course no sense anymore). 86 | (ImageSampler "Random") 87 | 88 | // Number of grey level bins in each resolution level, 89 | // for the mutual information. 16 or 32 usually works fine. 90 | (NumberOfHistogramBins 16 32 32) 91 | 92 | //Order of B-Spline interpolation used in each resolution level: 93 | // It may improve accuracy if you set this to 3. Never use 0. 94 | (BSplineInterpolationOrder 2 2 2) 95 | 96 | //Order of B-Spline interpolation used for applying the final 97 | // deformation. 98 | // 3 gives good accuracy. 99 | // 1 gives worse accuracy (linear interpolation) 100 | // 0 gives worst accuracy, but may be appropriate for 101 | // binary images; this would be equivalent to nearest neighbor 102 | // interpolation. 103 | (FinalBSplineInterpolationOrder 0) 104 | 105 | //Default pixel value for pixels that come from outside the picture: 106 | (DefaultPixelValue 0) 107 | 108 | // The following parameters are for the StandardGradientDescent 109 | // optimizer. They determine the step size. 110 | // Especially SP_a needs to be tuned for each specific application. 111 | // The number of iterations is also important. 112 | 113 | //Maximum number of iterations in each resolution level: 114 | // 100-500 works usually fine. 115 | (MaximumNumberOfIterations 100 100 100) 116 | 117 | //Maximum step size of the RSGD optimizer for each resolution level. 118 | // The higher you set this, the more aggressive steps are taken. 119 | (MaximumStepLength 4.0 2.0 2.0) 120 | 121 | //Minimum step size of the RSGD optimizer for each resolution level. 122 | // The lower you set this, the more accurate the final result. 123 | //(MinimumStepLength 0.5 0.05 0.05) 124 | (MinimumStepLength 0.5 0.05 0.05) 125 | 126 | //Minimum magnitude of the gradient (stopping criterion) for the RSGD optimizer: 127 | // The lower you set this, the more accurate the final result may be. 128 | (MinimumGradientMagnitude 0.00000001 0.00000001 0.00000001) 129 | 130 | 131 | //Result image format 132 | (ResultImageFormat "mhd") 133 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0009.elastic.txt: -------------------------------------------------------------------------------- 1 | // Parameter file for B-Spline registration 2 | // as used in: Artaechevarria X, Munoz-Barrutia A, Ortiz-de-Solorzano C., 3 | // "Combination strategies in multi-atlas image segmentation: application to brain MR data," 4 | // IEEE Trans Med Imaging. 2009 Aug;28(8):1266-77. 5 | 6 | // The internal pixel type, used for computations 7 | // Leave to float in general 8 | (FixedInternalImagePixelType "float") 9 | (MovingInternalImagePixelType "float") 10 | 11 | // The dimensions of the fixed and moving image 12 | (FixedImageDimension 3) 13 | (MovingImageDimension 3) 14 | 15 | //Components 16 | 17 | // The following components should be left as they are: 18 | (Registration "MultiResolutionRegistration") 19 | (FixedImagePyramid "FixedRecursiveImagePyramid") 20 | (MovingImagePyramid "MovingRecursiveImagePyramid") 21 | (Interpolator "BSplineInterpolator") 22 | (ResampleInterpolator "FinalBSplineInterpolator") 23 | (Resampler "DefaultResampler") 24 | 25 | // You may change these: 26 | // The optimizer StandardGradientDescent works quite ok 27 | // in general. The Transform and Metric are important and 28 | // need to be chosen careful for each application. 29 | (Optimizer "QuasiNewtonLBFGS") 30 | (Transform "BSplineTransform") 31 | (Metric "AdvancedMattesMutualInformation") 32 | 33 | 34 | // The number of resolutions. 1 Is only enough if the expected 35 | // deformations are small. 3 or 4 mostly works fine. 36 | (NumberOfResolutions 3) 37 | 38 | // The pixel type of the resulting image 39 | (ResultImagePixelType "short") 40 | 41 | // If you use a mask, this option is important. You can 42 | // set it for each resolution differently. 43 | // If the mask serves as region of interest, set it to false. 44 | // If the mask indicates which pixels are valid, then set it to true. 45 | // If you do not use a mask, the option doesn't matter. 46 | (ErodeMask "false" "false" "false") 47 | 48 | // Whether transforms are combined by composition or by addition. 49 | // In generally, Compose is the best option in most cases. 50 | // It does not influence the results very much. 51 | (HowToCombineTransforms "Compose") 52 | 53 | //Save composite ITK transform 54 | (ITKTransformOutputFileNameExtension "h5") 55 | (WriteITKCompositeTransform "true") 56 | 57 | // This is an important option. It defines the complexity of 58 | // the deformation field. 59 | // Final spacing of B-Spline grid (unit = size of 1 voxel) 60 | // You can give it for each dimension differently, or for 61 | // all dimensions the same. 62 | (FinalGridSpacing 8.0 8.0 8.0) 63 | (UpsampleGridOption "true") 64 | 65 | // Number of spatial samples used to compute the mutual 66 | // information in each resolution level. 67 | (NumberOfSpatialSamples 20000 30000 80000) 68 | 69 | // Refresh these spatial samples in every iteration, and select 70 | // them randomly. 71 | (NewSamplesEveryIteration "true" "true" "true") 72 | (ImageSampler "Random") 73 | 74 | //Number of grey level bins in each resolution level, 75 | // for the mutual information. 16 or 32 usually works fine. 76 | (NumberOfHistogramBins 16 32 32) 77 | 78 | //Order of B-Spline interpolation used in each resolution level: 79 | (BSplineInterpolationOrder 2 2 2) 80 | 81 | //Order of B-Spline interpolation used for applying the final deformation: 82 | (FinalBSplineInterpolationOrder 0) 83 | 84 | //Default pixel value for pixels that come from outside the picture: 85 | (DefaultPixelValue 0) 86 | 87 | // The following parameters are for the QuasiNewtonLBFGS 88 | // optimizer. 89 | 90 | //MaximumNumberOfIterations: The maximum number of iterations in each resolution. 91 | (MaximumNumberOfIterations 100 75 25) 92 | 93 | 94 | //StepLength: Set the length of the initial step tried by the itk::MoreThuenteLineSearchOptimizer. 95 | (StepLength 2.0 1.0 5.0) 96 | 97 | 98 | //LineSearchValueTolerance: Determine the Wolfe conditions that the itk::MoreThuenteLineSearchOptimizer tries to satisfy. 99 | (LineSearchValueTolerance 0.001 0.0001 0.0001) 100 | //Default value: 0.0001. 101 | 102 | //LineSearchGradientTolerance: Determine the Wolfe conditions that the itk::MoreThuenteLineSearchOptimizer tries to satisfy. 103 | (LineSearchGradientTolerance 0.7 0.7 0.7) 104 | //Default value: 0.9. 105 | 106 | //GradientMagnitudeTolerance: Stopping criterion. See the documentation of the itk::QuasiNewtonLBFGSOptimizer for more information. 107 | //(GradientMagnitudeTolerance 0.001 0.0001 0.000001) 108 | // good, but too long(GradientMagnitudeTolerance 0.0001 0.000001 0.000001) 109 | (GradientMagnitudeTolerance 0.00001 0.000001 0.000001) //to compare 110 | 111 | //Default value: 0.000001. 112 | 113 | //LBFGSUpdateAccuracy: The "memory" of the optimizer. This determines how many past iterations are used to construct the Hessian approximation. The higher, the more memory is used, but the better the Hessian approximation. If set to zero, The QuasiNewtonLBFGS equals a gradient descent method with line search. 114 | (LBFGSUpdateAccuracy 10 20 40) 115 | //(LBFGSUpdateAccuracy 10 20 20) 116 | 117 | //StopIfWolfeNotSatisfied: Whether to stop the optimisation if in one iteration the Wolfe conditions can not be satisfied by the itk::MoreThuenteLineSearchOptimizer. 118 | //In general it is wise to do so. 119 | (StopIfWolfeNotSatisfied "true") 120 | //Default value: "true". 121 | 122 | 123 | //Result image format 124 | (ResultImageFormat "mhd") 125 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0011.affine.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "AffineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 16 16 16 8 8 8 4 4 4 2 2 2 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (AutomaticScalesEstimation "true") 29 | (AutomaticTransformInitialization "true") 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | 49 | // ********** Several 50 | 51 | (WriteTransformParametersEachIteration "false") 52 | (WriteTransformParametersEachResolution "true") 53 | (WriteResultImageAfterEachResolution "false") 54 | (WriteResultImage "true") 55 | (ShowExactMetricValue "false") 56 | (ErodeMask "false") 57 | 58 | // ********** ImageSampler 59 | 60 | //Number of spatial samples used to compute the mutual information in each resolution level: 61 | (ImageSampler "RandomCoordinate") 62 | (NumberOfSpatialSamples 2000) 63 | (NewSamplesEveryIteration "true") 64 | (UseRandomSampleRegion "false") 65 | (MaximumNumberOfSamplingAttempts 5) 66 | 67 | 68 | // ********** Interpolator and Resampler 69 | 70 | //Order of B-Spline interpolation used in each resolution level: 71 | (BSplineInterpolationOrder 1) 72 | 73 | //Order of B-Spline interpolation used for applying the final deformation: 74 | (FinalBSplineInterpolationOrder 3) 75 | 76 | //Default pixel value for pixels that come from outside the picture: 77 | (DefaultPixelValue 0) 78 | 79 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0011.bspline1.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 16 16 16 8 8 8 4 4 4 2 2 2 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 29 | (GridSpacingSchedule 8.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | // Just using the default values for the NC metric 49 | 50 | 51 | // ********** Several 52 | 53 | (WriteTransformParametersEachIteration "false") 54 | (WriteTransformParametersEachResolution "true") 55 | (WriteResultImageAfterEachResolution "false") 56 | (WritePyramidImagesAfterEachResolution "false") 57 | (WriteResultImage "true") 58 | (ShowExactMetricValue "false") 59 | (ErodeMask "false") 60 | 61 | 62 | // ********** ImageSampler 63 | 64 | //Number of spatial samples used to compute the mutual information in each resolution level: 65 | (ImageSampler "RandomCoordinate") 66 | (NumberOfSpatialSamples 2000) 67 | (NewSamplesEveryIteration "true") 68 | (UseRandomSampleRegion "false") 69 | (SampleRegionSize 50.0 50.0 50.0) 70 | (MaximumNumberOfSamplingAttempts 50) 71 | 72 | 73 | // ********** Interpolator and Resampler 74 | 75 | //Order of B-Spline interpolation used in each resolution level: 76 | (BSplineInterpolationOrder 1) 77 | 78 | //Order of B-Spline interpolation used for applying the final deformation: 79 | (FinalBSplineInterpolationOrder 3) 80 | 81 | //Default pixel value for pixels that come from outside the picture: 82 | (DefaultPixelValue 0) 83 | 84 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0011.bspline1_s.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiMetricMultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation" "TransformBendingEnergyPenalty") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 16 16 16 8 8 8 4 4 4 2 2 2 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 29 | (GridSpacingSchedule 8.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | // Just using the default values for the NC metric 49 | (UseRelativeWeights "true") 50 | (Metric0RelativeWeight 1.0) 51 | (Metric1RelativeWeight 0.05) 52 | 53 | 54 | // ********** Several 55 | 56 | (WriteTransformParametersEachIteration "false") 57 | (WriteTransformParametersEachResolution "true") 58 | (WriteResultImageAfterEachResolution "false") 59 | (WritePyramidImagesAfterEachResolution "false") 60 | (WriteResultImage "false") 61 | (ShowExactMetricValue "false") 62 | (ErodeMask "false") 63 | 64 | 65 | // ********** ImageSampler 66 | 67 | //Number of spatial samples used to compute the mutual information in each resolution level: 68 | (ImageSampler "RandomCoordinate") 69 | (NumberOfSpatialSamples 2000) 70 | (NewSamplesEveryIteration "true") 71 | (UseRandomSampleRegion "false") 72 | (SampleRegionSize 50.0 50.0 50.0) 73 | (MaximumNumberOfSamplingAttempts 50) 74 | 75 | 76 | // ********** Interpolator and Resampler 77 | 78 | //Order of B-Spline interpolation used in each resolution level: 79 | (BSplineInterpolationOrder 1) 80 | 81 | //Order of B-Spline interpolation used for applying the final deformation: 82 | (FinalBSplineInterpolationOrder 3) 83 | 84 | //Default pixel value for pixels that come from outside the picture: 85 | (DefaultPixelValue 0) 86 | 87 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0011.bspline2.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 4 4 4 3 3 3 2 2 2 1 1 1 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 5.0 5.0 5.0) 29 | (GridSpacingSchedule 16.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 2000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | // Just using the default values for the NC metric 49 | 50 | 51 | // ********** Several 52 | 53 | (WriteTransformParametersEachIteration "false") 54 | (WriteTransformParametersEachResolution "true") 55 | (WriteResultImageAfterEachResolution "false") 56 | (WritePyramidImagesAfterEachResolution "false") 57 | (WriteResultImage "true") 58 | (ShowExactMetricValue "false") 59 | (ErodeMask "false" "false" "true" "true" "true") 60 | 61 | // ********** ImageSampler 62 | 63 | //Number of spatial samples used to compute the mutual information in each resolution level: 64 | (ImageSampler "RandomCoordinate") 65 | (NumberOfSpatialSamples 2000) 66 | (NewSamplesEveryIteration "true") 67 | (UseRandomSampleRegion "false") 68 | (SampleRegionSize 50.0 50.0 50.0) 69 | (MaximumNumberOfSamplingAttempts 50) 70 | 71 | 72 | // ********** Interpolator and Resampler 73 | 74 | //Order of B-Spline interpolation used in each resolution level: 75 | (BSplineInterpolationOrder 1) 76 | 77 | //Order of B-Spline interpolation used for applying the final deformation: 78 | (FinalBSplineInterpolationOrder 3) 79 | 80 | //Default pixel value for pixels that come from outside the picture: 81 | (DefaultPixelValue 0) 82 | 83 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0011.bspline2_s.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiMetricMultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation" "TransformBendingEnergyPenalty") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 4 4 4 3 3 3 2 2 2 1 1 1 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 5.0 5.0 5.0) 29 | (GridSpacingSchedule 16.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 2000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | // Just using the default values for the NC metric 49 | (UseRelativeWeights "true") 50 | (Metric0RelativeWeight 1.0) 51 | (Metric1RelativeWeight 0.05) 52 | 53 | 54 | // ********** Several 55 | 56 | (WriteTransformParametersEachIteration "false") 57 | (WriteTransformParametersEachResolution "true") 58 | (WriteResultImageAfterEachResolution "false") 59 | (WritePyramidImagesAfterEachResolution "false") 60 | (WriteResultImage "false") 61 | (ShowExactMetricValue "false") 62 | (ErodeMask "false" "false" "true" "true" "true") 63 | 64 | // ********** ImageSampler 65 | 66 | //Number of spatial samples used to compute the mutual information in each resolution level: 67 | (ImageSampler "RandomCoordinate") 68 | (NumberOfSpatialSamples 2000) 69 | (NewSamplesEveryIteration "true") 70 | (UseRandomSampleRegion "false") 71 | (SampleRegionSize 50.0 50.0 50.0) 72 | (MaximumNumberOfSamplingAttempts 50) 73 | 74 | 75 | // ********** Interpolator and Resampler 76 | 77 | //Order of B-Spline interpolation used in each resolution level: 78 | (BSplineInterpolationOrder 1) 79 | 80 | //Order of B-Spline interpolation used for applying the final deformation: 81 | (FinalBSplineInterpolationOrder 3) 82 | 83 | //Default pixel value for pixels that come from outside the picture: 84 | (DefaultPixelValue 0) 85 | 86 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expA.patient.LNC.bspline.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 16 16 8 8 8 4 4 4 2 2 2 1 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 29 | (GridSpacingSchedule 8.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | 44 | // We cannot use adaptive step sizes, because we use the local NC. 45 | // So, it does not make sense to evaluate the inner product of the 46 | // cost function derivative g_{k}^T g_{k-1}, since these are computed 47 | // on different regions of the image. 48 | // However, it is still better to use the adaptive gd method, since 49 | // all parameters are estimated automatically, and adapted to the 50 | // specific image content. We only don't use the time adaption. 51 | (UseAdaptiveStepSizes "false") 52 | 53 | 54 | // ********** Metric 55 | 56 | (NumberOfHistogramBins 32) 57 | (FixedLimitRangeRatio 0.0) 58 | (MovingLimitRangeRatio 0.0) 59 | (FixedKernelBSplineOrder 1) 60 | (MovingKernelBSplineOrder 3) 61 | (UseExplicitPDFDerivatives "false") 62 | 63 | 64 | // ********** Several 65 | 66 | (WriteTransformParametersEachIteration "false") 67 | (WriteTransformParametersEachResolution "true") 68 | (WriteResultImageAfterEachResolution "false") 69 | (WritePyramidImagesAfterEachResolution "false") 70 | (WriteResultImage "false") 71 | (ShowExactMetricValue "false") 72 | (ErodeMask "false") 73 | 74 | // ********** ImageSampler 75 | 76 | //Number of spatial samples used to compute the mutual information in each resolution level: 77 | (ImageSampler "RandomCoordinate") 78 | (NumberOfSpatialSamples 2000) 79 | (NewSamplesEveryIteration "true") 80 | (UseRandomSampleRegion "true") 81 | (SampleRegionSize 50.0 50.0 50.0) 82 | (MaximumNumberOfSamplingAttempts 50) 83 | 84 | 85 | // ********** Interpolator and Resampler 86 | 87 | //Order of B-Spline interpolation used in each resolution level: 88 | (BSplineInterpolationOrder 1) 89 | 90 | //Order of B-Spline interpolation used for applying the final deformation: 91 | (FinalBSplineInterpolationOrder 3) 92 | 93 | //Default pixel value for pixels that come from outside the picture: 94 | (DefaultPixelValue 0) 95 | 96 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expA.patient.NC.affine.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "AffineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 16 16 8 8 8 4 4 4 2 2 2 1 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (AutomaticScalesEstimation "true") 29 | (AutomaticTransformInitialization "true") 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | 49 | // ********** Several 50 | 51 | (WriteTransformParametersEachIteration "false") 52 | (WriteTransformParametersEachResolution "true") 53 | (WriteResultImageAfterEachResolution "false") 54 | (WriteResultImage "false") 55 | (ShowExactMetricValue "false") 56 | (ErodeMask "false") 57 | 58 | 59 | // ********** ImageSampler 60 | 61 | //Number of spatial samples used to compute the mutual information in each resolution level: 62 | (ImageSampler "RandomCoordinate") 63 | (NumberOfSpatialSamples 2000) 64 | (NewSamplesEveryIteration "true") 65 | (UseRandomSampleRegion "false") 66 | (MaximumNumberOfSamplingAttempts 5) 67 | 68 | 69 | // ********** Interpolator and Resampler 70 | 71 | //Order of B-Spline interpolation used in each resolution level: 72 | (BSplineInterpolationOrder 1) 73 | 74 | //Order of B-Spline interpolation used for applying the final deformation: 75 | (FinalBSplineInterpolationOrder 3) 76 | 77 | //Default pixel value for pixels that come from outside the picture: 78 | (DefaultPixelValue 0) 79 | 80 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expA.patient.NC.bspline.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | (ImagePyramidSchedule 16 16 8 8 8 4 4 4 2 2 2 1 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 29 | (GridSpacingSchedule 8.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | // Just using the default values for the NC metric 49 | 50 | 51 | // ********** Several 52 | 53 | (WriteTransformParametersEachIteration "false") 54 | (WriteTransformParametersEachResolution "true") 55 | (WriteResultImageAfterEachResolution "false") 56 | (WritePyramidImagesAfterEachResolution "false") 57 | (WriteResultImage "false") 58 | (ShowExactMetricValue "false") 59 | (ErodeMask "false") 60 | 61 | 62 | // ********** ImageSampler 63 | 64 | //Number of spatial samples used to compute the mutual information in each resolution level: 65 | (ImageSampler "RandomCoordinate") 66 | (NumberOfSpatialSamples 2000) 67 | (NewSamplesEveryIteration "true") 68 | (UseRandomSampleRegion "false") 69 | (SampleRegionSize 50.0 50.0 50.0) 70 | (MaximumNumberOfSamplingAttempts 50) 71 | 72 | 73 | // ********** Interpolator and Resampler 74 | 75 | //Order of B-Spline interpolation used in each resolution level: 76 | (BSplineInterpolationOrder 1) 77 | 78 | //Order of B-Spline interpolation used for applying the final deformation: 79 | (FinalBSplineInterpolationOrder 3) 80 | 81 | //Default pixel value for pixels that come from outside the picture: 82 | (DefaultPixelValue 0) 83 | 84 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expB.phantom.NC_EDM.affine.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiMetricMultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation" "CorrespondingPointsEuclideanDistanceMetric") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "AffineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | // Default pyramid schedule 24 | 25 | // ********** Transform 26 | 27 | (AutomaticScalesEstimation "true") 28 | (AutomaticTransformInitialization "true") 29 | (HowToCombineTransforms "Compose") 30 | 31 | //Save composite ITK transform 32 | (ITKTransformOutputFileNameExtension "h5") 33 | (WriteITKCompositeTransform "true") 34 | 35 | 36 | // ********** Optimizer 37 | 38 | // Maximum number of iterations in each resolution level: 39 | (MaximumNumberOfIterations 2000) 40 | 41 | (AutomaticParameterEstimation "true") 42 | (UseAdaptiveStepSizes "true") 43 | 44 | 45 | // ********** Metric 46 | 47 | // Just using the default values for the NC metric 48 | // Just using the default values for the cp metric 49 | 50 | (Metric0RelativeWeight 1.0) 51 | (Metric1RelativeWeight 1.0 1.0 1.0 1.0 0.1) 52 | (UseRelativeWeights "true") 53 | 54 | 55 | // ********** Several 56 | 57 | (WriteTransformParametersEachIteration "false") 58 | (WriteTransformParametersEachResolution "true") 59 | (WriteResultImageAfterEachResolution "false") 60 | //(WriteResultImage "false") 61 | (WriteResultImage "true") 62 | (ShowExactMetricValue "false") 63 | (ErodeMask "false") 64 | 65 | 66 | // ********** ImageSampler 67 | 68 | //Number of spatial samples used to compute the mutual information in each resolution level: 69 | (ImageSampler "RandomCoordinate") 70 | (NumberOfSpatialSamples 2000) 71 | (NewSamplesEveryIteration "true") 72 | (UseRandomSampleRegion "false") 73 | (MaximumNumberOfSamplingAttempts 5) 74 | 75 | 76 | // ********** Interpolator and Resampler 77 | 78 | //Order of B-Spline interpolation used in each resolution level: 79 | (BSplineInterpolationOrder 1) 80 | 81 | //Order of B-Spline interpolation used for applying the final deformation: 82 | (FinalBSplineInterpolationOrder 3) 83 | 84 | //Default pixel value for pixels that come from outside the picture: 85 | (DefaultPixelValue 0) 86 | 87 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expB.phantom.NC_EDM.bspline.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiMetricMultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation" "CorrespondingPointsEuclideanDistanceMetric") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | // default pyramid schedule 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 29 | (GridSpacingSchedule 16.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | // Just using the default values for the NC metric 49 | // Just using the default values for the cp metric 50 | 51 | (Metric0RelativeWeight 1.0) 52 | (Metric1RelativeWeight 1.0 1.0 1.0 1.0 0.1) 53 | (UseRelativeWeights "true") 54 | 55 | 56 | // ********** Several 57 | 58 | (WriteTransformParametersEachIteration "false") 59 | (WriteTransformParametersEachResolution "true") 60 | (WriteResultImageAfterEachResolution "false") 61 | (WritePyramidImagesAfterEachResolution "false") 62 | (WriteResultImage "true") 63 | (ShowExactMetricValue "false") 64 | (ErodeMask "false") 65 | 66 | 67 | // ********** ImageSampler 68 | 69 | //Number of spatial samples used to compute the mutual information in each resolution level: 70 | (ImageSampler "RandomCoordinate") 71 | (NumberOfSpatialSamples 2000) 72 | (NewSamplesEveryIteration "true") 73 | (UseRandomSampleRegion "false") 74 | (SampleRegionSize 50.0 50.0 50.0) 75 | (MaximumNumberOfSamplingAttempts 50) 76 | 77 | 78 | // ********** Interpolator and Resampler 79 | 80 | //Order of B-Spline interpolation used in each resolution level: 81 | (BSplineInterpolationOrder 1) 82 | 83 | //Order of B-Spline interpolation used for applying the final deformation: 84 | (FinalBSplineInterpolationOrder 3) 85 | 86 | //Default pixel value for pixels that come from outside the picture: 87 | (DefaultPixelValue 0) 88 | 89 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expC.phantom.NC.affine.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | //(Resampler "DefaultResampler") 16 | (Resampler "CUDAResampler") 17 | (Transform "AffineTransform") 18 | 19 | 20 | // ********** Pyramid 21 | 22 | // Total number of resolutions 23 | (NumberOfResolutions 5) 24 | //(ImagePyramidSchedule 16 16 8 8 8 4 4 4 2 2 2 1 1 1 1) 25 | 26 | 27 | // ********** Transform 28 | 29 | (AutomaticScalesEstimation "true") 30 | (AutomaticTransformInitialization "true") 31 | (HowToCombineTransforms "Compose") 32 | 33 | //Save composite ITK transform 34 | (ITKTransformOutputFileNameExtension "h5") 35 | (WriteITKCompositeTransform "true") 36 | 37 | 38 | // ********** Optimizer 39 | 40 | // Maximum number of iterations in each resolution level: 41 | (MaximumNumberOfIterations 2000) 42 | 43 | (AutomaticParameterEstimation "true") 44 | (UseAdaptiveStepSizes "true") 45 | 46 | 47 | // ********** Metric 48 | 49 | 50 | // ********** Several 51 | 52 | (WriteTransformParametersEachIteration "false") 53 | (WriteTransformParametersEachResolution "true") 54 | (WriteResultImageAfterEachResolution "true") 55 | //(WriteResultImage "false") 56 | (WriteResultImage "true") 57 | (ShowExactMetricValue "false") 58 | (ErodeMask "false") 59 | 60 | 61 | // ********** ImageSampler 62 | 63 | //Number of spatial samples used to compute the mutual information in each resolution level: 64 | (ImageSampler "RandomCoordinate") 65 | (NumberOfSpatialSamples 2000) 66 | (NewSamplesEveryIteration "true") 67 | (UseRandomSampleRegion "false") 68 | (MaximumNumberOfSamplingAttempts 5) 69 | 70 | 71 | // ********** Interpolator and Resampler 72 | 73 | //Order of B-Spline interpolation used in each resolution level: 74 | (BSplineInterpolationOrder 1) 75 | 76 | //Order of B-Spline interpolation used for applying the final deformation: 77 | (FinalBSplineInterpolationOrder 3) 78 | 79 | //Default pixel value for pixels that come from outside the picture: 80 | (DefaultPixelValue 0) 81 | 82 | (UseCUDA "true") 83 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expC.phantom.NC.bspline.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "BSplineTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 5) 23 | //(ImagePyramidSchedule 32 32 8 16 16 4 8 8 2 1 1 1 1 1 1) 24 | 25 | 26 | // ********** Transform 27 | 28 | (FinalGridSpacingInPhysicalUnits 10.0 10.0 10.0) 29 | (GridSpacingSchedule 16.0 8.0 4.0 2.0 1.0) 30 | (HowToCombineTransforms "Compose") 31 | 32 | //Save composite ITK transform 33 | (ITKTransformOutputFileNameExtension "h5") 34 | (WriteITKCompositeTransform "true") 35 | 36 | 37 | // ********** Optimizer 38 | 39 | // Maximum number of iterations in each resolution level: 40 | (MaximumNumberOfIterations 1000) 41 | 42 | (AutomaticParameterEstimation "true") 43 | (UseAdaptiveStepSizes "true") 44 | 45 | 46 | // ********** Metric 47 | 48 | // Just using the default values for the NC metric 49 | 50 | 51 | // ********** Several 52 | 53 | (WriteTransformParametersEachIteration "false") 54 | (WriteTransformParametersEachResolution "true") 55 | (WriteResultImageAfterEachResolution "false") 56 | (WritePyramidImagesAfterEachResolution "false") 57 | (WriteResultImage "true") 58 | (ShowExactMetricValue "false") 59 | (ErodeMask "false") 60 | 61 | 62 | // ********** ImageSampler 63 | 64 | //Number of spatial samples used to compute the mutual information in each resolution level: 65 | (ImageSampler "RandomCoordinate") 66 | (NumberOfSpatialSamples 2000) 67 | (NewSamplesEveryIteration "true") 68 | (UseRandomSampleRegion "false") 69 | (SampleRegionSize 50.0 50.0 50.0) 70 | (MaximumNumberOfSamplingAttempts 50) 71 | 72 | 73 | // ********** Interpolator and Resampler 74 | 75 | //Order of B-Spline interpolation used in each resolution level: 76 | (BSplineInterpolationOrder 1) 77 | 78 | //Order of B-Spline interpolation used for applying the final deformation: 79 | (FinalBSplineInterpolationOrder 3) 80 | 81 | //Default pixel value for pixels that come from outside the picture: 82 | (DefaultPixelValue 0) 83 | 84 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.Par0015.expD.phantom.NC.rigid.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // ********** Components 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (FixedImagePyramid "FixedRecursiveImagePyramid") 10 | (MovingImagePyramid "MovingRecursiveImagePyramid") 11 | (Interpolator "BSplineInterpolator") 12 | (Metric "AdvancedNormalizedCorrelation") 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (ResampleInterpolator "FinalBSplineInterpolator") 15 | (Resampler "DefaultResampler") 16 | (Transform "EulerTransform") 17 | 18 | 19 | // ********** Pyramid 20 | 21 | // Total number of resolutions 22 | (NumberOfResolutions 4) 23 | 24 | 25 | // ********** Transform 26 | 27 | (HowToCombineTransforms "Compose") 28 | 29 | //Save composite ITK transform 30 | (ITKTransformOutputFileNameExtension "h5") 31 | (WriteITKCompositeTransform "true") 32 | 33 | 34 | // ********** Optimizer 35 | 36 | // Maximum number of iterations in each resolution level: 37 | (MaximumNumberOfIterations 1000 1000 1000 1500) 38 | 39 | (AutomaticParameterEstimation "true") 40 | (UseAdaptiveStepSizes "true") 41 | 42 | (AutomaticScalesEstimation "true") 43 | 44 | 45 | // ********** Metric 46 | 47 | // Just using the default values for the NC metric 48 | 49 | 50 | // ********** Several 51 | 52 | (WriteTransformParametersEachIteration "false") 53 | (WriteTransformParametersEachResolution "true") 54 | (WriteResultImageAfterEachResolution "false") 55 | (WritePyramidImagesAfterEachResolution "false") 56 | (WriteResultImage "true") 57 | (ShowExactMetricValue "false") 58 | (ErodeMask "false") 59 | 60 | 61 | // ********** ImageSampler 62 | 63 | //Number of spatial samples used to compute the mutual information in each resolution level: 64 | (ImageSampler "RandomCoordinate") 65 | (NumberOfSpatialSamples 2000) 66 | (NewSamplesEveryIteration "true") 67 | (UseRandomSampleRegion "false") 68 | (SampleRegionSize 50.0 50.0 50.0) 69 | (MaximumNumberOfSamplingAttempts 10) 70 | 71 | 72 | // ********** Interpolator and Resampler 73 | 74 | //Order of B-Spline interpolation used in each resolution level: 75 | (BSplineInterpolationOrder 1) 76 | 77 | //Order of B-Spline interpolation used for applying the final deformation: 78 | (FinalBSplineInterpolationOrder 3) 79 | 80 | //Default pixel value for pixels that come from outside the picture: 81 | (DefaultPixelValue 0) 82 | 83 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters.similarity.txt: -------------------------------------------------------------------------------- 1 | // ********** Image Types 2 | 3 | (FixedInternalImagePixelType "float") 4 | (FixedImageDimension 3) 5 | (MovingInternalImagePixelType "float") 6 | (MovingImageDimension 3) 7 | 8 | 9 | // ********** Components 10 | 11 | (Registration "MultiMetricMultiResolutionRegistration") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Interpolator "BSplineInterpolator") 15 | (Metric "AdvancedNormalizedCorrelation") 16 | (Optimizer "AdaptiveStochasticGradientDescent") 17 | //(Optimizer "StandardGradientDescent") 18 | (ResampleInterpolator "FinalBSplineInterpolator") 19 | (Resampler "DefaultResampler") 20 | (Transform "SimilarityTransform") 21 | 22 | 23 | // ********** Pyramid 24 | 25 | // Total number of resolutions 26 | (NumberOfResolutions 5) 27 | (ImagePyramidSchedule 8 8 8 8 8 8 4 4 4 2 2 2 1 1 1) 28 | 29 | // ********** Transform 30 | 31 | (HowToCombineTransforms "Compose") 32 | 33 | //Save composite ITK transform 34 | (ITKTransformOutputFileNameExtension "h5") 35 | (WriteITKCompositeTransform "true") 36 | 37 | 38 | // ********** Optimizer 39 | 40 | // Maximum number of iterations in each resolution level: 41 | (MaximumNumberOfIterations 500) 42 | //(MaximumNumberOfIterations 1000) 43 | 44 | (AutomaticParameterEstimation "true") 45 | (UseAdaptiveStepSizes "true") 46 | 47 | 48 | // ********** Metric 49 | 50 | // Just using the default values for the NC metric 51 | 52 | 53 | 54 | // ********** Several 55 | 56 | (WriteTransformParametersEachIteration "false") 57 | (WriteTransformParametersEachResolution "true") 58 | (WriteResultImageAfterEachResolution "false") 59 | (WriteResultImage "true") 60 | (CompressResultImage "false") 61 | (ResultImageFormat "mhd") 62 | (ShowExactMetricValue "false") 63 | (ErodeMask "true") 64 | 65 | 66 | // ********** ImageSampler 67 | 68 | //Number of spatial samples used to compute the mutual information in each resolution level: 69 | (ImageSampler "RandomCoordinate") 70 | (NumberOfSpatialSamples 2000) 71 | (NewSamplesEveryIteration "true") 72 | (UseRandomSampleRegion "false") 73 | 74 | 75 | // ********** Interpolator and Resampler 76 | 77 | //Order of B-Spline interpolation used in each resolution level: 78 | (BSplineInterpolationOrder 1) 79 | 80 | //Order of B-Spline interpolation used for applying the final deformation: 81 | (FinalBSplineInterpolationOrder 3) 82 | 83 | //Default pixel value for pixels that come from outside the picture: 84 | (DefaultPixelValue 0) 85 | 86 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters_BSplineNCC.txt: -------------------------------------------------------------------------------- 1 | // **************** Image Types ****************************** 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // **************** Main Components ************************** 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (Interpolator "BSplineInterpolator") 10 | (ResampleInterpolator "FinalBSplineInterpolator") 11 | (Resampler "DefaultResampler") 12 | (FixedImagePyramid "FixedSmoothingImagePyramid") 13 | (MovingImagePyramid "MovingSmoothingImagePyramid") 14 | (Optimizer "AdaptiveStochasticGradientDescent") 15 | (Transform "BSplineTransform") 16 | (Metric "AdvancedNormalizedCorrelation") 17 | 18 | // ***************** Transformation ************************** 19 | 20 | (FinalGridSpacingInPhysicalUnits 7) 21 | (GridSpacingSchedule 16 8 4 2 1 ) 22 | (HowToCombineTransforms "Compose") 23 | 24 | //Save composite ITK transform 25 | (ITKTransformOutputFileNameExtension "h5") 26 | (WriteITKCompositeTransform "true") 27 | 28 | // ******************* Similarity measure ********************* 29 | 30 | (NumberOfHistogramBins 32 ) 31 | (ErodeMask "false") 32 | 33 | // ******************** Multiresolution ********************** 34 | 35 | (NumberOfResolutions 5) 36 | (ImagePyramidSchedule 16 16 8 8 8 4 4 4 2 2 2 1 1 1 1 ) 37 | 38 | // ******************* Optimizer **************************** 39 | 40 | (MaximumNumberOfIterations 1000) 41 | 42 | // **************** Image sampling ********************** 43 | 44 | (NumberOfSpatialSamples 2048) 45 | (NewSamplesEveryIteration "true") 46 | (ImageSampler "RandomCoordinate") 47 | 48 | // ************* Interpolation and Resampling **************** 49 | 50 | (BSplineInterpolationOrder 1) 51 | (FinalBSplineInterpolationOrder 3) 52 | (DefaultPixelValue -1) 53 | (WriteResultImage "true") 54 | (ResultImagePixelType "short") 55 | (ResultImageFormat "mhd") 56 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Parameters_RigidAMS.txt: -------------------------------------------------------------------------------- 1 | // **************** Image Types ****************************** 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // **************** Main Components ************************** 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (Interpolator "BSplineInterpolator") 10 | (ResampleInterpolator "FinalBSplineInterpolator") 11 | (Resampler "DefaultResampler") 12 | (FixedImagePyramid "FixedRecursiveImagePyramid") 13 | (MovingImagePyramid "MovingRecursiveImagePyramid") 14 | (Optimizer "AdaptiveStochasticGradientDescent") 15 | (Transform "EulerTransform") 16 | (Metric "AdvancedMeanSquares") 17 | 18 | // ***************** Transformation ************************** 19 | 20 | (AutomaticScalesEstimation "true") 21 | (AutomaticTransformInitialization "false") 22 | (HowToCombineTransforms "Compose") 23 | 24 | //Save composite ITK transform 25 | (ITKTransformOutputFileNameExtension "h5") 26 | (WriteITKCompositeTransform "true") 27 | 28 | // ******************* Similarity measure ********************* 29 | 30 | (UseNormalization "true") 31 | (ErodeMask "false") 32 | 33 | // ******************** Multiresolution ********************** 34 | 35 | (NumberOfResolutions 4) 36 | (ImagePyramidSchedule 8 8 4 4 4 2 2 2 1 1 1 1 ) 37 | 38 | // ******************* Optimizer **************************** 39 | 40 | (MaximumNumberOfIterations 250) 41 | 42 | // **************** Image sampling ********************** 43 | 44 | (NumberOfSpatialSamples 2048) 45 | (NewSamplesEveryIteration "true") 46 | (ImageSampler "Random") 47 | 48 | // ************* Interpolation and Resampling **************** 49 | 50 | (BSplineInterpolationOrder 1) 51 | (FinalBSplineInterpolationOrder 3) 52 | (DefaultPixelValue -1) 53 | (WriteResultImage "false") 54 | (ResultImagePixelType "short") 55 | (ResultImageFormat "mhd") 56 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Rigid.txt: -------------------------------------------------------------------------------- 1 | (FixedInternalImagePixelType "float") 2 | (MovingInternalImagePixelType "float") 3 | 4 | // **************** Main Components ************************** 5 | 6 | (Registration "MultiResolutionRegistration") 7 | (Interpolator "BSplineInterpolator") 8 | (ResampleInterpolator "FinalBSplineInterpolator") 9 | (Resampler "DefaultResampler") 10 | (FixedImagePyramid "FixedSmoothingImagePyramid") 11 | (MovingImagePyramid "MovingSmoothingImagePyramid") 12 | 13 | (Optimizer "AdaptiveStochasticGradientDescent") 14 | (Transform "EulerTransform") 15 | (Metric "AdvancedMattesMutualInformation") 16 | 17 | // ***************** Transformation ************************** 18 | 19 | (AutomaticScalesEstimation "true") 20 | (AutomaticTransformInitialization "true") 21 | (HowToCombineTransforms "Compose") 22 | 23 | //Save composite ITK transform 24 | (ITKTransformOutputFileNameExtension "h5") 25 | (WriteITKCompositeTransform "true") 26 | 27 | // ******************* Similarity measure ********************* 28 | 29 | (NumberOfHistogramBins 64) 30 | (ErodeMask "false") 31 | 32 | // ******************** Multiresolution ********************** 33 | 34 | (NumberOfResolutions 3) 35 | (ImagePyramidSchedule 8 8 2 4 4 1 1 1 1 ) 36 | 37 | // ******************* Optimizer **************************** 38 | 39 | (MaximumNumberOfIterations 500) 40 | (MaximumStepLength 1.0) 41 | (RequiredRatioOfValidSamples 0.05) 42 | 43 | // **************** Image sampling ********************** 44 | 45 | (NumberOfSpatialSamples 2000) 46 | (NewSamplesEveryIteration "true") 47 | (ImageSampler "Random") 48 | 49 | // ************* Interpolation and Resampling **************** 50 | 51 | (BSplineInterpolationOrder 1) 52 | (FinalBSplineInterpolationOrder 3) 53 | 54 | (DefaultPixelValue 0) 55 | (WriteResultImage "true") 56 | (ResultImagePixelType "short") 57 | (ResultImageFormat "mhd") 58 | -------------------------------------------------------------------------------- /Elastix/Resources/RegistrationParameters/Rigid_parameter-file.txt: -------------------------------------------------------------------------------- 1 | // **************** Image Types ****************************** 2 | 3 | (FixedInternalImagePixelType "float") 4 | (MovingInternalImagePixelType "float") 5 | 6 | // **************** Main Components ************************** 7 | 8 | (Registration "MultiResolutionRegistration") 9 | (Interpolator "BSplineInterpolator") 10 | (ResampleInterpolator "FinalBSplineInterpolator") 11 | (Resampler "DefaultResampler") 12 | (FixedImagePyramid "FixedRecursiveImagePyramid") 13 | (MovingImagePyramid "MovingRecursiveImagePyramid") 14 | (Optimizer "AdaptiveStochasticGradientDescent") 15 | (Transform "EulerTransform") 16 | (Metric "AdvancedMeanSquares") 17 | 18 | // ***************** Transformation ************************** 19 | 20 | (AutomaticScalesEstimation "true") 21 | (AutomaticTransformInitialization "false") 22 | (HowToCombineTransforms "Compose") 23 | 24 | //Save composite ITK transform 25 | (ITKTransformOutputFileNameExtension "h5") 26 | (WriteITKCompositeTransform "true") 27 | 28 | // ******************* Similarity measure ********************* 29 | 30 | (UseNormalization "true") 31 | (ErodeMask "false") 32 | 33 | // ******************** Multiresolution ********************** 34 | 35 | (NumberOfResolutions 4) 36 | (ImagePyramidSchedule 8 8 4 4 4 2 2 2 1 1 1 1 ) 37 | 38 | // ******************* Optimizer **************************** 39 | 40 | (MaximumNumberOfIterations 250) 41 | 42 | // **************** Image sampling ********************** 43 | 44 | (NumberOfSpatialSamples 2048) 45 | (NewSamplesEveryIteration "true") 46 | (ImageSampler "Random") 47 | 48 | // ************* Interpolation and Resampling **************** 49 | 50 | (BSplineInterpolationOrder 1) 51 | (FinalBSplineInterpolationOrder 3) 52 | (DefaultPixelValue 0) 53 | (WriteResultImage "true") 54 | (ResultImagePixelType "short") 55 | (ResultImageFormat "mhd") 56 | -------------------------------------------------------------------------------- /Elastix/Testing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Python) 2 | -------------------------------------------------------------------------------- /Elastix/Testing/Python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | #slicer_add_python_unittest(SCRIPT ${MODULE_NAME}ModuleTest.py) 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 SlicerElastix module contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SlicerElastix 2 | This extension makes available Elastix medical image registration toolkit (https://elastix.dev) available in Slicer. 3 | 4 | ![](Screenshot01.jpg) 5 | 6 | ## Installation 7 | 8 | * Download and install latest stable release or a recent nightly release of 3D Slicer (https://download.slicer.org). 9 | * Start 3D Slicer application, open the Extension Manager (menu: View / Extension manager) 10 | * Install SlicerElastix extension (in Registration category) 11 | 12 | ## Register two volumes 13 | 14 | * Start 3D Slicer 15 | * Load your volumes (for example: switch to SampleData module and load MRBrainTumor1 and MRBrainTumor2 images) 16 | * Switch to General registration (Elastix) module (in Registration category) 17 | * Select Fixed volume (for example: MRBrainTumor1) 18 | * Select Moving volume (this volume will be resampled to match voxels of the Fixed volume; for example: MRBrainTumor2) 19 | * Select Preset: `generic (all)` performs deformable registration; `generic rigid (all)` performs rigid registration 20 | * Select "Create new Volume" for Output volume (this will be the resampled moving volume) 21 | * Select "Create new Transform" if later you want to visualize the displacement field or apply the transform to other nodes (points, surfaces, other volumes) 22 | * Click Apply button and wait a couple of minutes 23 | 24 | ## Visualize and save results 25 | * To compare Fixed volume with Output volume (registered moving volume): set Fixed volume as Foreground volume in slice viewers and fade between the Output volume and Foreground volume to see how well they are aligned. 26 | * To display displacement field: in Transforms module, select the Output transform and in Display section enable visualization in slice and/or 3D views. 27 | * To apply transforms to other nodes: use Transforms module (or in Data module / Transform hierarchy tab: drag-and-drop nodes under the Output transform). 28 | * To save Output volume or transform, select menu: File / Save. 29 | 30 | 31 | ## Customize registration parameters 32 | 33 | * Click `Show database folder` in Advanced section, which will open the tolder that contains all registration preset parameter files 34 | * Edit the parameter set database file (`ElastixParameterSetDatabase.xml`) to edit or add a new preset (each `ParameterSet` element defines one preset) 35 | * To modify parameters of a registration step, edit the corresponding `.txt` parameter file 36 | -------------------------------------------------------------------------------- /Screenshot01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lassoan/SlicerElastix/9ec57ae3b4baa613fe03e4af756a8d00ed6ff638/Screenshot01.jpg -------------------------------------------------------------------------------- /SlicerElastix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lassoan/SlicerElastix/9ec57ae3b4baa613fe03e4af756a8d00ed6ff638/SlicerElastix.png -------------------------------------------------------------------------------- /SlicerElastix.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lassoan/SlicerElastix/9ec57ae3b4baa613fe03e4af756a8d00ed6ff638/SlicerElastix.xcf -------------------------------------------------------------------------------- /SuperBuild.cmake: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------------------------- 2 | # Enable and setup External project global properties 3 | #----------------------------------------------------------------------------- 4 | 5 | set(ep_common_c_flags "${CMAKE_C_FLAGS_INIT} ${ADDITIONAL_C_FLAGS}") 6 | set(ep_common_cxx_flags "${CMAKE_CXX_FLAGS_INIT} ${ADDITIONAL_CXX_FLAGS}") 7 | 8 | #----------------------------------------------------------------------------- 9 | # Project dependencies 10 | #----------------------------------------------------------------------------- 11 | 12 | include(ExternalProject) 13 | 14 | foreach(dep ${EXTENSION_DEPENDS}) 15 | mark_as_superbuild(${dep}_DIR) 16 | endforeach() 17 | 18 | set(proj ${SUPERBUILD_TOPLEVEL_PROJECT}) 19 | set(${proj}_DEPENDS elastix) 20 | 21 | ExternalProject_Include_Dependencies(${proj} 22 | PROJECT_VAR proj 23 | SUPERBUILD_VAR ${EXTENSION_NAME}_SUPERBUILD 24 | ) 25 | 26 | ExternalProject_Add(${proj} 27 | ${${proj}_EP_ARGS} 28 | DOWNLOAD_COMMAND "" 29 | INSTALL_COMMAND "" 30 | SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} 31 | BINARY_DIR ${EXTENSION_BUILD_SUBDIRECTORY} 32 | BUILD_ALWAYS 1 33 | CMAKE_CACHE_ARGS 34 | -DSubversion_SVN_EXECUTABLE:STRING=${Subversion_SVN_EXECUTABLE} 35 | -DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE} 36 | -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} 37 | -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags} 38 | -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} 39 | -DCMAKE_C_FLAGS:STRING=${ep_common_c_flags} 40 | -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} 41 | -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} 42 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} 43 | -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} 44 | -DMIDAS_PACKAGE_EMAIL:STRING=${MIDAS_PACKAGE_EMAIL} 45 | -DMIDAS_PACKAGE_API_KEY:STRING=${MIDAS_PACKAGE_API_KEY} 46 | -D${EXTENSION_NAME}_SUPERBUILD:BOOL=OFF 47 | -DEXTENSION_SUPERBUILD_BINARY_DIR:PATH=${${EXTENSION_NAME}_BINARY_DIR} 48 | DEPENDS 49 | ${${proj}_DEPENDS} 50 | ) 51 | -------------------------------------------------------------------------------- /SuperBuild/External_elastix.cmake: -------------------------------------------------------------------------------- 1 | set(proj elastix) 2 | set(ep_common_cxx_flags "${CMAKE_CXX_FLAGS_INIT} ${ADDITIONAL_CXX_FLAGS}") 3 | # Set dependency list 4 | set(${proj}_DEPENDS "") 5 | if(DEFINED Slicer_SOURCE_DIR) 6 | list(APPEND ${proj}_DEPENDS 7 | ITK 8 | ) 9 | endif() 10 | 11 | # Include dependent projects if any 12 | ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj) 13 | 14 | if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}) 15 | message(FATAL_ERROR "Enabling ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} is not supported !") 16 | endif() 17 | 18 | # Sanity checks 19 | if(DEFINED elastix_DIR AND NOT EXISTS ${elastix_DIR}) 20 | message(FATAL_ERROR "elastix_DIR variable is defined but corresponds to nonexistent directory") 21 | endif() 22 | 23 | if(NOT DEFINED ${proj}_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}) 24 | 25 | set(${proj}_INSTALL_DIR ${CMAKE_BINARY_DIR}/${proj}-install) 26 | set(${proj}_DIR ${CMAKE_BINARY_DIR}/${proj}-build) 27 | set(${proj}_BINARY_DIR ${CMAKE_BINARY_DIR}/${proj}-build) 28 | 29 | if (APPLE) 30 | set(${proj}_cxx_flags "${ep_common_cxx_flags} -Wno-inconsistent-missing-override") 31 | endif() 32 | 33 | message(STATUS "ITK version: ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}.") 34 | if(DEFINED ITK_VERSION_MAJOR AND ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR} VERSION_LESS 5.0) 35 | set(ELASTIX_GIT_REPOSITORY "$https://github.com/SuperElastix/elastix.git") 36 | set(ELASTIX_GIT_TAG "419313e9cc12727d73c7e6e47fbdf960aa1218b9") # latest commit on "develop" branch as if 2019-10-13 37 | else() 38 | set(ELASTIX_GIT_REPOSITORY "https://github.com/SuperElastix/elastix.git") 39 | set(ELASTIX_GIT_TAG "5.1.0") # 2023-01-12 40 | endif() 41 | 42 | ExternalProject_Add(${proj} 43 | # Slicer 44 | ${${proj}_EP_ARGS} 45 | SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} 46 | #SOURCE_SUBDIR src # requires CMake 3.7 or later 47 | BINARY_DIR ${${proj}_BINARY_DIR} 48 | INSTALL_DIR ${${proj}_INSTALL_DIR} 49 | GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY} 50 | GIT_TAG ${ELASTIX_GIT_TAG} 51 | #--Configure step------------- 52 | CMAKE_CACHE_ARGS 53 | -DSubversion_SVN_EXECUTABLE:STRING=${Subversion_SVN_EXECUTABLE} 54 | -DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE} 55 | -DITK_DIR:STRING=${ITK_DIR} 56 | -DUSE_KNNGraphAlphaMutualInformationMetric:BOOL=OFF 57 | # OpenMP is not included in the package, turn it off for now 58 | # It could be nice to enable it in the future, as it may improve performance 59 | # of some metrics, but if we add OpenMP shared library to the package then 60 | # that might cause problem for other executables. 61 | -DELASTIX_USE_OPENMP:BOOL=OFF 62 | -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} 63 | -DCMAKE_CXX_FLAGS:STRING=${${proj}_cxx_flags} 64 | -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} 65 | -DCMAKE_C_FLAGS:STRING=${ep_common_c_flags} 66 | -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} 67 | -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} 68 | -DBUILD_TESTING:BOOL=OFF 69 | -DCMAKE_MACOSX_RPATH:BOOL=0 70 | # location of elastix.exe and transformix.exe in the build tree: 71 | -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${Slicer_THIRDPARTY_BIN_DIR} 72 | -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${Slicer_THIRDPARTY_LIB_DIR} 73 | -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} 74 | -DELASTIX_RUNTIME_DIR:STRING=${Slicer_INSTALL_THIRDPARTY_LIB_DIR} 75 | -DELASTIX_LIBRARY_DIR:STRING=${Slicer_INSTALL_THIRDPARTY_LIB_DIR} 76 | #--Build step----------------- 77 | #--Install step----------------- 78 | # Don't perform installation at the end of the build 79 | INSTALL_COMMAND "" 80 | DEPENDS 81 | ${${proj}_DEPENDS} 82 | ) 83 | #set(${proj}_DIR ${${proj}_INSTALL_DIR}) 84 | #if(UNIX) 85 | # set(${proj}_DIR ${${proj}_INSTALL_DIR}/share/elastix) 86 | #endif() 87 | 88 | else() 89 | ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDS}) 90 | endif() 91 | 92 | mark_as_superbuild(${proj}_DIR:PATH) 93 | --------------------------------------------------------------------------------