diff --git a/README.md b/README.md
index 755ec5c..9149f46 100644
--- a/README.md
+++ b/README.md
@@ -1,29 +1,23 @@
-# Intent of this template
+### Contents
-The intent of this repo is to help you get started with creating Pydra tasks.
-All tasks will be inserted into pydra.tasks. namespace.
+* `xmls`: a directory containing all the xmls from which pydra tasks should be generated.
+* `generate_tasks.py`: the script which automatically generates pydra tasks.
-# To use this template:
+### How to use
-1. Click on new repo.
-2. Select this template from the repository template drop down list.
-3. Give your repo a name.
-4. Once the repo is created and cloned, search for TODO (`grep -rn TODO . `) and
- replace with appropriate name.
-5. One of the folders is called TODO. This should also be renamed to your package
- name.
-6. Add tasks to the pydra/tasks/ folder.
-7. You may want to initialize a sphinx docs directory.
-
-# TODO: Change this README after creating your new repo.
+`tools/generate_tasks.py` takes 2 optional arguments: the `output directory` and the `xml directory`.
+```bash
+python tools/generate_tasks.py [output directory] [xml directory]
+```
-## For developers
+* `output directory`: the directory that the generated tasks should be rooted at.
+If omitted the current working directory is used.
+* `xml directory`: a directory which contains xmls. The names of the xmls must match the names in module_list.
+If omitted binary files are used which must be found on the default path.
-Install repo in developer mode from the source directory. It is also useful to
-install pre-commit to take care of styling via black:
+### Command to use
-```
-pip install -e .[dev]
-pre-commit install
+```bash
+python tools/generate_tasks.py pydra/tasks/sem/ tools/xmls/
```
diff --git a/tools/generate_tasks.py b/tools/generate_tasks.py
new file mode 100644
index 0000000..f06d84b
--- /dev/null
+++ b/tools/generate_tasks.py
@@ -0,0 +1,738 @@
+"""
+This script generates Slicer Interfaces based on the CLI modules XML. CLI
+modules are selected from the hardcoded list below and generated code is placed
+in the cli_modules.py file (and imported in __init__.py). For this to work
+correctly you must have your CLI executables in $PATH
+"""
+import keyword
+import os
+import shutil
+import subprocess
+import sys
+import xml.dom.minidom
+
+header = """\
+\"""
+Autogenerated file - DO NOT EDIT
+If you spot a bug, please report it on the mailing list and/or change the generator.
+\"""\n
+"""
+
+imports = """\
+import attr
+from nipype.interfaces.base import Directory, File, InputMultiPath, OutputMultiPath, traits
+from pydra import ShellCommandTask
+from pydra.engine.specs import SpecInfo, ShellSpec, MultiInputFile, MultiOutputFile, MultiInputObj
+import pydra\n\n
+"""
+
+setup = """\
+def configuration(parent_package="", top_path=None):
+ from numpy.distutils.misc_util import Configuration
+
+ config = Configuration("{pkg_name}", parent_package, top_path)
+
+ {sub_pks}
+
+ return config
+
+if __name__ == "__main__":
+ from numpy.distutils.core import setup
+ setup(**configuration(top_path="").todict())
+"""
+
+# launcher_space = ""
+# if len({launcher})>0:
+# launcher_space = " "
+
+template = """\
+class {module_name}():
+ def __init__(self, name="{module_name}", executable="{launcher}{module}", cache_dir=None):
+ self.name = name
+ self.executable = executable
+ self.cache_dir = cache_dir
+ \"""
+{docstring}\
+ \"""
+ def get_task(self):
+ input_fields = [{input_fields}]
+ output_fields = [{output_fields}]
+
+ input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,))
+ output_spec = SpecInfo(name="Output", fields=output_fields, bases=(pydra.specs.ShellOutSpec,))
+
+ task = ShellCommandTask(
+ name=self.name,
+ executable=self.executable,
+ input_spec=input_spec,
+ output_spec=output_spec,
+ cache_dir=self.cache_dir
+ )
+ return task
+"""
+
+
+def force_to_valid_python_variable_name(old_name):
+ """Valid c++ names are not always valid in python, so
+ provide alternate naming
+
+ >>> force_to_valid_python_variable_name('lambda')
+ 'opt_lambda'
+ >>> force_to_valid_python_variable_name('inputVolume')
+ 'inputVolume'
+ """
+ new_name = old_name.strip()
+ if new_name in keyword.kwlist:
+ return f"opt_{new_name}"
+ else:
+ return new_name
+
+
+def add_class_to_package(class_codes, class_names, module_name, package_dir):
+ # with open(os.path.join(package_dir, "__init__.py"), mode="a+") as f:
+ # f.write(
+ # "from {module_name} import {class_names}\n".format(
+ # module_name=module_name, class_names=", ".join(class_names)
+ # )
+ # )
+ with open(os.path.join(package_dir, f"{module_name}.py"), mode="w") as f:
+ f.write(header)
+ f.write(imports)
+ f.write("\n\n".join(class_codes))
+
+
+def crawl_code_struct(code_struct, package_dir):
+ subpackages = []
+ for k, v in code_struct.items():
+ if isinstance(v, (str, bytes)):
+ module_name = k.lower()
+ class_name = k
+ class_code = v
+ add_class_to_package([class_code], [class_name], module_name, package_dir)
+ else:
+ l1 = {}
+ l2 = {}
+ for key in list(v.keys()):
+ if isinstance(v[key], (str, bytes)):
+ l1[key] = v[key]
+ else:
+ l2[key] = v[key]
+ if l2:
+ v = l2
+ subpackages.append(k.lower())
+ # with open(os.path.join(package_dir, "__init__.py"), mode="a+") as f:
+ # f.write(f"from {k.lower()} import *\n")
+ new_pkg_dir = os.path.join(package_dir, k.lower())
+ if os.path.exists(new_pkg_dir):
+ shutil.rmtree(new_pkg_dir)
+ os.mkdir(new_pkg_dir)
+ crawl_code_struct(v, new_pkg_dir)
+ if l1:
+ for ik, iv in l1.items():
+ crawl_code_struct({ik: {ik: iv}}, new_pkg_dir)
+ elif l1:
+ v = l1
+ module_name = k.lower()
+ add_class_to_package(
+ list(v.values()), list(v.keys()), module_name, package_dir
+ )
+ if subpackages:
+ with open(os.path.join(package_dir, "setup.py"), mode="w") as f:
+ f.write(
+ setup.format(
+ pkg_name=package_dir.split("/")[-1],
+ sub_pks="\n ".join(
+ [
+ f'config.add_data_dir("{sub_pkg}")'
+ for sub_pkg in subpackages
+ ]
+ ),
+ )
+ )
+
+
+def generate_all_classes(
+ modules_list=[],
+ launcher=[],
+ redirect_x=False,
+ mipav_hacks=False,
+ xml_dir=None,
+ output_dir=None,
+):
+ """modules_list contains all the SEM compliant tools that should have wrappers created for them.
+ launcher contains the command line prefix wrapper arguments needed to prepare
+ a proper environment for each of the modules.
+ """
+ all_code = {}
+ for module in modules_list:
+ print("=" * 80)
+ print(f"Generating Definition for module {module}")
+ print("^" * 80)
+ package, code, module = generate_class(
+ module,
+ launcher,
+ redirect_x=redirect_x,
+ mipav_hacks=mipav_hacks,
+ xml_dir=xml_dir,
+ )
+ cur_package = all_code
+ module_name = package.strip().split(" ")[0].split(".")[-1]
+ for package in package.strip().split(" ")[0].split(".")[:-1]:
+ if package not in cur_package:
+ cur_package[package] = {}
+ cur_package = cur_package[package]
+ if module_name not in cur_package:
+ cur_package[module_name] = {}
+ cur_package[module_name][module] = code
+ package_dir = output_dir if output_dir else os.getcwd()
+ if not os.path.exists(package_dir):
+ os.makedirs(package_dir)
+ # if os.path.exists(os.path.join(package_dir, "__init__.py")):
+ # os.unlink(os.path.join(package_dir, "__init__.py"))
+ crawl_code_struct(all_code, package_dir)
+ os.system(f"black {package_dir}")
+
+
+def generate_class(
+ module,
+ launcher,
+ strip_module_name_prefix=True,
+ redirect_x=False,
+ mipav_hacks=False,
+ xml_dir=None,
+):
+ if xml_dir:
+ dom = dom_from_xml(module, xml_dir)
+ else:
+ dom = dom_from_binary(module, launcher, mipav_hacks=mipav_hacks)
+ if strip_module_name_prefix:
+ module_name = module.split(".")[-1]
+ else:
+ module_name = module
+ inputTraits = []
+ outputTraits = []
+ outputs_filenames = {}
+
+ # self._outputs_nodes = []
+
+ docstring = ""
+
+ for desc_str in [
+ "title",
+ "category",
+ "description",
+ "version",
+ "documentation-url",
+ "license",
+ "contributor",
+ "acknowledgements",
+ ]:
+ el = dom.getElementsByTagName(desc_str)
+ if el and el[0].firstChild and el[0].firstChild.nodeValue.strip():
+ docstring += " {desc_str}: {el}\n".format(
+ desc_str=desc_str, el=el[0].firstChild.nodeValue.strip()
+ )
+ if desc_str == "category":
+ category = el[0].firstChild.nodeValue.strip()
+
+ for paramGroup in dom.getElementsByTagName("parameters"):
+ indices = paramGroup.getElementsByTagName("index")
+ max_index = 0
+ for index in indices:
+ if int(index.firstChild.nodeValue) > max_index:
+ max_index = int(index.firstChild.nodeValue)
+ for param in paramGroup.childNodes:
+ if param.nodeName in ["label", "description", "#text", "#comment"]:
+ continue
+ traitsParams = {}
+
+ longFlagNode = param.getElementsByTagName("longflag")
+ if longFlagNode:
+ # Prefer to use longFlag as name if it is given, rather than the parameter name
+ longFlagName = longFlagNode[0].firstChild.nodeValue
+ # SEM automatically strips prefixed "--" or "-" from from xml before processing
+ # we need to replicate that behavior here The following
+ # two nodes in xml have the same behavior in the program
+ # --test
+ # test
+ longFlagName = longFlagName.lstrip(" -").rstrip(" ")
+ name = longFlagName
+ name = force_to_valid_python_variable_name(name)
+ traitsParams["argstr"] = f"--{longFlagName} "
+ else:
+ name = param.getElementsByTagName("name")[0].firstChild.nodeValue
+ name = force_to_valid_python_variable_name(name)
+ if param.getElementsByTagName("index"):
+ traitsParams["argstr"] = ""
+ else:
+ traitsParams["argstr"] = f"--{name} "
+
+ if (
+ param.getElementsByTagName("description")
+ and param.getElementsByTagName("description")[0].firstChild
+ ):
+ traitsParams["help_string"] = (
+ param.getElementsByTagName("description")[0]
+ .firstChild.nodeValue.replace('"', '\\"')
+ .replace("\n", ", ")
+ )
+ else:
+ traitsParams["help_string"] = ""
+
+ # argsDict = {
+ # "directory": "%s",
+ # "file": "%s",
+ # "integer": "%d",
+ # "double": "%f",
+ # "float": "%f",
+ # "image": "%s",
+ # "transform": "%s",
+ # "boolean": "",
+ # "string-enumeration": "%s",
+ # "string": "%s",
+ # "integer-enumeration": "%s",
+ # "table": "%s",
+ # "point": "%s",
+ # "region": "%s",
+ # "geometry": "%s",
+ # }
+
+ # if param.nodeName.endswith("-vector"):
+ # traitsParams["argstr"] += "%s"
+ # else:
+ # traitsParams["argstr"] += argsDict[param.nodeName]
+
+ index = param.getElementsByTagName("index")
+ if index:
+ traitsParams["position"] = int(index[0].firstChild.nodeValue) - (
+ max_index + 1
+ )
+
+ desc = param.getElementsByTagName("description")
+ if index:
+ traitsParams["help_string"] = desc[0].firstChild.nodeValue
+
+ typesDict = {
+ "integer": "traits.Int",
+ "double": "traits.Float",
+ "float": "traits.Float",
+ "image": "File",
+ "transform": "File",
+ "boolean": "traits.Bool",
+ "string": "traits.Str",
+ "file": "File",
+ "geometry": "File",
+ "directory": "Directory",
+ "table": "File",
+ "point": "traits.List",
+ "region": "traits.List",
+ }
+
+ if param.nodeName.endswith("-enumeration"):
+ type = "traits.Enum"
+ values = [
+ '"{value}"'.format(
+ value=str(el.firstChild.nodeValue).replace('"', "")
+ )
+ for el in param.getElementsByTagName("element")
+ ]
+ elif param.nodeName.endswith("-vector"):
+ type = "MultiInputObj"
+ if param.nodeName in [
+ "file",
+ "directory",
+ "image",
+ "geometry",
+ "transform",
+ "table",
+ ]:
+ values = [
+ "{type}(exists=True)".format(
+ type=typesDict[param.nodeName.replace("-vector", "")]
+ )
+ ]
+ else:
+ values = [typesDict[param.nodeName.replace("-vector", "")]]
+ if mipav_hacks is True:
+ traitsParams["sep"] = ";"
+ else:
+ traitsParams["sep"] = ","
+ elif (
+ param.getAttribute("multiple") == "true"
+ and "input" not in name
+ and "output" not in name
+ ):
+ type = "MultiInputFile"
+ # type = "File"
+ if param.nodeName in [
+ "file",
+ "directory",
+ "image",
+ "geometry",
+ "transform",
+ "table",
+ ]:
+ values = [
+ "{type}(exists=True)".format(type=typesDict[param.nodeName])
+ ]
+ elif param.nodeName in ["point", "region"]:
+ values = [
+ "{type}(traits.Float(), minlen=3, maxlen=3)".format(
+ type=typesDict[param.nodeName]
+ )
+ ]
+ else:
+ values = [typesDict[param.nodeName]]
+ traitsParams["sep"] = ","
+ # traitsParams["argstr"] += "..."
+ else:
+ values = []
+ type = typesDict[param.nodeName]
+
+ if param.nodeName in [
+ "file",
+ "directory",
+ "image",
+ "geometry",
+ "transform",
+ "table",
+ ]:
+ if not param.getElementsByTagName("channel"):
+ raise RuntimeError(
+ "Insufficient XML specification: each element of type 'file', 'directory', 'image', 'geometry', 'transform', or 'table' requires 'channel' field.\n{0}".format(
+ traitsParams
+ )
+ )
+ elif (
+ param.getElementsByTagName("channel")[0].firstChild.nodeValue
+ == "output"
+ ):
+ type = type.replace("Input", "Output")
+ # traitsParams["hash_files"] = False
+ inputTraits.append(
+ '("{name}", attr.ib(type={type}, metadata={{{params}}}))'.format(
+ name=name, type=type, params=parse_params(traitsParams)
+ )
+ )
+ # traitsParams["exists"] = True
+ traitsParams.pop("argstr")
+ traitsParams["output_file_template"] = f"{{{name}}}"
+ # traitsParams.pop("hash_files")
+ outputTraits.append(
+ '("{name}", attr.ib(type={type}, metadata={{{params}}}))'.format(
+ name=name,
+ type=f"pydra.specs.{type}",
+ params=parse_params(traitsParams),
+ )
+ )
+
+ outputs_filenames[name] = gen_filename_from_param(param, name)
+ elif (
+ param.getElementsByTagName("channel")[0].firstChild.nodeValue
+ == "input"
+ ):
+ # if param.nodeName in [
+ # "file",
+ # "directory",
+ # "image",
+ # "geometry",
+ # "transform",
+ # "table",
+ # ] and type not in ["InputMultiPath", "traits.List"]:
+ # traitsParams["exists"] = True
+ inputTraits.append(
+ '("{name}", attr.ib(type={type}, metadata={{{params}}}))'.format(
+ name=name, type=type, params=parse_params(traitsParams)
+ )
+ )
+ else:
+ raise RuntimeError(
+ "Insufficient XML specification: each element of type 'file', 'directory', 'image', 'geometry', 'transform', or 'table' requires 'channel' field to be in ['input','output'].\n{0}".format(
+ traitsParams
+ )
+ )
+ else: # For all other parameter types, they are implicitly only input types
+ inputTraits.append(
+ '("{name}", attr.ib(type={type}, metadata={{{params}}}))'.format(
+ name=name, type=type, params=parse_params(traitsParams)
+ )
+ )
+
+ if mipav_hacks:
+ blacklisted_inputs = ["maxMemoryUsage"]
+ inputTraits = [
+ trait for trait in inputTraits if trait.split()[0] not in blacklisted_inputs
+ ]
+
+ compulsory_inputs = [
+ 'xDefaultMem = traits.Int(help_string="Set default maximum heap size", argstr="-xDefaultMem %d")',
+ 'xMaxProcess = traits.Int(1, help_string="Set default maximum number of processes.", argstr="-xMaxProcess %d", usedefault=True)',
+ ]
+ inputTraits += compulsory_inputs
+
+ input_fields = ""
+ for trait in inputTraits:
+ input_fields += f"{trait}, "
+
+ output_fields = ""
+ for trait in outputTraits:
+ output_fields += f"{trait}, "
+
+ output_filenames = ",".join(
+ [f'"{key}":"{value}"' for key, value in outputs_filenames.items()]
+ )
+
+ main_class = template.format(
+ module_name=module_name,
+ docstring=docstring,
+ input_fields=input_fields,
+ output_fields=output_fields,
+ launcher=" ".join(launcher),
+ module=module,
+ )
+
+ return category, main_class, module_name
+
+
+def dom_from_binary(module, launcher, mipav_hacks=False):
+ # cmd = CommandLine(command = "Slicer3", args="--launch %s --xml"%module)
+ # ret = cmd.run()
+ command_list = launcher[:] # force copy to preserve original
+ command_list.extend([module, "--xml"])
+ final_command = " ".join(command_list)
+ xmlReturnValue = subprocess.Popen(
+ final_command, stdout=subprocess.PIPE, shell=True
+ ).communicate()[0]
+ if mipav_hacks:
+ # workaround for a jist bug https://www.nitrc.org/tracker/index.php?func=detail&aid=7234&group_id=228&atid=942
+ new_xml = ""
+ replace_closing_tag = False
+ for line in xmlReturnValue.splitlines():
+ if line.strip() == "":
+ new_xml += "\n"
+ replace_closing_tag = True
+ elif replace_closing_tag and line.strip() == "":
+ new_xml += "\n"
+ replace_closing_tag = False
+ else:
+ new_xml += f"{line}\n"
+
+ xmlReturnValue = new_xml
+
+ # workaround for a JIST bug https://www.nitrc.org/tracker/index.php?func=detail&aid=7233&group_id=228&atid=942
+ if xmlReturnValue.strip().endswith("XML"):
+ xmlReturnValue = xmlReturnValue.strip()[:-3]
+ if xmlReturnValue.strip().startswith("Error: Unable to set default atlas"):
+ xmlReturnValue = xmlReturnValue.strip()[
+ len("Error: Unable to set default atlas") :
+ ]
+ try:
+ dom = xml.dom.minidom.parseString(xmlReturnValue.strip())
+ except Exception as e:
+ print(xmlReturnValue.strip())
+ raise e
+ return dom
+
+
+# if ret.runtime.returncode == 0:
+# return xml.dom.minidom.parseString(ret.runtime.stdout)
+# else:
+# raise Exception(cmd.cmdline + " failed:\n%s"%ret.runtime.stderr)
+
+
+def dom_from_xml(module, xml_dir):
+ try:
+ dom = xml.dom.minidom.parse(os.path.join(xml_dir, f"{module}.xml"))
+ except Exception as e:
+ print(os.path.join(xml_dir, f"{module}.xml"))
+ raise e
+ return dom
+
+
+def parse_params(params):
+ list = []
+ for key, value in params.items():
+ if isinstance(value, (str, bytes)):
+ list.append(
+ '"{key}": "{value}"'.format(key=key, value=value.replace('"', "'"))
+ )
+ else:
+ list.append(f'"{key}": "{value}"')
+
+ return ", ".join(list)
+
+
+def parse_values(values):
+ values = [f"{value}" for value in values]
+ if len(values) > 0:
+ return ", ".join(values) + ", "
+ else:
+ return ""
+
+
+def gen_filename_from_param(param, base):
+ fileExtensions = param.getAttribute("fileExtensions")
+ if fileExtensions:
+ # It is possible that multiple file extensions can be specified in a
+ # comma separated list, This will extract just the first extension
+ firstFileExtension = fileExtensions.split(",")[0]
+ ext = firstFileExtension
+ else:
+ ext = {
+ "image": ".nii",
+ "transform": ".mat",
+ "file": "",
+ "directory": "",
+ "geometry": ".vtk",
+ }[param.nodeName]
+ return base + ext
+
+
+if __name__ == "__main__":
+ # NOTE: For now either the launcher needs to be found on the default path, or
+ # every tool in the modules list must be found on the default path
+ # AND calling the module with --xml must be supported and compliant.
+ modules_list = [
+ # "ACPCTransform",
+ # "AddScalarVolumes",
+ "BRAINSABC",
+ # "BRAINSAlignMSP",
+ # "BRAINSCleanMask",
+ # "BRAINSClipInferior",
+ "BRAINSConstellationDetector",
+ # "BRAINSConstellationDetectorGUI",
+ # "BRAINSConstellationLandmarksTransform",
+ # "BRAINSConstellationModeler",
+ "BRAINSCreateLabelMapFromProbabilityMaps",
+ # "BRAINSDWICleanup",
+ # "BRAINSEyeDetector",
+ # "BRAINSFit",
+ # "BRAINSInitializedControlPoints",
+ # "BRAINSLabelStats",
+ "BRAINSLandmarkInitializer",
+ # "BRAINSLinearModelerEPCA",
+ # "BRAINSLmkTransform",
+ # "BRAINSMultiModeSegment",
+ # "BRAINSMultiSTAPLE",
+ # "BRAINSMush",
+ # "BRAINSPosteriorToContinuousClass",
+ "BRAINSROIAuto",
+ "BRAINSResample",
+ # "BRAINSResize",
+ # "BRAINSSnapShotWriter",
+ # "BRAINSStripRotation",
+ # "BRAINSTalairach",
+ # "BRAINSTalairachMask",
+ # "BRAINSTransformConvert",
+ # "BRAINSTransformFromFiducials",
+ # "BRAINSTrimForegroundInDirection",
+ # "BinaryMaskEditorBasedOnLandmarks",
+ # "CLIROITest",
+ # "CastScalarVolume",
+ # "CheckerBoardFilter",
+ # "ComputeReflectiveCorrelationMetric",
+ # "CreateDICOMSeries",
+ # "CurvatureAnisotropicDiffusion",
+ # "DWICompare",
+ # # "DWIConvert",
+ # "DWISimpleCompare",
+ # "DiffusionTensorTest",
+ # "ESLR",
+ # # "ExecutionModelTour",
+ # "ExpertAutomatedRegistration",
+ # # "ExtractSkeleton",
+ # "FiducialRegistration",
+ # "FindCenterOfBrain",
+ # "GaussianBlurImageFilter",
+ # "GenerateAverageLmkFile",
+ # "GenerateEdgeMapImage",
+ # "GenerateLabelMapFromProbabilityMap",
+ # "GeneratePurePlugMask",
+ # "GradientAnisotropicDiffusion",
+ # "GrayscaleFillHoleImageFilter",
+ # "GrayscaleGrindPeakImageFilter",
+ # "GrayscaleModelMaker",
+ # "HistogramMatching",
+ # "ImageLabelCombine",
+ # "LabelMapSmoothing",
+ # "LandmarksCompare",
+ # "MaskScalarVolume",
+ # "MedianImageFilter",
+ # "MergeModels",
+ # "ModelMaker",
+ # "ModelToLabelMap",
+ # "MultiplyScalarVolumes",
+ # "N4ITKBiasFieldCorrection",
+ # "OrientScalarVolume",
+ # "PETStandardUptakeValueComputation",
+ # "PerformMetricTest",
+ # "ProbeVolumeWithModel",
+ # "ResampleDTIVolume",
+ # "ResampleScalarVectorDWIVolume",
+ # "ResampleScalarVolume",
+ # "RobustStatisticsSegmenter",
+ # "SimpleRegionGrowingSegmentation",
+ # "SubtractScalarVolumes",
+ # "TestGridTransformRegistration",
+ # "ThresholdScalarVolume",
+ # "VotingBinaryHoleFillingImageFilter",
+ # "compareTractInclusion",
+ # "extractNrrdVectorIndex",
+ # "fcsv_to_hdf5",
+ # "gtractAnisotropyMap",
+ # "gtractAverageBvalues",
+ # "gtractClipAnisotropy",
+ # "gtractCoRegAnatomy",
+ # "gtractCoRegAnatomyBspline",
+ # "gtractCoRegAnatomyRigid",
+ # "gtractConcatDwi",
+ # "gtractCopyImageOrientation",
+ # "gtractCoregBvalues",
+ # "gtractCostFastMarching",
+ # "gtractCreateGuideFiber",
+ # "gtractFastMarchingTracking",
+ # "gtractFiberTracking",
+ # "gtractFreeTracking",
+ # "gtractGraphSearchTracking",
+ # "gtractGuidedTracking",
+ # "gtractImageConformity",
+ # "gtractInvertBSplineTransform",
+ # "gtractInvertDisplacementField",
+ # "gtractInvertRigidTransform",
+ # "gtractResampleAnisotropy",
+ # "gtractResampleB0",
+ # "gtractResampleCodeImage",
+ # "gtractResampleDWIInPlace",
+ # "gtractResampleFibers",
+ # "gtractStreamlineTracking",
+ # "gtractTensor",
+ # "gtractTransformToDisplacementField",
+ # "insertMidACPCpoint",
+ # "landmarksConstellationAligner",
+ # "landmarksConstellationWeights",
+ # "simpleEM",
+ ]
+
+ launcher = []
+
+ arguments = sys.argv[1:]
+ num_arguments = len(arguments)
+
+ if num_arguments <= 2:
+ output_dir, xml_dir = arguments + [None] * (2 - num_arguments)
+ else:
+ raise ValueError(
+ f"expected at most 2 arguments [output directory, xml directory], received {num_arguments} arguments: {arguments}"
+ )
+
+ # SlicerExecutionModel compliant tools that are usually statically built, and don't need the Slicer3 --launcher
+ generate_all_classes(
+ modules_list=modules_list,
+ launcher=launcher,
+ xml_dir=xml_dir,
+ output_dir=output_dir,
+ )
+ # Tools compliant with SlicerExecutionModel called from the Slicer environment (for shared lib compatibility)
+ # launcher = ['/home/raid3/gorgolewski/software/slicer/Slicer', '--launch']
+ # generate_all_classes(modules_list=modules_list, launcher=launcher)
+ # generate_all_classes(modules_list=['BRAINSABC'], launcher=[] )
diff --git a/tools/xmls/ACPCTransform.xml b/tools/xmls/ACPCTransform.xml
new file mode 100644
index 0000000..78af9d9
--- /dev/null
+++ b/tools/xmls/ACPCTransform.xml
@@ -0,0 +1,37 @@
+
+
+ Registration.Specialized
+ ACPC Transform
+ 1
+ Calculate a transformation that aligns brain images to standard orientation based on anatomical landmarks.
The ACPC line extends between two points, one at the anterior commissure and one at the posterior commissure. The resulting transform will bring the line connecting the two points horizontal to the AP axis.
The midline is a series of points (at least 3) defining the division between the hemispheres of the brain (the mid sagittal plane). The resulting transform will result in the output volume having the mid sagittal plane lined up with the AS plane.
Use the Filtering module Resample Scalar/Vector/DWI Volume to apply the transformation to a volume.
Specify an Input Volume that is a segmented label map volume. Create a new Models hierarchy to provide a structure to contain the return models created from the input volume.
Create Multiple:
If you specify a list of Labels, it will over ride any start/end label settings.
If you click Generate All it will over ride the list of labels and any start/end label settings.
Model Maker Parameters:
You can set the number of smoothing iterations, target reduction in number of polygons (decimal percentage). Use 0 and 1 if you wish no smoothing nor decimation. You can set the flags to split normals or generate point normals in this pane as well. You can save a copy of the models after intermediate steps (marching cubes, smoothing, and decimation if not joint smoothing, otherwise just after decimation); these models are not saved in the mrml file, turn off deleting temporary files first in the python window: slicer.modules.modelmaker.cliModuleLogic().DeleteTemporaryFilesOff()
Set image values to a user-specified outside value if they are below, above, or between simple threshold values.
ThresholdAbove: The values greater than or equal to the threshold value are set to OutsideValue.
ThresholdBelow: The values less than or equal to the threshold value are set to OutsideValue.
ThresholdOutside: The values outside the range Lower-Upper are set to OutsideValue.
]]>
+ 0.1.0.$Revision: 2104 $(alpha)
+ http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Threshold
+
+ Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH), Julien Finet (Kitware)
+
+
+
+
+
+ InputVolume
+
+ input
+ 0
+
+
+
+ OutputVolume
+
+ output
+ 1
+
+
+
+
+
+
+ ThresholdType
+
+
+ --thresholdtype
+ Outside
+ Below
+ Above
+ Outside
+
+
+ ThresholdValue
+
+ -t
+ --threshold
+
+ 128
+
+
+ Lower
+
+ -l
+ --lower
+
+ 1
+
+
+ Upper
+
+ -u
+ --upper
+
+ 200
+
+
+ OutsideValue
+
+ -v
+ --outsidevalue
+
+ 0
+
+
+ Negate
+
+ -n
+ --negate
+
+ false
+
+
+
diff --git a/tools/xmls/VotingBinaryHoleFillingImageFilter.xml b/tools/xmls/VotingBinaryHoleFillingImageFilter.xml
new file mode 100644
index 0000000..73b2139
--- /dev/null
+++ b/tools/xmls/VotingBinaryHoleFillingImageFilter.xml
@@ -0,0 +1,61 @@
+
+
+ Filtering
+ Voting Binary Hole Filling Image Filter
+
+ 0.1.0.$Revision$(alpha)
+ http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/VotingBinaryHoleFillingImageFilter
+
+ Bill Lorensen (GE)
+
+
+
+
+
+ radius
+ --radius
+
+
+ 1,1,1
+
+
+ majorityThreshold
+ --majorityThreshold
+
+
+ 1
+
+
+ background
+ --background
+
+
+ 0
+
+
+ foreground
+ --foreground
+
+
+ 255
+
+
+
+
+
+
+ inputVolume
+
+ input
+ 0
+
+
+
+ outputVolume
+
+ output
+ 1
+
+
+
+
diff --git a/tools/xmls/compareTractInclusion.xml b/tools/xmls/compareTractInclusion.xml
new file mode 100644
index 0000000..1047d14
--- /dev/null
+++ b/tools/xmls/compareTractInclusion.xml
@@ -0,0 +1,95 @@
+
+
+ Diffusion.GTRACT
+ Compare Tracts
+
+ This program will halt with a status code indicating whether a test tract is nearly enough included in a standard tract in the sense that every fiber in the test tract has a low enough sum of squares distance to some fiber in the standard tract modulo spline resampling of every fiber to a fixed number of points.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for fiber tract comparison
+
+
+ testFiber
+ testFiber
+ Required: test fiber tract file name
+
+ input
+
+
+
+ standardFiber
+ standardFiber
+ Required: standard fiber tract file name
+
+ input
+
+
+
+
+
+
+ Output file from averaging fibers in a fiber tract
+
+
+ closeness
+ closeness
+ Closeness of every test fiber to some fiber in the standard tract, computed as a sum of squares of spatial differences of standard points
+
+ 100
+ input
+
+
+
+ numberOfPoints
+ numberOfPoints
+ Number of points in comparison fiber pairs
+
+ 100
+ input
+
+
+
+ testForBijection
+ testForBijection
+ Flag to apply the closeness criterion both ways
+
+ 0
+ input
+
+
+
+ testForFiberCardinality
+ testForFiberCardinality
+ Flag to require the same number of fibers in both tracts
+
+ 0
+ input
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of XML files when reading and writing vtkPolyData.
+
+ 0
+ input
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/extractNrrdVectorIndex.xml b/tools/xmls/extractNrrdVectorIndex.xml
new file mode 100644
index 0000000..ffe4dd7
--- /dev/null
+++ b/tools/xmls/extractNrrdVectorIndex.xml
@@ -0,0 +1,71 @@
+
+
+ Diffusion.GTRACT
+ Extract Nrrd Index
+
+ This program will extract a 3D image (single vector) from a vector 3D image at a given vector index.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying vector extraction
+
+
+ inputVolume
+ inputVolume
+ Required: input file containing the vector that will be extracted
+
+ input
+
+
+
+ vectorIndex
+ vectorIndex
+ Index in the vector image to extract
+
+ 0
+ input
+
+
+
+ setImageOrientation
+ setImageOrientation
+ Sets the image orientation of the extracted vector (Axial, Coronal, Sagittal)
+
+ AsAcquired
+ AsAcquired
+ Axial
+ Coronal
+ Sagittal
+ input
+
+
+
+
+
+ Output file containing the extracted vector in NRRD file form
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the vector image at the given index
+
+ output
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/fcsv_to_hdf5.xml b/tools/xmls/fcsv_to_hdf5.xml
new file mode 100644
index 0000000..337f627
--- /dev/null
+++ b/tools/xmls/fcsv_to_hdf5.xml
@@ -0,0 +1,61 @@
+
+
+ Utilities.BRAINS
+ fcsv_to_hdf5 (BRAINS)
+ Convert a collection of fcsv files to a HDF5 format file
+
+
+ Version
+ --versionID
+
+ Current version ID. It should be match with the version of BCD that will be using the output model file
+
+ v1.0
+
+
+ outputFile
+
+ --landmarksInformationFile
+
+
+ name of HDF5 file to write matrices into
+
+ output
+
+
+ landmarkTypesFile
+
+ --landmarkTypesList
+
+
+ file containing list of landmark types
+
+ input
+
+
+ modelFile
+
+ o
+ --modelFile
+
+
+ name of HDF5 file containing BRAINSConstellationDetector Model file (LLSMatrices, LLSMeans and LLSSearchRadii)
+
+ output
+
+
+ landmarkGlobPattern
+ landmarkGlobPattern
+ Glob pattern to select fcsv files
+
+ *.fcsv
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractAnisotropyMap.xml b/tools/xmls/gtractAnisotropyMap.xml
new file mode 100644
index 0000000..60d587b
--- /dev/null
+++ b/tools/xmls/gtractAnisotropyMap.xml
@@ -0,0 +1,66 @@
+
+
+ Diffusion.GTRACT
+ Anisotropy Map
+
+ This program will generate a scalar map of anisotropy, given a tensor representation. Anisotropy images are used for fiber tracking, but the anisotropy scalars are not defined along the path. Instead, the tensor representation is included as point data allowing all of these metrics to be computed using only the fiber tract point data. The images can be saved in any ITK supported format, but it is suggested that you use an image format that supports the definition of the image origin. This includes NRRD, NifTI, and Meta formats. These images can also be used for scalar analysis including regional anisotropy measures or VBM style analysis.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion tensor study
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required: input file containing the diffusion tensor image
+
+ input
+
+
+
+ anisotropyType
+ anisotropyType
+ Anisotropy Mapping Type: ADC, FA, RA, VR, AD, RD, LI
+
+ ADC
+ ADC
+ FA
+ RA
+ VR
+ AD
+ RD
+ LI
+ input
+
+
+
+
+
+ Output file from conversion from vector image to vcl_single NRRD
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the selected kind of anisotropy scalar.
+
+ output
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
+
diff --git a/tools/xmls/gtractAverageBvalues.xml b/tools/xmls/gtractAverageBvalues.xml
new file mode 100644
index 0000000..5ce507b
--- /dev/null
+++ b/tools/xmls/gtractAverageBvalues.xml
@@ -0,0 +1,63 @@
+
+
+ Diffusion.GTRACT
+ Average B-Values
+
+ This program will directly average together the baseline gradients (b value equals 0) within a DWI scan. This is usually used after gtractCoregBvalues.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying direct averaging of baseline gradients within a DWI scan
+
+
+ inputVolume
+ inputVolume
+ Required: input image file name containing multiple baseline gradients to average
+
+ input
+
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing directly averaged baseline images
+
+ output
+
+
+
+ directionsTolerance
+ directionsTolerance
+ Tolerance for matching identical gradient direction pairs
+
+ 0.01
+ input
+
+
+
+ averageB0only
+ averageB0only
+ Average only baseline gradients. All other gradient directions are not averaged, but retained in the outputVolume
+
+ 0
+ input
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractClipAnisotropy.xml b/tools/xmls/gtractClipAnisotropy.xml
new file mode 100644
index 0000000..7dab80a
--- /dev/null
+++ b/tools/xmls/gtractClipAnisotropy.xml
@@ -0,0 +1,63 @@
+
+
+ Diffusion.GTRACT
+ Clip Anisotropy
+
+ This program will zero the first and/or last slice of an anisotropy image, creating a clipped anisotropy image.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for clipping an anisotropy image
+
+
+ inputVolume
+ inputVolume
+ Required: input image file name
+
+ input
+
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the clipped anisotropy image
+
+ output
+
+
+
+ clipFirstSlice
+ clipFirstSlice
+ Clip the first slice of the anisotropy image
+
+ 0
+ input
+
+
+
+ clipLastSlice
+ clipLastSlice
+ Clip the last slice of the anisotropy image
+
+ 0
+ input
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractCoRegAnatomy.xml b/tools/xmls/gtractCoRegAnatomy.xml
new file mode 100644
index 0000000..f0d230f
--- /dev/null
+++ b/tools/xmls/gtractCoRegAnatomy.xml
@@ -0,0 +1,239 @@
+
+
+ Diffusion.GTRACT
+ Coregister B0 to Anatomy B-Spline
+
+ This program will register a Nrrd diffusion weighted 4D vector image to a fixed anatomical image. Two registration methods are supported for alignment with anatomical images: Rigid and B-Spline. The rigid registration performs a rigid body registration with the anatomical images and should be done as well to initialize the B-Spline transform. The B-SPline transform is the deformable transform, where the user can control the amount of deformation based on the number of control points as well as the maximum distance that these points can move. The B-Spline registration places a low dimensional grid in the image, which is deformed. This allows for some susceptibility related distortions to be removed from the diffusion weighted images. In general the amount of motion in the slice selection and read-out directions direction should be kept low. The distortion is in the phase encoding direction in the images. It is recommended that skull stripped (i.e. image containing only brain with skull removed) images shoud be used for image co-registration with the B-Spline transform.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the Nrrd vector image to fit to the anatomical image
+
+
+ inputVolume
+ inputVolume
+ Required: input vector image file name. It is recommended that the input volume is the skull stripped baseline image of the DWI scan.
+
+ input
+
+
+
+ inputAnatomicalVolume
+ inputAnatomicalVolume
+ Required: input anatomical image file name. It is recommended that that the input anatomical image has been skull stripped and has the same orientation as the DWI scan.
+
+ input
+
+
+
+ vectorIndex
+ vectorIndex
+ Vector image index in the moving image (within the DWI) to be used for registration.
+
+ 0
+ input
+
+
+
+ inputRigidTransform
+ inputRigidTransform
+ Required (for B-Spline type co-registration): input rigid transform file name. Used as a starting point for the anatomical B-Spline registration.
+
+ input
+
+
+
+
+
+ Output file from rigid registrations
+
+
+ outputTransformName
+ outputTransformName
+ Required: filename for the fit transform.
+
+ output
+
+
+
+
+
+
+ Input registration parameters controlling the fit
+
+
+ transformType
+ transformType
+ Transform Type: Rigid|Bspline
+
+ Rigid
+ Rigid
+ Bspline
+
+
+
+ numberOfIterations
+ numberOfIterations
+ Number of iterations in the selected 3D fit
+
+ 1000
+ input
+
+
+
+ gridSize
+ gridSize
+ Number of grid subdivisions in all 3 directions
+
+ 12,4,12
+ input
+
+
+
+ borderSize
+ borderSize
+ Size of border
+
+ 3
+ input
+
+
+
+ numberOfHistogramBins
+ numberOfHistogramBins
+ Number of histogram bins
+
+ 50
+ input
+
+
+
+ spatialScale
+ spatialScale
+ Scales the number of voxels in the image by this value to specify the number of voxels used in the registration
+
+ 100
+ input
+
+
+
+ convergence
+ convergence
+ Convergence Factor
+
+ 10000000
+ input
+
+
+
+ gradientTolerance
+ gradientTolerance
+ Gradient Tolerance
+
+ 0.0001
+ input
+
+
+
+ maxBSplineDisplacement
+ maxBSplineDisplacement
+ Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis. A value of 0.0 indicates that the problem should be unbounded. NOTE: This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform. This can lead to a substantial reduction in computation time in the BSpline optimizer.
+
+ 0.0
+
+
+
+ maximumStepSize
+ maximumStepSize
+ Maximum permitted step size to move in the selected 3D fit
+
+ 0.2
+ input
+
+
+
+ minimumStepSize
+ minimumStepSize
+ Minimum required step size to move in the selected 3D fit without converging -- decrease this to make the fit more exacting
+
+ 0.0001
+ input
+
+
+
+ translationScale
+ translationScale
+ How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more translation in the fit
+
+ 1000.0
+ input
+
+
+
+ relaxationFactor
+ relaxationFactor
+ Fraction of gradient from Jacobian to attempt to move in the selected 3D fit
+
+ 0.5
+ input
+
+
+
+ numberOfSamples
+ numberOfSamples
+ The number of voxels sampled for mutual information computation. Increase this for a slower, more careful fit. NOTE that it is suggested to use samplingPercentage instead of this option. However, if set, it overwrites the samplingPercentage option.
+
+ 100000
+ input
+
+
+
+ samplingPercentage
+ samplingPercentage
+
+ This is a number in (0.0,1.0] interval that shows the percentage of the input fixed image voxels that are sampled for mutual information computation. Increase this for a slower, more careful fit. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. The default is to use approximately 5% of voxels (for backwards compatibility 5% ~= 500000/(256*256*256)). Typical values range from 1% for low detail images to 20% for high detail images.
+ 0.05
+
+
+
+ useMomentsAlign
+ useMomentsAlign
+
+ MomentsAlign assumes that the center of mass of the images represent similar structures. Perform a MomentsAlign registration as part of the sequential registration steps. This option MUST come first, and CAN NOT be used with either CenterOfHeadLAlign, GeometryAlign, or initialTransform file. This family of options superceeds the use of transformType if any of them are set.
+ false
+
+
+
+ useGeometryAlign
+ useGeometryAlign
+
+ GeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Perform a GeometryCenterAlign registration as part of the sequential registration steps. This option MUST come first, and CAN NOT be used with either MomentsAlign, CenterOfHeadAlign, or initialTransform file. This family of options superceeds the use of transformType if any of them are set.
+ false
+
+
+
+ useCenterOfHeadAlign
+ useCenterOfHeadAlign
+
+ CenterOfHeadAlign attempts to find a hemisphere full of foreground voxels from the superior direction as an estimate of where the center of a head shape would be to drive a center of mass estimate. Perform a CenterOfHeadAlign registration as part of the sequential registration steps. This option MUST come first, and CAN NOT be used with either MomentsAlign, GeometryAlign, or initialTransform file. This family of options superceeds the use of transformType if any of them are set.
+ false
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractCoRegAnatomyBspline.xml b/tools/xmls/gtractCoRegAnatomyBspline.xml
new file mode 100644
index 0000000..1af21c8
--- /dev/null
+++ b/tools/xmls/gtractCoRegAnatomyBspline.xml
@@ -0,0 +1,153 @@
+
+
+ Diffusion.GTRACT
+ Coregister B0 to Anatomy B-Spline
+
+ This program will register a NRRD diffusion weighted 4D vector image to a fixed anatomical image to produce a Bspline fit.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the NRRD vector image to fit to the anatomical image
+
+
+ inputVolume
+ inputVolume
+ Required: input vector image file name. It is recommended that the input volume is the skull stripped baseline image of the DWI scan.
+
+ input
+
+
+
+ inputAnatomicalVolume
+ inputAnatomicalVolume
+ Required: input anatomical image file name. It is recommended that that the input anatomical image has been skull stripped and has the same orientation as the DWI scan.
+
+ input
+
+
+
+ vectorIndex
+ vectorIndex
+ Vector image index in the moving image (within the DWI) to be used for registration.
+
+ 0
+ input
+
+
+
+ inputRigidTransform
+ inputRigidTransform
+ Required (for B-Spline type co-registration): input rigid transform file name. Used as a starting point for the anatomical B-Spline registration.
+
+ input
+
+
+
+
+
+
+ Output file from rigid registrations
+
+
+ outputBsplineTransform
+ outputBsplineTransform
+ Required: filename for the B-Spline fit transform.
+
+ output
+
+
+
+
+
+
+ Input registration parameters controlling the fit
+
+
+ numberOfIterations
+ numberOfIterations
+ Number of iterations in the selected 3D fit
+
+ 1000
+ input
+
+
+
+ gridSize
+ gridSize
+ Number of grid subdivisions in all 3 directions
+
+ 12,4,12
+ input
+
+
+
+ borderSize
+ borderSize
+ Size of border
+
+ 3
+ input
+
+
+
+ numberOfHistogramBins
+ numberOfHistogramBins
+ Number of histogram bins
+
+ 50
+ input
+
+
+
+ spatialScale
+ spatialScale
+ Scales the number of voxels in the image by this value to specify the number of voxels used in the registration
+
+ 100
+ input
+
+
+
+ convergence
+ convergence
+ Convergence Factor
+
+ 10000000
+ input
+
+
+
+ gradientTolerance
+ gradientTolerance
+ Gradient Tolerance
+
+ 0.0001
+ input
+
+
+
+ maxBSplineDisplacement
+ maxBSplineDisplacement
+ Sets the maximum allowed displacements in image physical coordinates for BSpline control grid along each axis. A value of 0.0 indicates that the problem should be unbounded. NOTE: This only constrains the BSpline portion, and does not limit the displacement from the associated bulk transform. This can lead to a substantial reduction in computation time in the BSpline optimizer.
+
+ 0.0
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractCoRegAnatomyRigid.xml b/tools/xmls/gtractCoRegAnatomyRigid.xml
new file mode 100644
index 0000000..06c0f56
--- /dev/null
+++ b/tools/xmls/gtractCoRegAnatomyRigid.xml
@@ -0,0 +1,145 @@
+
+
+ Diffusion.GTRACT
+ Coregister B0 to Anatomy Rigid
+
+ This program will register a NRRD diffusion weighted 4D vector image to a fixed anatomical image to produce a rigid fit.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the NRRD vector image to fit to the anatomical image
+
+
+ inputVolume
+ inputVolume
+ Required: input vector image file name. It is recommended that the input volume is the skull stripped baseline image of the DWI scan.
+
+ input
+
+
+
+ inputAnatomicalVolume
+ inputAnatomicalVolume
+ Required: input anatomical image file name. It is recommended that that the input anatomical image has been skull stripped and has the same orientation as the DWI scan.
+
+ input
+
+
+
+ vectorIndex
+ vectorIndex
+ Vector image index in the moving image (within the DWI) to be used for registration.
+
+ 0
+ input
+
+
+
+
+
+
+ Output file from rigid registrations
+
+
+ outputRigidTransform
+ outputRigidTransform
+ Required: filename for the rigid fit transform.
+
+ output
+
+
+
+
+
+
+ Input registration parameters controlling the fit
+
+
+ numberOfIterations
+ numberOfIterations
+ Number of iterations in the selected 3D fit
+
+ 1000
+ input
+
+
+
+ numberOfSamples
+ numberOfSamples
+ The number of voxels sampled for mutual information computation. Increase this for a slower, more careful fit. NOTE that it is suggested to use samplingPercentage instead of this option. However, if set, it overwrites the samplingPercentage option.
+
+ 100000
+ input
+
+
+
+ samplingPercentage
+ samplingPercentage
+
+ This is a number in (0.0,1.0] interval that shows the percentage of the input fixed image voxels that are sampled for mutual information computation. Increase this for a slower, more careful fit. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. The default is to use approximately 5% of voxels (for backwards compatibility 5% ~= 500000/(256*256*256)). Typical values range from 1% for low detail images to 20% for high detail images.
+ 0.05
+
+
+
+
+ initialRotationAxis
+ initialRotationAxis
+ Axis for the initial rotation angle: 0, 1, 2 mean x, y, z, respectively.
+
+ 0
+ input
+
+
+
+ initialRotationAngle
+ initialRotationAngle
+ Angle to rotate about the initial rotation angle (Degrees)
+
+ 0.0
+ input
+
+
+
+ relaxationFactor
+ relaxationFactor
+ Fraction of gradient from Jacobian to attempt to move in the selected 3D fit
+
+ 0.5
+ input
+
+
+
+ maximumStepSize
+ maximumStepSize
+ Maximum permitted step size to move in the selected 3D fit
+
+ 0.2
+ input
+
+
+
+ minimumStepSize
+ minimumStepSize
+ Minimum required step size to move in the selected 3D fit without converging -- decrease this to make the fit more exacting
+
+ 0.0001
+ input
+
+
+
+ spatialScale
+ spatialScale
+ How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more translation in the fit
+
+ 1000.0
+ input
+
+
+
+
diff --git a/tools/xmls/gtractConcatDwi.xml b/tools/xmls/gtractConcatDwi.xml
new file mode 100644
index 0000000..c43f65e
--- /dev/null
+++ b/tools/xmls/gtractConcatDwi.xml
@@ -0,0 +1,56 @@
+
+
+ Diffusion.GTRACT
+ Concat DWI Images
+
+ This program will concatenate two DTI runs together.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion weighted imaging studies to run together
+
+
+ inputVolume
+ inputVolume
+ Required: input file containing the first diffusion weighted image
+
+ input
+
+
+ ignoreOrigins
+ ignoreOrigins
+ If image origins are different force all images to origin of first image
+ false
+
+
+
+
+
+ Output file from combining two diffusion weighted images
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the combined diffusion weighted images.
+
+ output
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractCopyImageOrientation.xml b/tools/xmls/gtractCopyImageOrientation.xml
new file mode 100644
index 0000000..7d68413
--- /dev/null
+++ b/tools/xmls/gtractCopyImageOrientation.xml
@@ -0,0 +1,59 @@
+
+
+ Diffusion.GTRACT
+ Copy Image Orientation
+
+ This program will copy the orientation from the reference image into the moving image. Currently, the registration process requires that the diffusion weighted images and the anatomical images have the same image orientation (i.e. Axial, Coronal, Sagittal). It is suggested that you copy the image orientation from the diffusion weighted images and apply this to the anatomical image. This image can be subsequently removed after the registration step is complete. We anticipate that this limitation will be removed in future versions of the registration programs.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the input image and the reference image to clone the orientation of the reference image into the input image.
+
+
+ inputVolume
+ inputVolume
+ Required: input file containing the signed short image to reorient without resampling.
+
+ input
+
+
+
+ inputReferenceVolume
+ inputReferenceVolume
+ Required: input file containing orietation that will be cloned.
+
+ input
+
+
+
+
+
+ Output file from resampling the input specimen image
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD or Nifti file containing the reoriented image in reference image space.
+
+ output
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractCoregBvalues.xml b/tools/xmls/gtractCoregBvalues.xml
new file mode 100644
index 0000000..0dc07d7
--- /dev/null
+++ b/tools/xmls/gtractCoregBvalues.xml
@@ -0,0 +1,171 @@
+
+
+ Diffusion.GTRACT
+ Coregister B-Values
+
+ This step should be performed after converting DWI scans from DICOM to NRRD format. This program will register all gradients in a NRRD diffusion weighted 4D vector image (moving image) to a specified index in a fixed image. It also supports co-registration with a T2 weighted image or field map in the same plane as the DWI data. The fixed image for the registration should be a b0 image. A mutual information metric cost function is used for the registration because of the differences in signal intensity as a result of the diffusion gradients. The full affine allows the registration procedure to correct for eddy current distortions that may exist in the data. If the eddyCurrentCorrection is enabled, relaxationFactor (0.25) and maximumStepSize (0.1) should be adjusted.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion tensor images to fit
+
+
+ movingVolume
+ movingVolume
+ Required: input moving image file name. In order to register gradients within a scan to its first gradient, set the movingVolume and fixedVolume as the same image.
+
+ input
+
+
+
+ fixedVolume
+ fixedVolume
+ Required: input fixed image file name. It is recommended that this image should either contain or be a b0 image.
+
+ input
+
+
+
+ fixedVolumeIndex
+ fixedVolumeIndex
+ Index in the fixed image for registration. It is recommended that this image should be a b0 image.
+
+ 0
+ input
+
+
+
+
+
+
+ Output file from gtractCoregBvalues
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing moving images individually resampled and fit to the specified fixed image index.
+
+ output
+
+
+
+ outputTransform
+ outputTransform
+ Registration 3D transforms concatenated in a single output file. There are no tools that can use this, but can be used for debugging purposes.
+
+ output
+
+
+
+
+
+
+ Input registration parameters controlling the fit
+
+
+ eddyCurrentCorrection
+ eddyCurrentCorrection
+ Flag to perform eddy current corection in addition to motion correction (recommended)
+
+ 0
+ input
+
+
+
+ numberOfIterations
+ numberOfIterations
+ Number of iterations in each 3D fit
+
+ 1000
+ input
+
+
+
+ numberOfSpatialSamples
+ numberOfSpatialSamples
+ The number of voxels sampled for mutual information computation. Increase this for a slower, more careful fit. NOTE that it is suggested to use samplingPercentage instead of this option. However, if set, it overwrites the samplingPercentage option.
+
+ 100000
+ input
+
+
+ samplingPercentage
+ samplingPercentage
+
+ This is a number in (0.0,1.0] interval that shows the percentage of the input fixed image voxels that are sampled for mutual information computation. Increase this for a slower, more careful fit. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. The default is to use approximately 5% of voxels (for backwards compatibility 5% ~= 500000/(256*256*256)). Typical values range from 1% for low detail images to 20% for high detail images.
+ 0.05
+
+
+
+
+ relaxationFactor
+ relaxationFactor
+ Fraction of gradient from Jacobian to attempt to move in each 3D fit step (adjust when eddyCurrentCorrection is enabled; suggested value = 0.25)
+
+ 0.5
+ input
+
+
+
+ maximumStepSize
+ maximumStepSize
+ Maximum permitted step size to move in each 3D fit step (adjust when eddyCurrentCorrection is enabled; suggested value = 0.1)
+
+ 0.2
+ input
+
+
+
+ minimumStepSize
+ minimumStepSize
+ Minimum required step size to move in each 3D fit step without converging -- decrease this to make the fit more exacting
+
+ 0.0001
+ input
+
+
+
+ spatialScale
+ spatialScale
+ How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the fit
+
+ 1000.0
+ input
+
+
+
+ registerB0Only
+ registerB0Only
+ Register the B0 images only
+
+ 0
+ input
+
+
+
+ debugLevel
+
+ Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.
+ --debugLevel
+ 0
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractCostFastMarching.xml b/tools/xmls/gtractCostFastMarching.xml
new file mode 100644
index 0000000..2dbd06b
--- /dev/null
+++ b/tools/xmls/gtractCostFastMarching.xml
@@ -0,0 +1,115 @@
+
+
+ Diffusion.GTRACT
+ Cost Fast Marching
+
+ This program will use a fast marching fiber tracking algorithm to identify fiber tracts from a tensor image. This program is the first portion of the algorithm. The user must first run gtractFastMarchingTracking to generate the actual fiber tracts. This algorithm is roughly based on the work by G. Parker et al. from IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002. An additional feature of including anisotropy into the vcl_cost function calculation is included.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris. The original code here was developed by Daisy Espino.
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required: input tensor image file name
+
+ input
+
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required: input anisotropy image file name
+
+ input
+
+
+
+ inputStartingSeedsLabelMapVolume
+ inputStartingSeedsLabelMapVolume
+ Required: input starting seeds LabelMap image file name
+
+ input
+
+
+
+ startingSeedsLabel
+ startingSeedsLabel
+ Label value for Starting Seeds
+
+ 1
+ input
+
+
+
+
+
+
+ Output files generated by the fast marching vcl_cost function
+
+
+ outputCostVolume
+ outputCostVolume
+ Output vcl_cost image
+
+ output
+
+
+
+ outputSpeedVolume
+ outputSpeedVolume
+ Output speed image
+
+ output
+
+
+
+
+
+
+ Input parameters controlling the Fast Marching Cost Function
+
+
+ anisotropyWeight
+ anisotropyWeight
+ Anisotropy weight used for vcl_cost function calculations
+
+ 0.0
+ input
+
+
+
+ stoppingValue
+ stoppingValue
+ Terminiating value for vcl_cost function estimation
+
+ 800.0
+ input
+
+
+
+ seedThreshold
+ seedThreshold
+ Anisotropy threshold used for seed selection
+
+ 0.3
+ input
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractCreateGuideFiber.xml b/tools/xmls/gtractCreateGuideFiber.xml
new file mode 100644
index 0000000..e76e596
--- /dev/null
+++ b/tools/xmls/gtractCreateGuideFiber.xml
@@ -0,0 +1,69 @@
+
+
+ Diffusion.GTRACT
+ Create Guide Fiber
+
+ This program will create a guide fiber by averaging fibers from a previously generated tract.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for guide fiber generation
+
+
+ inputFiber
+ inputFiber
+ Required: input fiber tract file name
+
+ input
+
+
+
+ numberOfPoints
+ numberOfPoints
+ Number of points in output guide fiber
+
+ 100
+ input
+
+
+
+
+
+
+ Output file from averaging fibers in a fiber tract
+
+
+ outputFiber
+ outputFiber
+ Required: output guide fiber file name
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of XML files when reading and writing vtkPolyData.
+
+ 0
+ input
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractFastMarchingTracking.xml b/tools/xmls/gtractFastMarchingTracking.xml
new file mode 100644
index 0000000..a1d2f17
--- /dev/null
+++ b/tools/xmls/gtractFastMarchingTracking.xml
@@ -0,0 +1,154 @@
+
+
+ Diffusion.GTRACT
+ Fast Marching Tracking
+
+ This program will use a fast marching fiber tracking algorithm to identify fiber tracts from a tensor image. This program is the second portion of the algorithm. The user must first run gtractCostFastMarching to generate the vcl_cost image. The second step of the algorithm implemented here is a gradient descent soplution from the defined ending region back to the seed points specified in gtractCostFastMarching. This algorithm is roughly based on the work by G. Parker et al. from IEEE Transactions On Medical Imaging, 21(5): 505-512, 2002. An additional feature of including anisotropy into the vcl_cost function calculation is included.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris. The original code here was developed by Daisy Espino.
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required: input tensor image file name
+
+ input
+
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required: input anisotropy image file name
+
+ input
+
+
+
+ inputCostVolume
+ inputCostVolume
+ Required: input vcl_cost image file name
+
+ input
+
+
+
+ inputStartingSeedsLabelMapVolume
+ inputStartingSeedsLabelMapVolume
+ Required: input starting seeds LabelMap image file name
+
+ input
+
+
+
+ startingSeedsLabel
+ startingSeedsLabel
+ Label value for Starting Seeds
+
+ 1
+ input
+
+
+
+
+
+
+ Output file in which to store tract lines
+
+
+ outputTract
+ outputTract
+ Required: name of output vtkPolydata file containing tract lines and the point data collected along them.
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of the XML format for vtkPolyData fiber tracts.
+
+ 0
+ output
+
+
+
+
+
+
+ Input parameters controlling the Fast Marching Cost Function
+
+
+ numberOfIterations
+ numberOfIterations
+ Number of iterations used for the optimization
+
+ 200
+ input
+
+
+
+ seedThreshold
+ seedThreshold
+ Anisotropy threshold used for seed selection
+
+ 0.3
+ input
+
+
+
+ trackingThreshold
+ trackingThreshold
+ Anisotropy threshold used for fiber tracking
+
+ 0.2
+ input
+
+
+
+
+ costStepSize
+ costStepSize
+ Cost image sub-voxel sampling
+
+ 1.0
+ input
+
+
+
+ maximumStepSize
+ maximumStepSize
+ Maximum step size to move when tracking
+
+ 1.0
+ input
+
+
+
+ minimumStepSize
+ minimumStepSize
+ Minimum step size to move when tracking
+
+ 0.1
+ input
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractFiberTracking.xml b/tools/xmls/gtractFiberTracking.xml
new file mode 100644
index 0000000..7480b12
--- /dev/null
+++ b/tools/xmls/gtractFiberTracking.xml
@@ -0,0 +1,283 @@
+
+
+ Diffusion.GTRACT
+ Fiber Tracking
+
+ This program implements four fiber tracking methods (Free, Streamline, GraphSearch, Guided). The output of the fiber tracking is vtkPolyData (i.e. Polylines) that can be loaded into Slicer3 for visualization. The poly data can be saved in either old VTK format files (.vtk) or in the new VTK XML format (.xml). The polylines contain point data that defines ther Tensor at each point along the fiber tract. This can then be used to rendered as glyphs in Slicer3 and can be used to define severeal scalar measures without referencing back to the anisotropy images. (1) Free tracking is a basic streamlines algorithm. This is a direct implementation of the method original proposed by Basser et al. The tracking follows the primarty eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either as a result of maximum fiber length, low ansiotropy, or large curvature. This is a great way to explore your data. (2) The streamlines algorithm is a direct implementation of the method originally proposed by Basser et al. The tracking follows the primary eigenvector. The tracking begins with seed points in the starting region. Only those voxels above the specified anisotropy threshold in the starting region are used as seed points. Tracking terminates either by reaching the ending region or reaching some stopping criteria. Stopping criteria are specified using the following parameters: tracking threshold, curvature threshold, and max length. Only paths terminating in the ending region are kept in this method. The TEND algorithm proposed by Lazar et al. (Human Brain Mapping 18:306-321, 2003) has been instrumented. This can be enabled using the --useTend option while performing Streamlines tracking. This utilizes the entire diffusion tensor to deflect the incoming vector instead of simply following the primary eigenvector. The TEND parameters are set using the --tendF and --tendG options. (3) Graph Search tracking is the first step in the full GTRACT algorithm developed by Cheng et al. (NeuroImage 31(3): 1075-1085, 2006) for finding the tracks in a tensor image. This method was developed to generate fibers in a Tensor representation where crossing fibers occur. The graph search algorithm follows the primary eigenvector in non-ambigous regions and utilizes branching and a graph search algorithm in ambigous regions. Ambiguous tracking regions are defined based on two criteria: Branching Al Threshold (anisotropy values below this value and above the traching threshold) and Curvature Major Eigen (angles of the primary eigenvector direction and the current tracking direction). In regions that meet this criteria, two or three tracking paths are considered. The first is the standard primary eigenvector direction. The second is the seconadary eigenvector direction. This is based on the assumption that these regions may be prolate regions. If the Random Walk option is selected then a third direction is also considered. This direction is defined by a cone pointing from the current position to the centroid of the ending region. The interior angle of the cone is specified by the user with the Branch/Guide Angle parameter. A vector contained inside of the cone is selected at random and used as the third direction. This method can also utilize the TEND option where the primary tracking direction is that specified by the TEND method instead of the primary eigenvector. The parameter '--maximumBranchPoints' allows the tracking to have this number of branches being considered at a time. If this number of branch points is exceeded at any time, then the algorithm will revert back to a streamline alogrithm until the number of branches is reduced. This allows the user to constrain the computational complexity of the algorithm. (4) The second phase of the GTRACT algorithm is Guided Tracking. This method incorporates anatomical information about the track orientation using an initial guess of the fiber track. In the originally proposed GTRACT method, this would be created from the fibers resulting from the Graph Search tracking. However, in practice this can be created using any method and could be defined manually. To create the guide fiber the program gtractCreateGuideFiber can be used. This program will load a fiber tract that has been generated and create a centerline representation of the fiber tract (i.e. a single fiber). In this method, the fiber tracking follows the primary eigenvector direction unless it deviates from the guide fiber track by a angle greater than that specified by the '--guidedCurvatureThreshold' parameter. The user must specify the guide fiber when running this program.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta, Greg Harris and Yongqiang Zhao.
+
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required (for Free, Streamline, GraphSearch, and Guided fiber tracking methods): input tensor image file name
+
+ input
+
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required (for Free, Streamline, GraphSearch, and Guided fiber tracking methods): input anisotropy image file name
+
+ input
+
+
+
+ inputStartingSeedsLabelMapVolume
+ inputStartingSeedsLabelMapVolume
+ Required (for Free, Streamline, GraphSearch, and Guided fiber tracking methods): input starting seeds LabelMap image file name
+
+ input
+
+
+
+ startingSeedsLabel
+ startingSeedsLabel
+ Label value for Starting Seeds (required if Label number used to create seed point in Slicer was not 1)
+
+ 1
+ input
+
+
+
+ inputEndingSeedsLabelMapVolume
+ inputEndingSeedsLabelMapVolume
+ Required (for Streamline, GraphSearch, and Guided fiber tracking methods): input ending seeds LabelMap image file name
+
+ input
+
+
+
+ endingSeedsLabel
+ endingSeedsLabel
+ Label value for Ending Seeds (required if Label number used to create seed point in Slicer was not 1)
+
+ 1
+ input
+
+
+
+ inputTract
+ inputTract
+ Required (for Guided fiber tracking method): guide fiber in vtkPolydata file containing one tract line.
+
+ input
+
+
+
+
+
+
+
+ Output file in which to store tract lines
+
+
+ outputTract
+ outputTract
+ Required (for Free, Streamline, GraphSearch, and Guided fiber tracking methods): name of output vtkPolydata file containing tract lines and the point data collected along them.
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of the XML format for vtkPolyData fiber tracts.
+
+ 0
+ output
+
+
+
+
+
+
+ Input parameters controlling the track finding
+
+
+ trackingMethod
+ trackingMethod
+ Fiber tracking Filter Type: Guided|Free|Streamline|GraphSearch
+
+ Guided
+ Guided
+ Free
+ Streamline
+ GraphSearch
+
+
+
+ guidedCurvatureThreshold
+ guidedCurvatureThreshold
+ Guided Curvature Threshold (Degrees)
+
+ 30.0
+ input
+
+
+
+ maximumGuideDistance
+ maximumGuideDistance
+ Maximum distance for using the guide fiber direction
+
+ 12.0
+ input
+
+
+
+ seedThreshold
+ seedThreshold
+ Anisotropy threshold for seed selection (recommended for Free fiber tracking)
+
+ 0.40
+ input
+
+
+
+ trackingThreshold
+ trackingThreshold
+ Anisotropy threshold for fiber tracking (anisotropy values of the next point along the path)
+
+ 0.20
+ input
+
+
+
+ curvatureThreshold
+ curvatureThreshold
+ Curvature threshold in degrees (recommended for Free fiber tracking)
+
+ 45.0
+ input
+
+
+
+ branchingThreshold
+ branchingThreshold
+ Anisotropy Branching threshold (recommended for GraphSearch fiber tracking method)
+
+ 0.20
+ input
+
+
+
+ maximumBranchPoints
+ maximumBranchPoints
+ Maximum branch points (recommended for GraphSearch fiber tracking method)
+
+ 5
+ input
+
+
+
+ useRandomWalk
+ useRandomWalk
+ Flag to use random walk.
+
+ 0
+ input
+
+
+
+ randomSeed
+ randomSeed
+ Random number generator seed
+
+ 13579
+ input
+
+
+
+ branchingAngle
+ branchingAngle
+ Branching angle in degrees (recommended for GraphSearch fiber tracking method)
+
+ 45.0
+ input
+
+
+
+ minimumLength
+ minimumLength
+ Minimum fiber length. Helpful for filtering invalid tracts.
+
+ 0.0
+ input
+
+
+
+ maximumLength
+ maximumLength
+ Maximum fiber length (voxels)
+
+ 125.0
+ input
+
+
+
+ stepSize
+ stepSize
+ Fiber tracking step size
+
+ 1.0
+ input
+
+
+
+ useLoopDetection
+ useLoopDetection
+ Flag to make use of loop detection.
+
+ 0
+ input
+
+
+
+ useTend
+ useTend
+ Flag to make use of Tend F and Tend G parameters.
+
+ 0
+ input
+
+
+
+ tendF
+ tendF
+ Tend F parameter
+
+ 0.5
+ input
+
+
+
+ tendG
+ tendG
+ Tend G parameter
+
+ 0.5
+ input
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractFreeTracking.xml b/tools/xmls/gtractFreeTracking.xml
new file mode 100644
index 0000000..4de0bd4
--- /dev/null
+++ b/tools/xmls/gtractFreeTracking.xml
@@ -0,0 +1,171 @@
+
+
+ Diffusion.GTRACT
+ Free Tracking
+
+ This program will use streamlines fiber tracking to identify fiber tracts in a tensor image. A seed region is specify for initializing the algorithm. All fibers are kept and are terminated based on the stopping criteria including anisotropy, curvature and length.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required: input tensor image file name
+
+ input
+
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required: input anisotropy image file name
+
+ input
+
+
+
+ inputStartingSeedsLabelMapVolume
+ inputStartingSeedsLabelMapVolume
+ Required: input starting seeds LabelMap image file name
+
+ input
+
+
+
+ startingSeedsLabel
+ startingSeedsLabel
+ Label value for Starting Seeds
+
+ 1
+ input
+
+
+
+
+
+
+ Output file in which to store tract lines
+
+
+ outputTract
+ outputTract
+ Required: name of output vtkPolydata file containing tract lines and the point data collected along them.
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of the XML format for vtkPolyData fiber tracts.
+
+ 0
+ output
+
+
+
+
+
+
+ Input parameters controlling the track finding
+
+
+ seedThreshold
+ seedThreshold
+ Anisotropy threshold for seed selection
+
+ 0.40
+ input
+
+
+
+ trackingThreshold
+ trackingThreshold
+ Anisotropy threshold for fiber tracking
+
+ 0.20
+ input
+
+
+
+ curvatureThreshold
+ curvatureThreshold
+ Curvature threshold (Degrees)
+
+ 45.0
+ input
+
+
+
+ minimumLength
+ minimumLength
+ Minimum fiber length. Helpful for filtering invalid tracts.
+
+ 0.0
+ input
+
+
+
+ maximumLength
+ maximumLength
+ Maximum fiber length
+
+ 125.0
+ input
+
+
+
+ stepSize
+ stepSize
+ Fiber tracking step size
+
+ 1.0
+ input
+
+
+
+ useLoopDetection
+ useLoopDetection
+ Flag to make use of loop detection.
+
+ 0
+ input
+
+
+
+ useTend
+ useTend
+ Flag to make use of Tend F and Tend G parameters.
+
+ 0
+ input
+
+
+
+ tendF
+ tendF
+ Tend F parameter
+
+ 0.5
+ input
+
+
+
+ tendG
+ tendG
+ Tend G parameter
+
+ 0.5
+ input
+
+
+
+
diff --git a/tools/xmls/gtractGraphSearchTracking.xml b/tools/xmls/gtractGraphSearchTracking.xml
new file mode 100644
index 0000000..97200e6
--- /dev/null
+++ b/tools/xmls/gtractGraphSearchTracking.xml
@@ -0,0 +1,233 @@
+
+
+ Diffusion.GTRACT
+ Graph Search Tracking
+
+ This program implements the Graph Serach Tracking method proposed by Cheng et al. in NeuroImage Volume 31, Issue 3, 1 July 2006, Pages 1075-1085 for finding the tracks in a tensor image. This method to generate fibers in a Tensor representation where crossing fibers occur. This is defined by low anisotropy and high curvature. Both of these values are controlled by the user. In these regions, three directions for tracking are considered. This includes the primary eigenvector, secondary eigenvector, and a vector with random pertubations added pointing towards the ending region.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required: input tensor image file name
+
+ input
+
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required: input anisotropy image file name
+
+ input
+
+
+
+ inputStartingSeedsLabelMapVolume
+ inputStartingSeedsLabelMapVolume
+ Required: input starting seeds LabelMap image file name
+
+ input
+
+
+
+ startingSeedsLabel
+ startingSeedsLabel
+ Label value for Starting Seeds
+
+ 1
+ input
+
+
+
+ inputEndingSeedsLabelMapVolume
+ inputEndingSeedsLabelMapVolume
+ Required: input ending seeds LabelMap image file name
+
+ input
+
+
+
+ endingSeedsLabel
+ endingSeedsLabel
+ Label value for Ending Seeds
+
+ 1
+ input
+
+
+
+
+
+
+ Output file in which to store tract lines
+
+
+ outputTract
+ outputTract
+ Required: name of output vtkPolydata file containing tract lines and the point data collected along them.
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of the XML format for vtkPolyData fiber tracts.
+
+ 0
+ output
+
+
+
+
+
+
+ Input parameters controlling the track finding
+
+
+ seedThreshold
+ seedThreshold
+ Anisotropy threshold for seed selection
+
+ 0.40
+ input
+
+
+
+ trackingThreshold
+ trackingThreshold
+ Anisotropy threshold for fiber tracking
+
+ 0.20
+ input
+
+
+
+ curvatureThreshold
+ curvatureThreshold
+ Curvature threshold (Degrees)
+
+ 45.0
+ input
+
+
+
+ branchingThreshold
+ branchingThreshold
+ Anisotropy Branching threshold
+
+ 0.20
+ input
+
+
+
+ maximumBranchPoints
+ maximumBranchPoints
+ Maximum branch points
+
+ 5
+ input
+
+
+
+ useRandomWalk
+ useRandomWalk
+ Flag to use random walk.
+
+ 0
+ input
+
+
+
+ randomSeed
+ randomSeed
+ Random number generator seed
+
+ 13579
+ input
+
+
+
+ branchingAngle
+ branchingAngle
+ Branchging angle (Degrees)
+
+ 45.0
+ input
+
+
+
+ minimumLength
+ minimumLength
+ Minimum fiber length. Helpful for filtering invalid tracts.
+
+ 0.0
+ input
+
+
+
+ maximumLength
+ maximumLength
+ Maximum fiber length
+
+ 125.0
+ input
+
+
+
+ stepSize
+ stepSize
+ Fiber tracking step size
+
+ 1.0
+ input
+
+
+
+ useLoopDetection
+ useLoopDetection
+ Flag to make use of loop detection.
+
+ 0
+ input
+
+
+
+ useTend
+ useTend
+ Flag to make use of Tend F and Tend G parameters.
+
+ 0
+ input
+
+
+
+ tendF
+ tendF
+ Tend F parameter
+
+ 0.5
+ input
+
+
+
+ tendG
+ tendG
+ Tend G parameter
+
+ 0.5
+ input
+
+
+
+
diff --git a/tools/xmls/gtractGuidedTracking.xml b/tools/xmls/gtractGuidedTracking.xml
new file mode 100644
index 0000000..b8ef744
--- /dev/null
+++ b/tools/xmls/gtractGuidedTracking.xml
@@ -0,0 +1,214 @@
+
+
+ Diffusion.GTRACT
+ Guided Tracking
+
+ This program will use the Guided Tracking method proposed by Cheng et al. in NeuroImage Volume 31, Issue 3, 1 July 2006, Pages 1075-1085 for finding the tracks in a tensor image. The method will use a guide fiber as apriori information for the fiber tract position and orientation. If the current eigenvector direction is significantly different from the guide fiber direction at that point, then the guide fiber is used instead of the eigenvector direction. The distance for which the guide fiber has an effect is defined by the user.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required: input tensor image file name
+
+ input
+
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required: input anisotropy image file name
+
+ input
+
+
+
+ inputStartingSeedsLabelMapVolume
+ inputStartingSeedsLabelMapVolume
+ Required: input starting seeds LabelMap image file name
+
+ input
+
+
+
+ startingSeedsLabel
+ startingSeedsLabel
+ Label value for Starting Seeds
+
+ 1
+ input
+
+
+
+ inputEndingSeedsLabelMapVolume
+ inputEndingSeedsLabelMapVolume
+ Required: input ending seeds LabelMap image file name
+
+ input
+
+
+
+ endingSeedsLabel
+ endingSeedsLabel
+ Label value for Ending Seeds
+
+ 1
+ input
+
+
+
+ inputTract
+ inputTract
+ Required: guide fiber in vtkPolydata file containing one tract line.
+
+ input
+
+
+
+
+
+
+ Output file in which to store tract lines
+
+
+ outputTract
+ outputTract
+ Required: name of output vtkPolydata file containing tract lines and the point data collected along them.
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of the XML format for vtkPolyData fiber tracts.
+
+ 0
+ output
+
+
+
+
+
+
+ Input parameters controlling fiber tracking
+
+
+ seedThreshold
+ seedThreshold
+ Anisotropy threshold for seed selection
+
+ 0.40
+ input
+
+
+
+ trackingThreshold
+ trackingThreshold
+ Anisotropy threshold for fiber tracking
+
+ 0.20
+ input
+
+
+
+ maximumGuideDistance
+ maximumGuideDistance
+ Maximum distance for using the guide fiber direction
+
+ 12.0
+ input
+
+
+
+ curvatureThreshold
+ curvatureThreshold
+ Curvature threshold (Degrees)
+
+ 45.0
+ input
+
+
+
+ guidedCurvatureThreshold
+ guidedCurvatureThreshold
+ Guided Curvature Threshold (Degrees)
+
+ 30.0
+ input
+
+
+
+ minimumLength
+ minimumLength
+ Minimum fiber length. Helpful for filtering invalid tracts.
+
+ 0.0
+ input
+
+
+
+ maximumLength
+ maximumLength
+ Maximum fiber length
+
+ 125.0
+ input
+
+
+
+ stepSize
+ stepSize
+ Fiber tracking step size
+
+ 1.0
+ input
+
+
+
+ useLoopDetection
+ useLoopDetection
+ Flag to make use of loop detection.
+
+ 0
+ input
+
+
+
+ useTend
+ useTend
+ Flag to make use of Tend F and Tend G parameters.
+
+ 0
+ input
+
+
+
+ tendF
+ tendF
+ Tend F parameter
+
+ 0.5
+ input
+
+
+
+ tendG
+ tendG
+ Tend G parameter
+
+ 0.5
+ input
+
+
+
+
diff --git a/tools/xmls/gtractImageConformity.xml b/tools/xmls/gtractImageConformity.xml
new file mode 100644
index 0000000..4ed5c10
--- /dev/null
+++ b/tools/xmls/gtractImageConformity.xml
@@ -0,0 +1,62 @@
+
+
+ Diffusion.GTRACT
+ Image Conformity
+
+ This program will straighten out the Direction and Origin to match the Reference Image.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the code image, and the reference image to clone the position and orientation of.
+
+
+ inputVolume
+ inputVolume
+ Required: input file containing the signed short image to reorient without resampling.
+
+ input
+
+
+
+ inputReferenceVolume
+ inputReferenceVolume
+ Required: input file containing the standard image to clone the characteristics of.
+
+ input
+
+
+
+
+
+ Output file from resampling the input specimen image
+
+
+ outputVolume
+ outputVolume
+ Required: name of output Nrrd or Nifti file containing the reoriented image in reference image space.
+
+ output
+
+
+
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractInvertBSplineTransform.xml b/tools/xmls/gtractInvertBSplineTransform.xml
new file mode 100644
index 0000000..7e411e7
--- /dev/null
+++ b/tools/xmls/gtractInvertBSplineTransform.xml
@@ -0,0 +1,74 @@
+
+
+ Diffusion.GTRACT
+ B-Spline Transform Inversion
+
+ This program will invert a B-Spline transform using a thin-plate spline approximation.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+ Parameters for specifying the B-Spline transform and the space to invert it in.
+
+
+ inputReferenceVolume
+ inputReferenceVolume
+ Required: input image file name to exemplify the anatomical space to interpolate over.
+
+ input
+
+
+
+ inputTransform
+ inputTransform
+ Required: input B-Spline transform file name
+
+ input
+
+
+
+
+
+
+ Output file from conversion from Dicom to Nrrd
+
+
+ outputTransform
+ outputTransform
+ Required: output transform file name
+
+ output
+
+
+
+
+
+
+ Input parameters controlling the approximation of a B-Spline inverse by a thin-plate spline.
+
+
+ landmarkDensity
+ landmarkDensity
+ Number of landmark subdivisions in all 3 directions
+
+ 8,8,8
+ input
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractInvertDisplacementField.xml b/tools/xmls/gtractInvertDisplacementField.xml
new file mode 100644
index 0000000..268df0d
--- /dev/null
+++ b/tools/xmls/gtractInvertDisplacementField.xml
@@ -0,0 +1,64 @@
+
+
+ Diffusion.GTRACT
+ Invert Displacement Field
+
+ This program will invert a deformatrion field. The size of the deformation field is defined by an example image provided by the user
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta.
+
+
+
+
+ Parameters for generating the inverse deformation field
+
+
+ baseImage
+ baseImage
+ Required: base image used to define the size of the inverse field
+
+ input
+
+
+
+ deformationImage
+ deformationImage
+ Required: Displacement field image
+
+ input
+
+
+
+ outputVolume
+ outputVolume
+ Required: Output deformation field
+
+ output
+
+
+
+ subsamplingFactor
+ subsamplingFactor
+ Subsampling factor for the deformation field
+
+ 16
+ input
+
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractInvertRigidTransform.xml b/tools/xmls/gtractInvertRigidTransform.xml
new file mode 100644
index 0000000..e179815
--- /dev/null
+++ b/tools/xmls/gtractInvertRigidTransform.xml
@@ -0,0 +1,51 @@
+
+
+ Diffusion.GTRACT
+ Rigid Transform Inversion
+
+ This program will invert a Rigid transform.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the rigid transform
+
+
+ inputTransform
+ inputTransform
+ Required: input rigid transform file name
+
+ input
+
+
+
+
+
+
+ Output file for inverse transform
+
+
+ outputTransform
+ outputTransform
+ Required: output transform file name
+
+ output
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractResampleAnisotropy.xml b/tools/xmls/gtractResampleAnisotropy.xml
new file mode 100644
index 0000000..5d98952
--- /dev/null
+++ b/tools/xmls/gtractResampleAnisotropy.xml
@@ -0,0 +1,77 @@
+
+
+ Diffusion.GTRACT
+ Resample Anisotropy
+
+ This program will resample a floating point image using either the Rigid or B-Spline transform. You may want to save the aligned B0 image after each of the anisotropy map co-registration steps with the anatomical image to check the registration quality with another tool.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the anisotropy image, the transform filename, the transform type, and the anatomical image (whose characteristics will be cloned).
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required: input file containing the anisotropy image
+
+ input
+
+
+
+ inputAnatomicalVolume
+ inputAnatomicalVolume
+ Required: input file containing the anatomical image whose characteristics will be cloned.
+
+ input
+
+
+
+ inputTransform
+ inputTransform
+ Required: input Rigid OR Bspline transform file name
+
+ input
+
+
+
+ transformType
+ transformType
+ Transform type: Rigid, B-Spline
+
+ Rigid
+ Rigid
+ B-Spline
+ input
+
+
+
+
+
+ Output file from resampling the input 3D float image
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the resampled transformed anisotropy image.
+
+ output
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
+
diff --git a/tools/xmls/gtractResampleB0.xml b/tools/xmls/gtractResampleB0.xml
new file mode 100644
index 0000000..4a5b715
--- /dev/null
+++ b/tools/xmls/gtractResampleB0.xml
@@ -0,0 +1,86 @@
+
+
+ Diffusion.GTRACT
+ Resample B0
+
+ This program will resample a signed short image using either a Rigid or B-Spline transform. The user must specify a template image that will be used to define the origin, orientation, spacing, and size of the resampled image.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the resampled image
+
+
+ inputVolume
+ inputVolume
+ Required: input file containing the 4D image
+
+ input
+
+
+
+ inputAnatomicalVolume
+ inputAnatomicalVolume
+ Required: input file containing the anatomical image defining the origin, spacing and size of the resampled image (template)
+
+ input
+
+
+
+ inputTransform
+ inputTransform
+ Required: input Rigid OR Bspline transform file name
+
+ input
+
+
+
+ vectorIndex
+ vectorIndex
+ Index in the diffusion weighted image set for the B0 image
+
+ 0
+ input
+
+
+
+ transformType
+ transformType
+ Transform type: Rigid, B-Spline
+
+ Rigid
+ B-Spline
+ Rigid
+ input
+
+
+
+
+
+ Output file from resampling the input 4D input image
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the resampled input image.
+
+ output
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractResampleCodeImage.xml b/tools/xmls/gtractResampleCodeImage.xml
new file mode 100644
index 0000000..2da601b
--- /dev/null
+++ b/tools/xmls/gtractResampleCodeImage.xml
@@ -0,0 +1,78 @@
+
+
+ Diffusion.GTRACT
+ Resample Code Image
+
+ This program will resample a short integer code image using either the Rigid or Inverse-B-Spline transform. The reference image is the DTI tensor anisotropy image space, and the input code image is in anatomical space.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+ Parameters for specifying the code image, the transform filename, the transform type, and the standard image (whose characteristics will be cloned).
+
+
+ inputCodeVolume
+ inputCodeVolume
+ Required: input file containing the code image
+
+ input
+
+
+
+ inputReferenceVolume
+ inputReferenceVolume
+ Required: input file containing the standard image to clone the characteristics of.
+
+ input
+
+
+
+ inputTransform
+ inputTransform
+ Required: input Rigid or Inverse-B-Spline transform file name
+
+ input
+
+
+
+ transformType
+ transformType
+ Transform type: Rigid or Inverse-B-Spline
+
+ Inverse-B-Spline
+ Rigid
+ Affine
+ B-Spline
+ Inverse-B-Spline
+ None
+
+
+
+
+
+ Output file from resampling the input code image
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the resampled code image in acquisition space.
+
+ output
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
+
diff --git a/tools/xmls/gtractResampleDWIInPlace.xml b/tools/xmls/gtractResampleDWIInPlace.xml
new file mode 100644
index 0000000..f486737
--- /dev/null
+++ b/tools/xmls/gtractResampleDWIInPlace.xml
@@ -0,0 +1,112 @@
+
+
+ Diffusion.GTRACT
+ Resample DWI In Place
+
+ Resamples DWI image to structural image.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta, Greg Harris, Hans Johnson, and Joy Matsui.
+
+
+
+
+
+
+
+ inputVolume
+ inputVolume
+ Required: input image is a 4D NRRD image.
+
+ input
+
+
+ referenceVolume
+ referenceVolume
+ If provided, resample to the final space of the referenceVolume 3D data set.
+
+ input
+
+
+
+ outputResampledB0
+ outputResampledB0
+ Convenience function for extracting the first index location (assumed to be the B0)
+
+ output
+
+
+
+
+ inputTransform
+ inputTransform
+ Required: transform file derived from rigid registration of b0 image to reference structural image.
+
+ input
+
+
+
+ warpDWITransform
+ warpDWITransform
+ Optional: transform file to warp gradient volumes.
+
+ input
+
+
+
+ debugLevel
+
+ Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.
+ --debugLevel
+ 0
+
+
+
+ writeOutputMetaData
+ writeOutputMetaData
+
+ A file to write the output image diffusion gradient directions in a CSV file
+ output
+
+
+
+
+
+
+
+
+ imageOutputSize
+ imageOutputSize
+
+ The voxel lattice for the output image, padding is added if necessary. NOTE: if 0,0,0, then the inputVolume size is used.
+ 0,0,0
+
+
+
+
+
+
+
+
+
+ outputVolume
+ outputVolume
+ Required: output image (NRRD file) that has been rigidly transformed into the space of the structural image and padded if image padding was changed from 0,0,0 default.
+
+ output
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractResampleFibers.xml b/tools/xmls/gtractResampleFibers.xml
new file mode 100644
index 0000000..5f3fb51
--- /dev/null
+++ b/tools/xmls/gtractResampleFibers.xml
@@ -0,0 +1,77 @@
+
+
+ Diffusion.GTRACT
+ Resample Fibers
+
+ This program will resample a fiber tract with respect to a pair of deformation fields that represent the forward and reverse deformation fields.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputForwardDeformationFieldVolume
+ inputForwardDeformationFieldVolume
+ Required: input forward deformation field image file name
+
+ input
+
+
+
+ inputReverseDeformationFieldVolume
+ inputReverseDeformationFieldVolume
+ Required: input reverse deformation field image file name
+
+ input
+
+
+
+ inputTract
+ inputTract
+ Required: name of input vtkPolydata file containing tract lines.
+
+ input
+
+
+
+
+
+
+ Output file in which to store tract lines
+
+
+ outputTract
+ outputTract
+ Required: name of output vtkPolydata file containing tract lines and the point data collected along them.
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of the XML format for vtkPolyData fiber tracts.
+
+ 0
+ output
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractStreamlineTracking.xml b/tools/xmls/gtractStreamlineTracking.xml
new file mode 100644
index 0000000..0a4d9c0
--- /dev/null
+++ b/tools/xmls/gtractStreamlineTracking.xml
@@ -0,0 +1,189 @@
+
+
+ Diffusion.GTRACT
+ Streamline Tracking
+
+ This program create fiber tracts in a tensor image using a basic streamlines algorithm. The algorithm requires a starting and ending region to be be defined for the fiber tracts. Only those that reach the ending region without terminating are kept. Criteria for termination include length, anisotropy, and curvature. These can be controlled by user. In addition, the TEND method as proposed by Lazar et al Human Brain Mapping 18:306-321(2003) has been instrumented.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+
+ Parameters for specifying the diffusion tensor image set
+
+
+ inputTensorVolume
+ inputTensorVolume
+ Required: input tensor image file name
+
+ input
+
+
+
+ inputAnisotropyVolume
+ inputAnisotropyVolume
+ Required: input anisotropy image file name
+
+ input
+
+
+
+ inputStartingSeedsLabelMapVolume
+ inputStartingSeedsLabelMapVolume
+ Required: input starting seeds LabelMap image file name
+
+ input
+
+
+
+ startingSeedsLabel
+ startingSeedsLabel
+ Label value for Starting Seeds
+
+ 1
+ input
+
+
+
+ inputEndingSeedsLabelMapVolume
+ inputEndingSeedsLabelMapVolume
+ Required: input ending seeds LabelMap image file name
+
+ input
+
+
+
+ endingSeedsLabel
+ endingSeedsLabel
+ Label value for Ending Seeds
+
+ 1
+ input
+
+
+
+
+
+
+ Output file in which to store tract lines
+
+
+ outputTract
+ outputTract
+ Required: name of output vtkPolydata file containing tract lines and the point data collected along them.
+
+ output
+
+
+
+ writeXMLPolyDataFile
+ writeXMLPolyDataFile
+ Flag to make use of the XML format for vtkPolyData fiber tracts.
+
+ 0
+ output
+
+
+
+
+
+
+ Input parameters controlling the track finding
+
+
+ seedThreshold
+ seedThreshold
+ Anisotropy threshold for seed selection
+
+ 0.40
+ input
+
+
+
+ trackingThreshold
+ trackingThreshold
+ Anisotropy threshold for fiber tracking
+
+ 0.20
+ input
+
+
+
+ curvatureThreshold
+ curvatureThreshold
+ Curvature threshold (Degrees)
+
+ 45.0
+ input
+
+
+
+ minimumLength
+ minimumLength
+ Minimum fiber length. Helpful for filtering invalid tracts.
+
+ 0.0
+ input
+
+
+
+
+ maximumLength
+ maximumLength
+ Maximum fiber length
+
+ 125.0
+ input
+
+
+
+ stepSize
+ stepSize
+ Fiber tracking step size
+
+ 1.0
+ input
+
+
+
+ useLoopDetection
+ useLoopDetection
+ Flag to make use of loop detection.
+
+ 0
+ input
+
+
+
+ useTend
+ useTend
+ Flag to make use of Tend F and Tend G parameters.
+
+ 0
+ input
+
+
+
+ tendF
+ tendF
+ Tend F parameter
+
+ 0.5
+ input
+
+
+
+ tendG
+ tendG
+ Tend G parameter
+
+ 0.5
+ input
+
+
+
+
diff --git a/tools/xmls/gtractTensor.xml b/tools/xmls/gtractTensor.xml
new file mode 100644
index 0000000..9e48799
--- /dev/null
+++ b/tools/xmls/gtractTensor.xml
@@ -0,0 +1,134 @@
+
+
+ Diffusion.GTRACT
+ Tensor Estimation
+
+ This step will convert a b-value averaged diffusion tensor image to a 3x3 tensor voxel image. This step takes the diffusion tensor image data and generates a tensor representation of the data based on the signal intensity decay, b values applied, and the diffusion difrections. The apparent diffusion coefficient for a given orientation is computed on a pixel-by-pixel basis by fitting the image data (voxel intensities) to the Stejskal-Tanner equation. If at least 6 diffusion directions are used, then the diffusion tensor can be computed. This program uses itk::DiffusionTensor3DReconstructionImageFilter. The user can adjust background threshold, median filter, and isotropic resampling.
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta and Greg Harris.
+
+
+
+ Parameters for specifying the averaged Bvalue diffusion tensor image set
+
+
+ inputVolume
+ inputVolume
+ Required: input image 4D NRRD image. Must contain data based on at least 6 distinct diffusion directions. The inputVolume is allowed to have multiple b0 and gradient direction images. Averaging of the b0 image is done internally in this step. Prior averaging of the DWIs is not required.
+
+ input
+
+
+
+
+
+
+ Output file from conversion from Dicom to NRRD
+
+
+ outputVolume
+ outputVolume
+ Required: name of output NRRD file containing the Tensor vector image
+
+ output
+
+
+
+
+
+
+ Input parameters controlling the mapping from averaged B values to 3 by 3 tensors
+
+
+ medianFilterSize
+ medianFilterSize
+ Median filter radius in all 3 directions
+
+ 0,0,0
+ input
+
+
+ maskProcessingMode
+ maskProcessingMode
+ ROIAUTO: mask is implicitly defined using a otsu forground and hole filling algorithm. ROI: Uses the masks to define what parts of the image should be used for computing the transform. NOMASK: no mask used
+ NOMASK
+ ROIAUTO
+ ROI
+ NOMASK
+
+
+
+ maskVolume
+ maskVolume
+ Mask Image, if maskProcessingMode is ROI
+
+ input
+
+
+ backgroundSuppressingThreshold
+ backgroundSuppressingThreshold
+ Image threshold to suppress background. This sets a threshold used on the b0 image to remove background voxels from processing. Typically, values of 100 and 500 work well for Siemens and GE DTI data, respectively. Check your data particularly in the globus pallidus to make sure the brain tissue is not being eliminated with this threshold.
+
+ 100
+ input
+
+
+
+ resampleIsotropic
+ resampleIsotropic
+ Flag to resample to isotropic voxels. Enabling this feature is recommended if fiber tracking will be performed.
+
+ 0
+ input
+
+
+
+ voxelSize
+ size
+ Isotropic voxel size to resample to
+
+ 2.0
+ input
+
+
+
+ b0Index
+ b0Index
+ Index in input vector index to extract
+
+ 0
+ input
+
+
+
+ applyMeasurementFrame
+ applyMeasurementFrame
+ Flag to apply the measurement frame to the gradient directions
+
+ 0
+ input
+
+
+
+ ignoreIndex
+ ignoreIndex
+ Ignore diffusion gradient index. Used to remove specific gradient directions with artifacts.
+
+ input
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/gtractTransformToDisplacementField.xml b/tools/xmls/gtractTransformToDisplacementField.xml
new file mode 100644
index 0000000..babf858
--- /dev/null
+++ b/tools/xmls/gtractTransformToDisplacementField.xml
@@ -0,0 +1,65 @@
+
+
+ Diffusion.GTRACT
+ Create Displacement Field
+
+ This program will compute forward deformation from the given Transform. The size of the DF is equal to MNI space
+ Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1
+ 5.2.0
+ http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT
+ http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt
+ This tool was developed by Vincent Magnotta, Madhura Ingalhalikar, and Greg Harris
+
+
+
+
+
+ Input Image File
+
+
+ inputTransform
+ inputTransform
+ Input Transform File Name
+
+ input
+
+
+
+
+ inputReferenceVolume
+ inputReferenceVolume
+ Required: input image file name to exemplify the anatomical space over which to vcl_express the transform as a displacement field.
+
+ input
+
+
+
+
+
+
+
+ Output file
+
+
+
+ outputDeformationFieldVolume
+ outputDeformationFieldVolume
+ Output deformation field
+
+ output
+
+
+
+
+
+
+
+
+ numberOfThreads
+ numberOfThreads
+
+ Explicitly specify the maximum number of threads to use.
+ -1
+
+
+
diff --git a/tools/xmls/insertMidACPCpoint.xml b/tools/xmls/insertMidACPCpoint.xml
new file mode 100644
index 0000000..dc53348
--- /dev/null
+++ b/tools/xmls/insertMidACPCpoint.xml
@@ -0,0 +1,37 @@
+
+
+ Utilities.BRAINS
+ MidACPC Landmark Insertion
+
+ This program gets a landmark fcsv file and adds a new landmark as the midpoint between AC and PC points to the output landmark fcsv file
+
+ 5.2.0
+
+
+ Ali Ghayoor
+
+
+
+
+
+ Input/output parameters
+
+
+ inputLandmarkFile
+ --inputLandmarkFile
+
+ input
+ Input landmark file (.fcsv)
+
+
+
+ outputLandmarkFile
+ --outputLandmarkFile
+
+ output
+ Output landmark file (.fcsv)
+
+
+
+
+
diff --git a/tools/xmls/landmarksConstellationAligner.xml b/tools/xmls/landmarksConstellationAligner.xml
new file mode 100644
index 0000000..9be0e52
--- /dev/null
+++ b/tools/xmls/landmarksConstellationAligner.xml
@@ -0,0 +1,37 @@
+
+
+ Utilities.BRAINS
+ MidACPC Landmark Insertion
+
+ This program converts the original landmark files to the acpc-aligned landmark files
+
+ 5.2.0
+
+
+ Ali Ghayoor
+
+
+
+
+
+ Input/output parameters
+
+
+ inputLandmarksPaired
+ --inputLandmarksPaired
+
+ input
+ Input landmark file (.fcsv)
+
+
+
+ outputLandmarksPaired
+ --outputLandmarksPaired
+
+ output
+ Output landmark file (.fcsv)
+
+
+
+
+
diff --git a/tools/xmls/landmarksConstellationWeights.xml b/tools/xmls/landmarksConstellationWeights.xml
new file mode 100644
index 0000000..ac04f02
--- /dev/null
+++ b/tools/xmls/landmarksConstellationWeights.xml
@@ -0,0 +1,45 @@
+
+
+ Utilities.BRAINS
+ Generate Landmarks Weights (BRAINS)
+ Train up a list of Weights for the Landmarks in BRAINSConstellationDetector
+
+
+ inputTrainingList
+ i
+ inputTrainingList
+
+
+ Setup file, giving all parameters for training up a Weight list for landmark.
+
+ input
+
+
+ inputTemplateModel
+
+
+ inputTemplateModel
+ User-specified template model.
+
+ input
+
+
+ llsModel
+
+
+ LLSModel
+ Linear least squares model filename in HD5 format
+ input
+
+
+ outputWeightsList
+ w
+ outputWeightsList
+ default.wts
+
+ The filename of a csv file which is a list of landmarks and their corresponding weights.
+
+ output
+
+
+
diff --git a/tools/xmls/simpleEM.xml b/tools/xmls/simpleEM.xml
new file mode 100644
index 0000000..7c7e98c
--- /dev/null
+++ b/tools/xmls/simpleEM.xml
@@ -0,0 +1,143 @@
+
+
+ Segmentation.Specialized
+ simpleEM (BRAINS)
+ Atlas-based tissue segmentation method
+
+
+
+
+
+ t1Volume
+ t1Volume
+ T1 Volume
+
+
+ input
+
+
+ t2Volume
+ t2Volume
+ T2 Volume
+
+
+ input
+
+
+ pdVolume
+ pdVolume
+ PD Volume
+
+
+ input
+
+
+
+
+
+ templateVolume
+ templateVolume
+ template Volume
+
+
+ input
+
+
+ priorsList
+ priorsList
+ number of input should same to the number of priorsList
+
+
+
+ priorsWeightList
+ priorsWeightList
+ number of input should same to the number of priorsList
+
+
+
+ likelihoodTolerance
+ likelihoodTolerance
+ a convergence parameter (0 indicates take the default from the EMSegmentationFilter constructor.)
+ 0.0
+
+
+
+
+
+ warp
+ warp
+
+ false
+ input
+
+
+ degreeOfBiasFieldCorrection
+ degreeOfBiasFieldCorrection
+
+ 4
+ input
+
+
+ maxIteration
+ maxIteration
+
+ 100
+ input
+
+
+
+
+
+ OutputFileNamePrefix
+
+ BRAINSABC
+ input
+
+
+ inputPixelType
+ inputPixelType
+
+ Input Type
+ uchar
+ usigned char
+ short
+ unsigned short
+ int
+ unsigned int
+ long
+ float
+ double
+
+
+ outputPixelType
+ outputPixelType
+
+ Input Type
+ uchar
+ unsigbed char
+ short
+ unsigned short
+ int
+ unsigned int
+ long
+ float
+ double
+
+
+ priorPixelType
+ priorPixelType
+
+ prior Type
+ float
+ unsigbed char
+ short
+ unsigned short
+ int
+ unsigned int
+ long
+ float
+ double
+
+
+
+