diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index d91c51f..ebd7b4a 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -29,4 +29,4 @@ jobs: pip install ".[dev]" - name: Test with pytest run: | - pytest -sv --doctest-modules pydra/tasks/TODO + pytest -sv --doctest-modules pydra/tasks/sem diff --git a/MANIFEST.in b/MANIFEST.in index b3718cf..0be2b1f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ include versioneer.py -include pydra/tasks/TODO/_version.py +include pydra/tasks/sem/_version.py diff --git a/pydra/tasks/TODO/__init__.py b/pydra/tasks/TODO/__init__.py deleted file mode 100644 index 35ee5f6..0000000 --- a/pydra/tasks/TODO/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" ->>> import pydra.tasks.TODO -""" -from ._version import get_versions - -__version__ = get_versions()["version"] -del get_versions diff --git a/pydra/tasks/sem/__init__.py b/pydra/tasks/sem/__init__.py new file mode 100644 index 0000000..93932a1 --- /dev/null +++ b/pydra/tasks/sem/__init__.py @@ -0,0 +1,30 @@ +from registration import * +from filtering import * +from segmentation import * +from utilities import * +from diffusion import * +from quantification import BRAINSLabelStats, PETStandardUptakeValueComputation +from brains import * +from testing import ( + CLIROITest, + ComputeReflectiveCorrelationMetric, + GenerateAverageLmkFile, + LandmarksCompare, +) +from converters import ( + CreateDICOMSeries, + DWICompare, + DWISimpleCompare, + OrientScalarVolume, +) +from legacy import * +from superresolution import GenerateEdgeMapImage +from classification import GeneratePurePlugMask +from surface import ( + GrayscaleModelMaker, + LabelMapSmoothing, + MergeModels, + ModelMaker, + ModelToLabelMap, + ProbeVolumeWithModel, +) diff --git a/pydra/tasks/TODO/_version.py b/pydra/tasks/sem/_version.py similarity index 99% rename from pydra/tasks/TODO/_version.py rename to pydra/tasks/sem/_version.py index 8aa63ef..b054446 100644 --- a/pydra/tasks/TODO/_version.py +++ b/pydra/tasks/sem/_version.py @@ -42,7 +42,7 @@ def get_config(): cfg.style = "pep440" cfg.tag_prefix = "" cfg.parentdir_prefix = "" - cfg.versionfile_source = "pydra/tasks/TODO/_version.py" + cfg.versionfile_source = "pydra/tasks/sem/_version.py" cfg.verbose = False return cfg diff --git a/pydra/tasks/sem/brains/__init__.py b/pydra/tasks/sem/brains/__init__.py new file mode 100644 index 0000000..6ff772d --- /dev/null +++ b/pydra/tasks/sem/brains/__init__.py @@ -0,0 +1,2 @@ +from classify import BRAINSPosteriorToContinuousClass +from segmentation import BRAINSTalairach, BRAINSTalairachMask diff --git a/pydra/tasks/sem/brains/classify.py b/pydra/tasks/sem/brains/classify.py new file mode 100644 index 0000000..d4a0db9 --- /dev/null +++ b/pydra/tasks/sem/brains/classify.py @@ -0,0 +1,141 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSPosteriorToContinuousClass: + """ + title: Tissue Classification + category: BRAINS.Classify + description: This program will generate an 8-bit continuous tissue classified image based on BRAINSABC posterior images. + version: 5.2.0 + documentation-url: http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSClassify + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Vincent A. Magnotta + acknowledgements: Funding for this work was provided by NIH/NINDS award NS050568 + """ + + input_fields = [ + ( + "inputWhiteVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputWhiteVolume %s", + "help_string": "White Matter Posterior Volume", + "exists": "True", + }, + ), + ), + ( + "inputBasalGmVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputBasalGmVolume %s", + "help_string": "Basal Grey Matter Posterior Volume", + "exists": "True", + }, + ), + ), + ( + "inputSurfaceGmVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputSurfaceGmVolume %s", + "help_string": "Surface Grey Matter Posterior Volume", + "exists": "True", + }, + ), + ), + ( + "inputCsfVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputCsfVolume %s", + "help_string": "CSF Posterior Volume", + "exists": "True", + }, + ), + ), + ( + "inputVbVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVbVolume %s", + "help_string": "Venous Blood Posterior Volume", + "exists": "True", + }, + ), + ), + ( + "inputCrblGmVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputCrblGmVolume %s", + "help_string": "Cerebellum Grey Matter Posterior Volume", + "exists": "True", + }, + ), + ), + ( + "inputCrblWmVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputCrblWmVolume %s", + "help_string": "Cerebellum White Matter Posterior Volume", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Output Continuous Tissue Classified Image", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output Continuous Tissue Classified Image", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSPosteriorToContinuousClass", + executable=" BRAINSPosteriorToContinuousClass ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/brains/segmentation.py b/pydra/tasks/sem/brains/segmentation.py new file mode 100644 index 0000000..c93f19d --- /dev/null +++ b/pydra/tasks/sem/brains/segmentation.py @@ -0,0 +1,287 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSTalairach: + """ + title: BRAINS Talairach + category: BRAINS.Segmentation + description: This program creates a VTK structured grid defining the Talairach coordinate system based on four points: AC, PC, IRP, and SLA. The resulting structred grid can be written as either a classic VTK file or the new VTK XML file format. Two representations of the resulting grid can be written. The first is a bounding box representation that also contains the location of the AC and PC points. The second representation is the full Talairach grid representation that includes the additional rows of boxes added to the inferior allowing full coverage of the cerebellum. + version: 5.2.0 + documentation-url: http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSTalairach + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Steven Dunn and Vincent Magnotta + acknowledgements: Funding for this work was provided by NIH/NINDS award NS050568 + """ + + input_fields = [ + ( + "AC", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--AC %s", + "help_string": "Location of AC Point ", + "sep": ",", + }, + ), + ), + ( + "ACisIndex", + attr.ib( + type=traits.Bool, + metadata={"argstr": "--ACisIndex ", "help_string": "AC Point is Index"}, + ), + ), + ( + "PC", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--PC %s", + "help_string": "Location of PC Point ", + "sep": ",", + }, + ), + ), + ( + "PCisIndex", + attr.ib( + type=traits.Bool, + metadata={"argstr": "--PCisIndex ", "help_string": "PC Point is Index"}, + ), + ), + ( + "SLA", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--SLA %s", + "help_string": "Location of SLA Point ", + "sep": ",", + }, + ), + ), + ( + "SLAisIndex", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--SLAisIndex ", + "help_string": "SLA Point is Index", + }, + ), + ), + ( + "IRP", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--IRP %s", + "help_string": "Location of IRP Point ", + "sep": ",", + }, + ), + ), + ( + "IRPisIndex", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--IRPisIndex ", + "help_string": "IRP Point is Index", + }, + ), + ), + ( + "inputLandmarksFile", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarksFile %s", + "help_string": "input landmarks file: *.fcsv", + "exists": "True", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input image used to define physical space of images", + "exists": "True", + }, + ), + ), + ( + "outputBox", + attr.ib( + type=File, + metadata={ + "argstr": "--outputBox %s", + "help_string": "Name of the resulting Talairach Bounding Box file", + "hash_files": "False", + }, + ), + ), + ( + "outputGrid", + attr.ib( + type=File, + metadata={ + "argstr": "--outputGrid %s", + "help_string": "Name of the resulting Talairach Grid file", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputBox", + attr.ib( + type=File, + metadata={ + "help_string": "Name of the resulting Talairach Bounding Box file", + "exists": "True", + }, + ), + ), + ( + "outputGrid", + attr.ib( + type=File, + metadata={ + "help_string": "Name of the resulting Talairach Grid file", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSTalairach", + executable=" BRAINSTalairach ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSTalairachMask: + """ + title: Talairach Mask + category: BRAINS.Segmentation + description: This program creates a binary image representing the specified Talairach region. The input is an example image to define the physical space for the resulting image, the Talairach grid representation in VTK format, and the file containing the Talairach box definitions to be generated. These can be combined in BRAINS to create a label map using the procedure Brains::WorkupUtils::CreateLabelMapFromBinaryImages. + version: 5.2.0 + documentation-url: http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSTalairachMask + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Steven Dunn and Vincent Magnotta + acknowledgements: Funding for this work was provided by NIH/NINDS award NS050568 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input image used to define physical space of resulting mask", + "exists": "True", + }, + ), + ), + ( + "talairachParameters", + attr.ib( + type=File, + metadata={ + "argstr": "--talairachParameters %s", + "help_string": "Name of the Talairach parameter file.", + "exists": "True", + }, + ), + ), + ( + "talairachBox", + attr.ib( + type=File, + metadata={ + "argstr": "--talairachBox %s", + "help_string": "Name of the Talairach box file.", + "exists": "True", + }, + ), + ), + ( + "hemisphereMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--hemisphereMode %s", + "help_string": "Mode for box creation: left, right, both", + }, + ), + ), + ( + "expand", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--expand ", + "help_string": "Expand exterior box to include surface CSF", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Output filename for the resulting binary image", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filename for the resulting binary image", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSTalairachMask", + executable=" BRAINSTalairachMask ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/classification.py b/pydra/tasks/sem/classification.py new file mode 100644 index 0000000..32fd1d6 --- /dev/null +++ b/pydra/tasks/sem/classification.py @@ -0,0 +1,102 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class GeneratePurePlugMask: + """ + title: Pure Plugs Mask + category: Classification + description: This program gets several modality image files and returns a binary mask that defines the pure plugs. + version: 5.2.0 + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputImageModalities", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputImageModalities %s...", + "help_string": "Input image files names (.nii.gz or .nrrd)", + }, + ), + ), + ( + "threshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--threshold %f", + "help_string": "threshold value to define class membership.", + }, + ), + ), + ( + "numberOfSubSamples", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--numberOfSubSamples %s", + "help_string": "Number of continous index samples taken at each direction of lattice space for each plug volume.", + "sep": ",", + }, + ), + ), + ( + "verbose", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--verbose ", + "help_string": "Print out some debugging information.", + }, + ), + ), + ( + "outputMaskFile", + attr.ib( + type=File, + metadata={ + "argstr": "--outputMaskFile %s", + "help_string": "Ouput binary mask that includes the pure plugs (.nrrd)", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputMaskFile", + attr.ib( + type=File, + metadata={ + "help_string": "Ouput binary mask that includes the pure plugs (.nrrd)", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GeneratePurePlugMask", + executable=" GeneratePurePlugMask ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/converters.py b/pydra/tasks/sem/converters.py new file mode 100644 index 0000000..6cf4868 --- /dev/null +++ b/pydra/tasks/sem/converters.py @@ -0,0 +1,552 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class CreateDICOMSeries: + """ + title: Create a DICOM Series + category: Converters + description: Create a DICOM Series from a Slicer volume. User can specify values for selected DICOM tags in the UI. Given the number of tags DICOM series have, it is impossible to expose all tags in UI. So only important tags can be set by the user. + version: 0.1.0.$Revision$(alpha) + documentation-url: https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/CreateDICOMSeries + contributor: Bill Lorensen (GE) + acknowledgements: This command module was derived from Insight/Examples (copyright) Insight Software Consortium + """ + + input_fields = [ + ( + "patientName", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--patientName %s", + "help_string": "The name of the patient (0010,0010)", + }, + ), + ), + ( + "patientID", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--patientID %s", + "help_string": "The patient ID (0010,0020)", + }, + ), + ), + ( + "patientBirthDate", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--patientBirthDate %s", + "help_string": "Patient birth date (0010,0030)", + }, + ), + ), + ( + "patientSex", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--patientSex %s", + "help_string": "Patient sex (0010,0040)", + }, + ), + ), + ( + "patientComments", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--patientComments %s", + "help_string": "Patient comments (0010,4000)", + }, + ), + ), + ( + "studyID", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--studyID %s", + "help_string": "The study ID (0020,0010)", + }, + ), + ), + ( + "studyDate", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--studyDate %s", + "help_string": "The date of the study (0008,0020)", + }, + ), + ), + ( + "studyTime", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--studyTime %s", + "help_string": "The time of the study (0008,0030)", + }, + ), + ), + ( + "studyComments", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--studyComments %s", + "help_string": "Study comments (0032,4000)", + }, + ), + ), + ( + "studyDescription", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--studyDescription %s", + "help_string": "Study description (0008,1030)", + }, + ), + ), + ( + "modality", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--modality %s", + "help_string": "Modality (0008,0060)", + }, + ), + ), + ( + "manufacturer", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--manufacturer %s", + "help_string": "Manufacturer (0008,0070)", + }, + ), + ), + ( + "model", + attr.ib( + type=traits.Str, + metadata={"argstr": "--model %s", "help_string": "model (0008,1090)"}, + ), + ), + ( + "seriesNumber", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--seriesNumber %s", + "help_string": "The series number (0020,0011)", + }, + ), + ), + ( + "seriesDescription", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--seriesDescription %s", + "help_string": "Series description (0008,103E)", + }, + ), + ), + ( + "seriesDate", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--seriesDate %s", + "help_string": "The date of the series (0008,0021)", + }, + ), + ), + ( + "seriesTime", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--seriesTime %s", + "help_string": "The time of the series (0008,0031)", + }, + ), + ), + ( + "rescaleIntercept", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--rescaleIntercept %f", + "help_string": "Rescale interscept (0028,1052). Converts pixel values on disk to pixel values in memory. (Pixel value in memory) = (Pixel value on disk) * rescaleSlope + rescaleIntercept. Default is 0.0. Data values are converted on write (the data is scaled and shifted so that the slope and interscept will bring it back to the current intensity range).", + }, + ), + ), + ( + "rescaleSlope", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--rescaleSlope %f", + "help_string": "Rescale slope (0028,1053). Converts pixel values on disk to pixel values in memory. (Pixel value in memory) = (Pixel value on disk) * rescaleSlope + rescaleInterscept. Default is 1.0. Data values are converted on write (the data is scaled and shifted so that the slope and interscept will bring it back to the current intensity range).", + }, + ), + ), + ( + "contentDate", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--contentDate %s", + "help_string": "The date of the image content (0008,0023)", + }, + ), + ), + ( + "contentTime", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--contentTime %s", + "help_string": "The time of the image content (0008,0033)", + }, + ), + ), + ( + "studyInstanceUID", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--studyInstanceUID %s", + "help_string": "The study instance UID (0020,000d)", + }, + ), + ), + ( + "seriesInstanceUID", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--seriesInstanceUID %s", + "help_string": "The series instance UID (0020,000e)", + }, + ), + ), + ( + "frameOfReferenceInstanceUID", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--frameOfReferenceInstanceUID %s", + "help_string": "The frame of reference instance UID (0020,0052)", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be resampled", + "position": "-1", + "exists": "True", + }, + ), + ), + ( + "dicomDirectory", + attr.ib( + type=Directory, + metadata={ + "argstr": "--dicomDirectory %s", + "help_string": "The directory to contain the DICOM series.", + "hash_files": "False", + }, + ), + ), + ( + "dicomPrefix", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--dicomPrefix %s", + "help_string": "The prefix of the DICOM filename.", + }, + ), + ), + ( + "dicomNumberFormat", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--dicomNumberFormat %s", + "help_string": "The printf-style format to be used when creating the per-slice DICOM filename.", + }, + ), + ), + ( + "reverseImages", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--reverseImages ", + "help_string": "Reverse the slices.", + }, + ), + ), + ( + "useCompression", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useCompression ", + "help_string": "Compress the output pixel data.", + }, + ), + ), + ( + "type", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--type %s", + "help_string": "Type for the new output volume.", + }, + ), + ), + ] + output_fields = [ + ( + "dicomDirectory", + attr.ib( + type=Directory, + metadata={ + "help_string": "The directory to contain the DICOM series.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="CreateDICOMSeries", + executable=" CreateDICOMSeries ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class DWICompare: + """ + title: Nrrd DWI comparison + category: Converters + description: Compares two nrrd format DWI images and verifies that gradient magnitudes, gradient directions, measurement frame, and max B0 value are identicle. Used for testing DWIConvert. + version: 5.2.0 + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/DWIConvert + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Mark Scully (UIowa) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa. + """ + + input_fields = [ + ( + "inputVolume1", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume1 %s", + "help_string": "First input volume (.nhdr or .nrrd)", + "exists": "True", + }, + ), + ), + ( + "inputVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume2 %s", + "help_string": "Second input volume (.nhdr or .nrrd)", + "exists": "True", + }, + ), + ), + ( + "useIdentityMeasurementFrame", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useIdentityMeasurementFrame ", + "help_string": "Do comparisons with identity mesasurement frames", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="DWICompare", + executable=" DWICompare ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class DWISimpleCompare: + """ + title: Nrrd DWI comparison + category: Converters + description: Compares two nrrd format DWI images and verifies that gradient magnitudes, gradient directions, measurement frame, and max B0 value are identicle. Used for testing DWIConvert. + version: 5.2.0 + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/DWIConvert + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Mark Scully (UIowa) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for DTI data produced on Philips scanners was contributed by Vincent Magnotta and Hans Johnson at the University of Iowa. + """ + + input_fields = [ + ( + "inputVolume1", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume1 %s", + "help_string": "First input volume (.nhdr or .nrrd)", + "exists": "True", + }, + ), + ), + ( + "inputVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume2 %s", + "help_string": "Second input volume (.nhdr or .nrrd)", + "exists": "True", + }, + ), + ), + ( + "checkDWIData", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--checkDWIData ", + "help_string": "check for existence of DWI data, and if present, compare it", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="DWISimpleCompare", + executable=" DWISimpleCompare ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class OrientScalarVolume: + """ + title: Orient Scalar Volume + category: Converters + description: Orients an output volume. Rearranges the slices in a volume according to the selected orientation. The slices are not interpolated. They are just reordered and/or permuted. The resulting volume will cover the original volume. NOTE: since Slicer takes into account the orientation of a volume, the re-oriented volume will not show any difference from the original volume, To see the difference, save the volume and display it with a system that either ignores the orientation of the image (e.g. Paraview) or displays individual images. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/OrientImage + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "inputVolume1", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume 1", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "The oriented volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "orientation", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--orientation %s", + "help_string": "Orientation choices", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "The oriented volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="OrientScalarVolume", + executable=" OrientScalarVolume ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/diffusion/__init__.py b/pydra/tasks/sem/diffusion/__init__.py new file mode 100644 index 0000000..9ed5999 --- /dev/null +++ b/pydra/tasks/sem/diffusion/__init__.py @@ -0,0 +1,33 @@ +from utilities import BRAINSDWICleanup, ResampleDTIVolume +from gtract import ( + compareTractInclusion, + extractNrrdVectorIndex, + 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, +) diff --git a/pydra/tasks/sem/diffusion/gtract.py b/pydra/tasks/sem/diffusion/gtract.py new file mode 100644 index 0000000..e2046ef --- /dev/null +++ b/pydra/tasks/sem/diffusion/gtract.py @@ -0,0 +1,4302 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class compareTractInclusion: + """ + title: Compare Tracts + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "testFiber", + attr.ib( + type=File, + metadata={ + "argstr": "--testFiber %s", + "help_string": "Required: test fiber tract file name", + "exists": "True", + }, + ), + ), + ( + "standardFiber", + attr.ib( + type=File, + metadata={ + "argstr": "--standardFiber %s", + "help_string": "Required: standard fiber tract file name", + "exists": "True", + }, + ), + ), + ( + "closeness", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--closeness %f", + "help_string": "Closeness of every test fiber to some fiber in the standard tract, computed as a sum of squares of spatial differences of standard points", + }, + ), + ), + ( + "numberOfPoints", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfPoints %d", + "help_string": "Number of points in comparison fiber pairs", + }, + ), + ), + ( + "testForBijection", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--testForBijection ", + "help_string": "Flag to apply the closeness criterion both ways", + }, + ), + ), + ( + "testForFiberCardinality", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--testForFiberCardinality ", + "help_string": "Flag to require the same number of fibers in both tracts", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of XML files when reading and writing vtkPolyData.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="compareTractInclusion", + executable=" compareTractInclusion ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class extractNrrdVectorIndex: + """ + title: Extract Nrrd Index + category: Diffusion.GTRACT + description: This program will extract a 3D image (single vector) from a vector 3D image at a given vector index. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input file containing the vector that will be extracted", + "exists": "True", + }, + ), + ), + ( + "vectorIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--vectorIndex %d", + "help_string": "Index in the vector image to extract", + }, + ), + ), + ( + "setImageOrientation", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--setImageOrientation %s", + "help_string": "Sets the image orientation of the extracted vector (Axial, Coronal, Sagittal)", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the vector image at the given index", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the vector image at the given index", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="extractNrrdVectorIndex", + executable=" extractNrrdVectorIndex ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractAnisotropyMap: + """ + title: Anisotropy Map + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required: input file containing the diffusion tensor image", + "exists": "True", + }, + ), + ), + ( + "anisotropyType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--anisotropyType %s", + "help_string": "Anisotropy Mapping Type: ADC, FA, RA, VR, AD, RD, LI", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the selected kind of anisotropy scalar.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the selected kind of anisotropy scalar.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractAnisotropyMap", + executable=" gtractAnisotropyMap ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractAverageBvalues: + """ + title: Average B-Values + category: Diffusion.GTRACT + description: This program will directly average together the baseline gradients (b value equals 0) within a DWI scan. This is usually used after gtractCoregBvalues. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input image file name containing multiple baseline gradients to average", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing directly averaged baseline images", + "hash_files": "False", + }, + ), + ), + ( + "directionsTolerance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--directionsTolerance %f", + "help_string": "Tolerance for matching identical gradient direction pairs", + }, + ), + ), + ( + "averageB0only", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--averageB0only ", + "help_string": "Average only baseline gradients. All other gradient directions are not averaged, but retained in the outputVolume", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing directly averaged baseline images", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractAverageBvalues", + executable=" gtractAverageBvalues ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractClipAnisotropy: + """ + title: Clip Anisotropy + category: Diffusion.GTRACT + description: This program will zero the first and/or last slice of an anisotropy image, creating a clipped anisotropy image. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input image file name", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the clipped anisotropy image", + "hash_files": "False", + }, + ), + ), + ( + "clipFirstSlice", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--clipFirstSlice ", + "help_string": "Clip the first slice of the anisotropy image", + }, + ), + ), + ( + "clipLastSlice", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--clipLastSlice ", + "help_string": "Clip the last slice of the anisotropy image", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the clipped anisotropy image", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractClipAnisotropy", + executable=" gtractClipAnisotropy ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractCoRegAnatomy: + """ + title: Coregister B0 to Anatomy B-Spline + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input vector image file name. It is recommended that the input volume is the skull stripped baseline image of the DWI scan.", + "exists": "True", + }, + ), + ), + ( + "inputAnatomicalVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnatomicalVolume %s", + "help_string": "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.", + "exists": "True", + }, + ), + ), + ( + "vectorIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--vectorIndex %d", + "help_string": "Vector image index in the moving image (within the DWI) to be used for registration.", + }, + ), + ), + ( + "inputRigidTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputRigidTransform %s", + "help_string": "Required (for B-Spline type co-registration): input rigid transform file name. Used as a starting point for the anatomical B-Spline registration.", + "exists": "True", + }, + ), + ), + ( + "outputTransformName", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransformName %s", + "help_string": "Required: filename for the fit transform.", + "hash_files": "False", + }, + ), + ), + ( + "transformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transformType %s", + "help_string": "Transform Type: Rigid|Bspline", + }, + ), + ), + ( + "numberOfIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfIterations %d", + "help_string": "Number of iterations in the selected 3D fit", + }, + ), + ), + ( + "gridSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--gridSize %s", + "help_string": "Number of grid subdivisions in all 3 directions", + "sep": ",", + }, + ), + ), + ( + "borderSize", + attr.ib( + type=traits.Int, + metadata={"argstr": "--borderSize %d", "help_string": "Size of border"}, + ), + ), + ( + "numberOfHistogramBins", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfHistogramBins %d", + "help_string": "Number of histogram bins", + }, + ), + ), + ( + "spatialScale", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--spatialScale %d", + "help_string": "Scales the number of voxels in the image by this value to specify the number of voxels used in the registration", + }, + ), + ), + ( + "convergence", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--convergence %f", + "help_string": "Convergence Factor", + }, + ), + ), + ( + "gradientTolerance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--gradientTolerance %f", + "help_string": "Gradient Tolerance", + }, + ), + ), + ( + "maxBSplineDisplacement", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maxBSplineDisplacement %f", + "help_string": " 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., ", + }, + ), + ), + ( + "maximumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumStepSize %f", + "help_string": "Maximum permitted step size to move in the selected 3D fit", + }, + ), + ), + ( + "minimumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumStepSize %f", + "help_string": "Minimum required step size to move in the selected 3D fit without converging -- decrease this to make the fit more exacting", + }, + ), + ), + ( + "translationScale", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--translationScale %f", + "help_string": "How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more translation in the fit", + }, + ), + ), + ( + "relaxationFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--relaxationFactor %f", + "help_string": "Fraction of gradient from Jacobian to attempt to move in the selected 3D fit", + }, + ), + ), + ( + "numberOfSamples", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfSamples %d", + "help_string": "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. ", + }, + ), + ), + ( + "samplingPercentage", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--samplingPercentage %f", + "help_string": "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.", + }, + ), + ), + ( + "useMomentsAlign", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useMomentsAlign ", + "help_string": "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.", + }, + ), + ), + ( + "useGeometryAlign", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useGeometryAlign ", + "help_string": "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.", + }, + ), + ), + ( + "useCenterOfHeadAlign", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useCenterOfHeadAlign ", + "help_string": "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.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputTransformName", + attr.ib( + type=File, + metadata={ + "help_string": "Required: filename for the fit transform.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractCoRegAnatomy", + executable=" gtractCoRegAnatomy ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractCoRegAnatomyBspline: + """ + title: Coregister B0 to Anatomy B-Spline + category: Diffusion.GTRACT + description: This program will register a NRRD diffusion weighted 4D vector image to a fixed anatomical image to produce a Bspline fit. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input vector image file name. It is recommended that the input volume is the skull stripped baseline image of the DWI scan.", + "exists": "True", + }, + ), + ), + ( + "inputAnatomicalVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnatomicalVolume %s", + "help_string": "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.", + "exists": "True", + }, + ), + ), + ( + "vectorIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--vectorIndex %d", + "help_string": "Vector image index in the moving image (within the DWI) to be used for registration.", + }, + ), + ), + ( + "inputRigidTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputRigidTransform %s", + "help_string": "Required (for B-Spline type co-registration): input rigid transform file name. Used as a starting point for the anatomical B-Spline registration.", + "exists": "True", + }, + ), + ), + ( + "outputBsplineTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputBsplineTransform %s", + "help_string": "Required: filename for the B-Spline fit transform.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfIterations %d", + "help_string": "Number of iterations in the selected 3D fit", + }, + ), + ), + ( + "gridSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--gridSize %s", + "help_string": "Number of grid subdivisions in all 3 directions", + "sep": ",", + }, + ), + ), + ( + "borderSize", + attr.ib( + type=traits.Int, + metadata={"argstr": "--borderSize %d", "help_string": "Size of border"}, + ), + ), + ( + "numberOfHistogramBins", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfHistogramBins %d", + "help_string": "Number of histogram bins", + }, + ), + ), + ( + "spatialScale", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--spatialScale %d", + "help_string": "Scales the number of voxels in the image by this value to specify the number of voxels used in the registration", + }, + ), + ), + ( + "convergence", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--convergence %f", + "help_string": "Convergence Factor", + }, + ), + ), + ( + "gradientTolerance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--gradientTolerance %f", + "help_string": "Gradient Tolerance", + }, + ), + ), + ( + "maxBSplineDisplacement", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maxBSplineDisplacement %f", + "help_string": " 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., ", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputBsplineTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Required: filename for the B-Spline fit transform.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractCoRegAnatomyBspline", + executable=" gtractCoRegAnatomyBspline ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractCoRegAnatomyRigid: + """ + title: Coregister B0 to Anatomy Rigid + category: Diffusion.GTRACT + description: This program will register a NRRD diffusion weighted 4D vector image to a fixed anatomical image to produce a rigid fit. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input vector image file name. It is recommended that the input volume is the skull stripped baseline image of the DWI scan.", + "exists": "True", + }, + ), + ), + ( + "inputAnatomicalVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnatomicalVolume %s", + "help_string": "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.", + "exists": "True", + }, + ), + ), + ( + "vectorIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--vectorIndex %d", + "help_string": "Vector image index in the moving image (within the DWI) to be used for registration.", + }, + ), + ), + ( + "outputRigidTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputRigidTransform %s", + "help_string": "Required: filename for the rigid fit transform.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfIterations %d", + "help_string": "Number of iterations in the selected 3D fit", + }, + ), + ), + ( + "numberOfSamples", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfSamples %d", + "help_string": "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. ", + }, + ), + ), + ( + "samplingPercentage", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--samplingPercentage %f", + "help_string": "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.", + }, + ), + ), + ( + "initialRotationAxis", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--initialRotationAxis %d", + "help_string": "Axis for the initial rotation angle: 0, 1, 2 mean x, y, z, respectively.", + }, + ), + ), + ( + "initialRotationAngle", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--initialRotationAngle %f", + "help_string": "Angle to rotate about the initial rotation angle (Degrees)", + }, + ), + ), + ( + "relaxationFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--relaxationFactor %f", + "help_string": "Fraction of gradient from Jacobian to attempt to move in the selected 3D fit", + }, + ), + ), + ( + "maximumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumStepSize %f", + "help_string": "Maximum permitted step size to move in the selected 3D fit", + }, + ), + ), + ( + "minimumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumStepSize %f", + "help_string": "Minimum required step size to move in the selected 3D fit without converging -- decrease this to make the fit more exacting", + }, + ), + ), + ( + "spatialScale", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--spatialScale %f", + "help_string": "How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more translation in the fit", + }, + ), + ), + ] + output_fields = [ + ( + "outputRigidTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Required: filename for the rigid fit transform.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractCoRegAnatomyRigid", + executable=" gtractCoRegAnatomyRigid ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractConcatDwi: + """ + title: Concat DWI Images + category: Diffusion.GTRACT + description: This program will concatenate two DTI runs together. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputVolume %s...", + "help_string": "Required: input file containing the first diffusion weighted image", + }, + ), + ), + ( + "ignoreOrigins", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--ignoreOrigins ", + "help_string": "If image origins are different force all images to origin of first image", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the combined diffusion weighted images.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the combined diffusion weighted images.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractConcatDwi", + executable=" gtractConcatDwi ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractCopyImageOrientation: + """ + title: Copy Image Orientation + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input file containing the signed short image to reorient without resampling.", + "exists": "True", + }, + ), + ), + ( + "inputReferenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReferenceVolume %s", + "help_string": "Required: input file containing orietation that will be cloned.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD or Nifti file containing the reoriented image in reference image space.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD or Nifti file containing the reoriented image in reference image space.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractCopyImageOrientation", + executable=" gtractCopyImageOrientation ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractCoregBvalues: + """ + title: Coregister B-Values + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "movingVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--movingVolume %s", + "help_string": "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.", + "exists": "True", + }, + ), + ), + ( + "fixedVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--fixedVolume %s", + "help_string": "Required: input fixed image file name. It is recommended that this image should either contain or be a b0 image.", + "exists": "True", + }, + ), + ), + ( + "fixedVolumeIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--fixedVolumeIndex %d", + "help_string": "Index in the fixed image for registration. It is recommended that this image should be a b0 image.", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing moving images individually resampled and fit to the specified fixed image index.", + "hash_files": "False", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransform %s", + "help_string": "Registration 3D transforms concatenated in a single output file. There are no tools that can use this, but can be used for debugging purposes.", + "hash_files": "False", + }, + ), + ), + ( + "eddyCurrentCorrection", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--eddyCurrentCorrection ", + "help_string": "Flag to perform eddy current corection in addition to motion correction (recommended)", + }, + ), + ), + ( + "numberOfIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfIterations %d", + "help_string": "Number of iterations in each 3D fit", + }, + ), + ), + ( + "numberOfSpatialSamples", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfSpatialSamples %d", + "help_string": "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. ", + }, + ), + ), + ( + "samplingPercentage", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--samplingPercentage %f", + "help_string": "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.", + }, + ), + ), + ( + "relaxationFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--relaxationFactor %f", + "help_string": "Fraction of gradient from Jacobian to attempt to move in each 3D fit step (adjust when eddyCurrentCorrection is enabled; suggested value = 0.25)", + }, + ), + ), + ( + "maximumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumStepSize %f", + "help_string": "Maximum permitted step size to move in each 3D fit step (adjust when eddyCurrentCorrection is enabled; suggested value = 0.1)", + }, + ), + ), + ( + "minimumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumStepSize %f", + "help_string": "Minimum required step size to move in each 3D fit step without converging -- decrease this to make the fit more exacting", + }, + ), + ), + ( + "spatialScale", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--spatialScale %f", + "help_string": "How much to scale up changes in position compared to unit rotational changes in radians -- decrease this to put more rotation in the fit", + }, + ), + ), + ( + "registerB0Only", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--registerB0Only ", + "help_string": "Register the B0 images only", + }, + ), + ), + ( + "debugLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--debugLevel %d", + "help_string": "Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing moving images individually resampled and fit to the specified fixed image index.", + "exists": "True", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Registration 3D transforms concatenated in a single output file. There are no tools that can use this, but can be used for debugging purposes.", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractCoregBvalues", + executable=" gtractCoregBvalues ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractCostFastMarching: + """ + title: Cost Fast Marching + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. The original code here was developed by Daisy Espino. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required: input tensor image file name", + "exists": "True", + }, + ), + ), + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required: input anisotropy image file name", + "exists": "True", + }, + ), + ), + ( + "inputStartingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputStartingSeedsLabelMapVolume %s", + "help_string": "Required: input starting seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "startingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--startingSeedsLabel %d", + "help_string": "Label value for Starting Seeds", + }, + ), + ), + ( + "outputCostVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputCostVolume %s", + "help_string": "Output vcl_cost image", + "hash_files": "False", + }, + ), + ), + ( + "outputSpeedVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputSpeedVolume %s", + "help_string": "Output speed image", + "hash_files": "False", + }, + ), + ), + ( + "anisotropyWeight", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--anisotropyWeight %f", + "help_string": "Anisotropy weight used for vcl_cost function calculations", + }, + ), + ), + ( + "stoppingValue", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--stoppingValue %f", + "help_string": "Terminiating value for vcl_cost function estimation", + }, + ), + ), + ( + "seedThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--seedThreshold %f", + "help_string": "Anisotropy threshold used for seed selection", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputCostVolume", + attr.ib( + type=File, + metadata={"help_string": "Output vcl_cost image", "exists": "True"}, + ), + ), + ( + "outputSpeedVolume", + attr.ib( + type=File, + metadata={"help_string": "Output speed image", "exists": "True"}, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractCostFastMarching", + executable=" gtractCostFastMarching ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractCreateGuideFiber: + """ + title: Create Guide Fiber + category: Diffusion.GTRACT + description: This program will create a guide fiber by averaging fibers from a previously generated tract. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputFiber", + attr.ib( + type=File, + metadata={ + "argstr": "--inputFiber %s", + "help_string": "Required: input fiber tract file name", + "exists": "True", + }, + ), + ), + ( + "numberOfPoints", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfPoints %d", + "help_string": "Number of points in output guide fiber", + }, + ), + ), + ( + "outputFiber", + attr.ib( + type=File, + metadata={ + "argstr": "--outputFiber %s", + "help_string": "Required: output guide fiber file name", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of XML files when reading and writing vtkPolyData.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputFiber", + attr.ib( + type=File, + metadata={ + "help_string": "Required: output guide fiber file name", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractCreateGuideFiber", + executable=" gtractCreateGuideFiber ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractFastMarchingTracking: + """ + title: Fast Marching Tracking + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. The original code here was developed by Daisy Espino. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required: input tensor image file name", + "exists": "True", + }, + ), + ), + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required: input anisotropy image file name", + "exists": "True", + }, + ), + ), + ( + "inputCostVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputCostVolume %s", + "help_string": "Required: input vcl_cost image file name", + "exists": "True", + }, + ), + ), + ( + "inputStartingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputStartingSeedsLabelMapVolume %s", + "help_string": "Required: input starting seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "startingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--startingSeedsLabel %d", + "help_string": "Label value for Starting Seeds", + }, + ), + ), + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTract %s", + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of the XML format for vtkPolyData fiber tracts.", + }, + ), + ), + ( + "numberOfIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfIterations %d", + "help_string": "Number of iterations used for the optimization", + }, + ), + ), + ( + "seedThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--seedThreshold %f", + "help_string": "Anisotropy threshold used for seed selection", + }, + ), + ), + ( + "trackingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trackingThreshold %f", + "help_string": "Anisotropy threshold used for fiber tracking", + }, + ), + ), + ( + "costStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--costStepSize %f", + "help_string": "Cost image sub-voxel sampling", + }, + ), + ), + ( + "maximumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumStepSize %f", + "help_string": "Maximum step size to move when tracking", + }, + ), + ), + ( + "minimumStepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumStepSize %f", + "help_string": "Minimum step size to move when tracking", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractFastMarchingTracking", + executable=" gtractFastMarchingTracking ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractFiberTracking: + """ + title: Fiber Tracking + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta, Greg Harris and Yongqiang Zhao. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required (for Free, Streamline, GraphSearch, and Guided fiber tracking methods): input tensor image file name", + "exists": "True", + }, + ), + ), + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required (for Free, Streamline, GraphSearch, and Guided fiber tracking methods): input anisotropy image file name", + "exists": "True", + }, + ), + ), + ( + "inputStartingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputStartingSeedsLabelMapVolume %s", + "help_string": "Required (for Free, Streamline, GraphSearch, and Guided fiber tracking methods): input starting seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "startingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--startingSeedsLabel %d", + "help_string": "Label value for Starting Seeds (required if Label number used to create seed point in Slicer was not 1)", + }, + ), + ), + ( + "inputEndingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputEndingSeedsLabelMapVolume %s", + "help_string": "Required (for Streamline, GraphSearch, and Guided fiber tracking methods): input ending seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "endingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--endingSeedsLabel %d", + "help_string": "Label value for Ending Seeds (required if Label number used to create seed point in Slicer was not 1)", + }, + ), + ), + ( + "inputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTract %s", + "help_string": "Required (for Guided fiber tracking method): guide fiber in vtkPolydata file containing one tract line.", + "exists": "True", + }, + ), + ), + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTract %s", + "help_string": "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.", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of the XML format for vtkPolyData fiber tracts.", + }, + ), + ), + ( + "trackingMethod", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--trackingMethod %s", + "help_string": "Fiber tracking Filter Type: Guided|Free|Streamline|GraphSearch", + }, + ), + ), + ( + "guidedCurvatureThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--guidedCurvatureThreshold %f", + "help_string": "Guided Curvature Threshold (Degrees)", + }, + ), + ), + ( + "maximumGuideDistance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumGuideDistance %f", + "help_string": "Maximum distance for using the guide fiber direction", + }, + ), + ), + ( + "seedThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--seedThreshold %f", + "help_string": "Anisotropy threshold for seed selection (recommended for Free fiber tracking)", + }, + ), + ), + ( + "trackingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trackingThreshold %f", + "help_string": "Anisotropy threshold for fiber tracking (anisotropy values of the next point along the path)", + }, + ), + ), + ( + "curvatureThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--curvatureThreshold %f", + "help_string": "Curvature threshold in degrees (recommended for Free fiber tracking)", + }, + ), + ), + ( + "branchingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--branchingThreshold %f", + "help_string": "Anisotropy Branching threshold (recommended for GraphSearch fiber tracking method)", + }, + ), + ), + ( + "maximumBranchPoints", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--maximumBranchPoints %d", + "help_string": "Maximum branch points (recommended for GraphSearch fiber tracking method)", + }, + ), + ), + ( + "useRandomWalk", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useRandomWalk ", + "help_string": "Flag to use random walk.", + }, + ), + ), + ( + "randomSeed", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--randomSeed %d", + "help_string": "Random number generator seed", + }, + ), + ), + ( + "branchingAngle", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--branchingAngle %f", + "help_string": "Branching angle in degrees (recommended for GraphSearch fiber tracking method)", + }, + ), + ), + ( + "minimumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumLength %f", + "help_string": "Minimum fiber length. Helpful for filtering invalid tracts.", + }, + ), + ), + ( + "maximumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumLength %f", + "help_string": "Maximum fiber length (voxels)", + }, + ), + ), + ( + "stepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--stepSize %f", + "help_string": "Fiber tracking step size", + }, + ), + ), + ( + "useLoopDetection", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useLoopDetection ", + "help_string": "Flag to make use of loop detection.", + }, + ), + ), + ( + "useTend", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useTend ", + "help_string": "Flag to make use of Tend F and Tend G parameters.", + }, + ), + ), + ( + "tendF", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendF %f", "help_string": "Tend F parameter"}, + ), + ), + ( + "tendG", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendG %f", "help_string": "Tend G parameter"}, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "help_string": "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.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractFiberTracking", + executable=" gtractFiberTracking ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractFreeTracking: + """ + title: Free Tracking + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required: input tensor image file name", + "exists": "True", + }, + ), + ), + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required: input anisotropy image file name", + "exists": "True", + }, + ), + ), + ( + "inputStartingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputStartingSeedsLabelMapVolume %s", + "help_string": "Required: input starting seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "startingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--startingSeedsLabel %d", + "help_string": "Label value for Starting Seeds", + }, + ), + ), + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTract %s", + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of the XML format for vtkPolyData fiber tracts.", + }, + ), + ), + ( + "seedThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--seedThreshold %f", + "help_string": "Anisotropy threshold for seed selection", + }, + ), + ), + ( + "trackingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trackingThreshold %f", + "help_string": "Anisotropy threshold for fiber tracking", + }, + ), + ), + ( + "curvatureThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--curvatureThreshold %f", + "help_string": "Curvature threshold (Degrees)", + }, + ), + ), + ( + "minimumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumLength %f", + "help_string": "Minimum fiber length. Helpful for filtering invalid tracts.", + }, + ), + ), + ( + "maximumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumLength %f", + "help_string": "Maximum fiber length", + }, + ), + ), + ( + "stepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--stepSize %f", + "help_string": "Fiber tracking step size", + }, + ), + ), + ( + "useLoopDetection", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useLoopDetection ", + "help_string": "Flag to make use of loop detection.", + }, + ), + ), + ( + "useTend", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useTend ", + "help_string": "Flag to make use of Tend F and Tend G parameters.", + }, + ), + ), + ( + "tendF", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendF %f", "help_string": "Tend F parameter"}, + ), + ), + ( + "tendG", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendG %f", "help_string": "Tend G parameter"}, + ), + ), + ] + output_fields = [ + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractFreeTracking", + executable=" gtractFreeTracking ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractGraphSearchTracking: + """ + title: Graph Search Tracking + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required: input tensor image file name", + "exists": "True", + }, + ), + ), + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required: input anisotropy image file name", + "exists": "True", + }, + ), + ), + ( + "inputStartingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputStartingSeedsLabelMapVolume %s", + "help_string": "Required: input starting seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "startingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--startingSeedsLabel %d", + "help_string": "Label value for Starting Seeds", + }, + ), + ), + ( + "inputEndingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputEndingSeedsLabelMapVolume %s", + "help_string": "Required: input ending seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "endingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--endingSeedsLabel %d", + "help_string": "Label value for Ending Seeds", + }, + ), + ), + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTract %s", + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of the XML format for vtkPolyData fiber tracts.", + }, + ), + ), + ( + "seedThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--seedThreshold %f", + "help_string": "Anisotropy threshold for seed selection", + }, + ), + ), + ( + "trackingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trackingThreshold %f", + "help_string": "Anisotropy threshold for fiber tracking", + }, + ), + ), + ( + "curvatureThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--curvatureThreshold %f", + "help_string": "Curvature threshold (Degrees)", + }, + ), + ), + ( + "branchingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--branchingThreshold %f", + "help_string": "Anisotropy Branching threshold", + }, + ), + ), + ( + "maximumBranchPoints", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--maximumBranchPoints %d", + "help_string": "Maximum branch points", + }, + ), + ), + ( + "useRandomWalk", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useRandomWalk ", + "help_string": "Flag to use random walk.", + }, + ), + ), + ( + "randomSeed", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--randomSeed %d", + "help_string": "Random number generator seed", + }, + ), + ), + ( + "branchingAngle", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--branchingAngle %f", + "help_string": "Branchging angle (Degrees)", + }, + ), + ), + ( + "minimumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumLength %f", + "help_string": "Minimum fiber length. Helpful for filtering invalid tracts.", + }, + ), + ), + ( + "maximumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumLength %f", + "help_string": "Maximum fiber length", + }, + ), + ), + ( + "stepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--stepSize %f", + "help_string": "Fiber tracking step size", + }, + ), + ), + ( + "useLoopDetection", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useLoopDetection ", + "help_string": "Flag to make use of loop detection.", + }, + ), + ), + ( + "useTend", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useTend ", + "help_string": "Flag to make use of Tend F and Tend G parameters.", + }, + ), + ), + ( + "tendF", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendF %f", "help_string": "Tend F parameter"}, + ), + ), + ( + "tendG", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendG %f", "help_string": "Tend G parameter"}, + ), + ), + ] + output_fields = [ + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractGraphSearchTracking", + executable=" gtractGraphSearchTracking ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractGuidedTracking: + """ + title: Guided Tracking + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required: input tensor image file name", + "exists": "True", + }, + ), + ), + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required: input anisotropy image file name", + "exists": "True", + }, + ), + ), + ( + "inputStartingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputStartingSeedsLabelMapVolume %s", + "help_string": "Required: input starting seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "startingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--startingSeedsLabel %d", + "help_string": "Label value for Starting Seeds", + }, + ), + ), + ( + "inputEndingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputEndingSeedsLabelMapVolume %s", + "help_string": "Required: input ending seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "endingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--endingSeedsLabel %d", + "help_string": "Label value for Ending Seeds", + }, + ), + ), + ( + "inputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTract %s", + "help_string": "Required: guide fiber in vtkPolydata file containing one tract line.", + "exists": "True", + }, + ), + ), + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTract %s", + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of the XML format for vtkPolyData fiber tracts.", + }, + ), + ), + ( + "seedThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--seedThreshold %f", + "help_string": "Anisotropy threshold for seed selection", + }, + ), + ), + ( + "trackingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trackingThreshold %f", + "help_string": "Anisotropy threshold for fiber tracking", + }, + ), + ), + ( + "maximumGuideDistance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumGuideDistance %f", + "help_string": "Maximum distance for using the guide fiber direction", + }, + ), + ), + ( + "curvatureThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--curvatureThreshold %f", + "help_string": "Curvature threshold (Degrees)", + }, + ), + ), + ( + "guidedCurvatureThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--guidedCurvatureThreshold %f", + "help_string": "Guided Curvature Threshold (Degrees)", + }, + ), + ), + ( + "minimumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumLength %f", + "help_string": "Minimum fiber length. Helpful for filtering invalid tracts.", + }, + ), + ), + ( + "maximumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumLength %f", + "help_string": "Maximum fiber length", + }, + ), + ), + ( + "stepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--stepSize %f", + "help_string": "Fiber tracking step size", + }, + ), + ), + ( + "useLoopDetection", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useLoopDetection ", + "help_string": "Flag to make use of loop detection.", + }, + ), + ), + ( + "useTend", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useTend ", + "help_string": "Flag to make use of Tend F and Tend G parameters.", + }, + ), + ), + ( + "tendF", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendF %f", "help_string": "Tend F parameter"}, + ), + ), + ( + "tendG", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendG %f", "help_string": "Tend G parameter"}, + ), + ), + ] + output_fields = [ + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractGuidedTracking", + executable=" gtractGuidedTracking ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractImageConformity: + """ + title: Image Conformity + category: Diffusion.GTRACT + description: This program will straighten out the Direction and Origin to match the Reference Image. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input file containing the signed short image to reorient without resampling.", + "exists": "True", + }, + ), + ), + ( + "inputReferenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReferenceVolume %s", + "help_string": "Required: input file containing the standard image to clone the characteristics of.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output Nrrd or Nifti file containing the reoriented image in reference image space.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output Nrrd or Nifti file containing the reoriented image in reference image space.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractImageConformity", + executable=" gtractImageConformity ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractInvertBSplineTransform: + """ + title: B-Spline Transform Inversion + category: Diffusion.GTRACT + description: This program will invert a B-Spline transform using a thin-plate spline approximation. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputReferenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReferenceVolume %s", + "help_string": "Required: input image file name to exemplify the anatomical space to interpolate over.", + "exists": "True", + }, + ), + ), + ( + "inputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransform %s", + "help_string": "Required: input B-Spline transform file name", + "exists": "True", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransform %s", + "help_string": "Required: output transform file name", + "hash_files": "False", + }, + ), + ), + ( + "landmarkDensity", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--landmarkDensity %s", + "help_string": "Number of landmark subdivisions in all 3 directions", + "sep": ",", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Required: output transform file name", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractInvertBSplineTransform", + executable=" gtractInvertBSplineTransform ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractInvertDisplacementField: + """ + title: Invert Displacement Field + category: Diffusion.GTRACT + description: This program will invert a deformatrion field. The size of the deformation field is defined by an example image provided by the user + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "baseImage", + attr.ib( + type=File, + metadata={ + "argstr": "--baseImage %s", + "help_string": "Required: base image used to define the size of the inverse field", + "exists": "True", + }, + ), + ), + ( + "deformationImage", + attr.ib( + type=File, + metadata={ + "argstr": "--deformationImage %s", + "help_string": "Required: Displacement field image", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: Output deformation field", + "hash_files": "False", + }, + ), + ), + ( + "subsamplingFactor", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--subsamplingFactor %d", + "help_string": "Subsampling factor for the deformation field", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: Output deformation field", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractInvertDisplacementField", + executable=" gtractInvertDisplacementField ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractInvertRigidTransform: + """ + title: Rigid Transform Inversion + category: Diffusion.GTRACT + description: This program will invert a Rigid transform. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransform %s", + "help_string": "Required: input rigid transform file name", + "exists": "True", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransform %s", + "help_string": "Required: output transform file name", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Required: output transform file name", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractInvertRigidTransform", + executable=" gtractInvertRigidTransform ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractResampleAnisotropy: + """ + title: Resample Anisotropy + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required: input file containing the anisotropy image", + "exists": "True", + }, + ), + ), + ( + "inputAnatomicalVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnatomicalVolume %s", + "help_string": "Required: input file containing the anatomical image whose characteristics will be cloned.", + "exists": "True", + }, + ), + ), + ( + "inputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransform %s", + "help_string": "Required: input Rigid OR Bspline transform file name", + "exists": "True", + }, + ), + ), + ( + "transformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transformType %s", + "help_string": "Transform type: Rigid, B-Spline", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the resampled transformed anisotropy image.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the resampled transformed anisotropy image.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractResampleAnisotropy", + executable=" gtractResampleAnisotropy ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractResampleB0: + """ + title: Resample B0 + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input file containing the 4D image", + "exists": "True", + }, + ), + ), + ( + "inputAnatomicalVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnatomicalVolume %s", + "help_string": "Required: input file containing the anatomical image defining the origin, spacing and size of the resampled image (template)", + "exists": "True", + }, + ), + ), + ( + "inputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransform %s", + "help_string": "Required: input Rigid OR Bspline transform file name", + "exists": "True", + }, + ), + ), + ( + "vectorIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--vectorIndex %d", + "help_string": "Index in the diffusion weighted image set for the B0 image", + }, + ), + ), + ( + "transformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transformType %s", + "help_string": "Transform type: Rigid, B-Spline", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the resampled input image.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the resampled input image.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractResampleB0", + executable=" gtractResampleB0 ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractResampleCodeImage: + """ + title: Resample Code Image + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputCodeVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputCodeVolume %s", + "help_string": "Required: input file containing the code image", + "exists": "True", + }, + ), + ), + ( + "inputReferenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReferenceVolume %s", + "help_string": "Required: input file containing the standard image to clone the characteristics of.", + "exists": "True", + }, + ), + ), + ( + "inputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransform %s", + "help_string": "Required: input Rigid or Inverse-B-Spline transform file name", + "exists": "True", + }, + ), + ), + ( + "transformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transformType %s", + "help_string": "Transform type: Rigid or Inverse-B-Spline", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the resampled code image in acquisition space.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the resampled code image in acquisition space.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractResampleCodeImage", + executable=" gtractResampleCodeImage ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractResampleDWIInPlace: + """ + title: Resample DWI In Place + category: Diffusion.GTRACT + description: Resamples DWI image to structural image. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta, Greg Harris, Hans Johnson, and Joy Matsui. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input image is a 4D NRRD image.", + "exists": "True", + }, + ), + ), + ( + "referenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--referenceVolume %s", + "help_string": "If provided, resample to the final space of the referenceVolume 3D data set.", + "exists": "True", + }, + ), + ), + ( + "outputResampledB0", + attr.ib( + type=File, + metadata={ + "argstr": "--outputResampledB0 %s", + "help_string": "Convenience function for extracting the first index location (assumed to be the B0)", + "hash_files": "False", + }, + ), + ), + ( + "inputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransform %s", + "help_string": "Required: transform file derived from rigid registration of b0 image to reference structural image.", + "exists": "True", + }, + ), + ), + ( + "warpDWITransform", + attr.ib( + type=File, + metadata={ + "argstr": "--warpDWITransform %s", + "help_string": "Optional: transform file to warp gradient volumes.", + "exists": "True", + }, + ), + ), + ( + "debugLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--debugLevel %d", + "help_string": "Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.", + }, + ), + ), + ( + "writeOutputMetaData", + attr.ib( + type=File, + metadata={ + "argstr": "--writeOutputMetaData %s", + "help_string": "A file to write the output image diffusion gradient directions in a CSV file", + "hash_files": "False", + }, + ), + ), + ( + "imageOutputSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--imageOutputSize %s", + "help_string": "The voxel lattice for the output image, padding is added if necessary. NOTE: if 0,0,0, then the inputVolume size is used.", + "sep": ",", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "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.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputResampledB0", + attr.ib( + type=File, + metadata={ + "help_string": "Convenience function for extracting the first index location (assumed to be the B0)", + "exists": "True", + }, + ), + ), + ( + "writeOutputMetaData", + attr.ib( + type=File, + metadata={ + "help_string": "A file to write the output image diffusion gradient directions in a CSV file", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "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.", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractResampleDWIInPlace", + executable=" gtractResampleDWIInPlace ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractResampleFibers: + """ + title: Resample Fibers + category: Diffusion.GTRACT + description: This program will resample a fiber tract with respect to a pair of deformation fields that represent the forward and reverse deformation fields. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputForwardDeformationFieldVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputForwardDeformationFieldVolume %s", + "help_string": "Required: input forward deformation field image file name", + "exists": "True", + }, + ), + ), + ( + "inputReverseDeformationFieldVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReverseDeformationFieldVolume %s", + "help_string": "Required: input reverse deformation field image file name", + "exists": "True", + }, + ), + ), + ( + "inputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTract %s", + "help_string": "Required: name of input vtkPolydata file containing tract lines.", + "exists": "True", + }, + ), + ), + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTract %s", + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of the XML format for vtkPolyData fiber tracts.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractResampleFibers", + executable=" gtractResampleFibers ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractStreamlineTracking: + """ + title: Streamline Tracking + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTensorVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTensorVolume %s", + "help_string": "Required: input tensor image file name", + "exists": "True", + }, + ), + ), + ( + "inputAnisotropyVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputAnisotropyVolume %s", + "help_string": "Required: input anisotropy image file name", + "exists": "True", + }, + ), + ), + ( + "inputStartingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputStartingSeedsLabelMapVolume %s", + "help_string": "Required: input starting seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "startingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--startingSeedsLabel %d", + "help_string": "Label value for Starting Seeds", + }, + ), + ), + ( + "inputEndingSeedsLabelMapVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputEndingSeedsLabelMapVolume %s", + "help_string": "Required: input ending seeds LabelMap image file name", + "exists": "True", + }, + ), + ), + ( + "endingSeedsLabel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--endingSeedsLabel %d", + "help_string": "Label value for Ending Seeds", + }, + ), + ), + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTract %s", + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "hash_files": "False", + }, + ), + ), + ( + "writeXMLPolyDataFile", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeXMLPolyDataFile ", + "help_string": "Flag to make use of the XML format for vtkPolyData fiber tracts.", + }, + ), + ), + ( + "seedThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--seedThreshold %f", + "help_string": "Anisotropy threshold for seed selection", + }, + ), + ), + ( + "trackingThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trackingThreshold %f", + "help_string": "Anisotropy threshold for fiber tracking", + }, + ), + ), + ( + "curvatureThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--curvatureThreshold %f", + "help_string": "Curvature threshold (Degrees)", + }, + ), + ), + ( + "minimumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--minimumLength %f", + "help_string": "Minimum fiber length. Helpful for filtering invalid tracts.", + }, + ), + ), + ( + "maximumLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumLength %f", + "help_string": "Maximum fiber length", + }, + ), + ), + ( + "stepSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--stepSize %f", + "help_string": "Fiber tracking step size", + }, + ), + ), + ( + "useLoopDetection", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useLoopDetection ", + "help_string": "Flag to make use of loop detection.", + }, + ), + ), + ( + "useTend", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useTend ", + "help_string": "Flag to make use of Tend F and Tend G parameters.", + }, + ), + ), + ( + "tendF", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendF %f", "help_string": "Tend F parameter"}, + ), + ), + ( + "tendG", + attr.ib( + type=traits.Float, + metadata={"argstr": "--tendG %f", "help_string": "Tend G parameter"}, + ), + ), + ] + output_fields = [ + ( + "outputTract", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output vtkPolydata file containing tract lines and the point data collected along them.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractStreamlineTracking", + executable=" gtractStreamlineTracking ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractTensor: + """ + title: Tensor Estimation + category: Diffusion.GTRACT + description: 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. + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta and Greg Harris. + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "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.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Required: name of output NRRD file containing the Tensor vector image", + "hash_files": "False", + }, + ), + ), + ( + "medianFilterSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--medianFilterSize %s", + "help_string": "Median filter radius in all 3 directions", + "sep": ",", + }, + ), + ), + ( + "maskProcessingMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--maskProcessingMode %s", + "help_string": "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", + }, + ), + ), + ( + "maskVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--maskVolume %s", + "help_string": "Mask Image, if maskProcessingMode is ROI", + "exists": "True", + }, + ), + ), + ( + "backgroundSuppressingThreshold", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--backgroundSuppressingThreshold %d", + "help_string": "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.", + }, + ), + ), + ( + "resampleIsotropic", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--resampleIsotropic ", + "help_string": "Flag to resample to isotropic voxels. Enabling this feature is recommended if fiber tracking will be performed.", + }, + ), + ), + ( + "size", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--size %f", + "help_string": "Isotropic voxel size to resample to", + }, + ), + ), + ( + "b0Index", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--b0Index %d", + "help_string": "Index in input vector index to extract", + }, + ), + ), + ( + "applyMeasurementFrame", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--applyMeasurementFrame ", + "help_string": "Flag to apply the measurement frame to the gradient directions", + }, + ), + ), + ( + "ignoreIndex", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--ignoreIndex %s", + "help_string": "Ignore diffusion gradient index. Used to remove specific gradient directions with artifacts.", + "sep": ",", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Required: name of output NRRD file containing the Tensor vector image", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractTensor", + executable=" gtractTensor ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class gtractTransformToDisplacementField: + """ + title: Create Displacement Field + category: Diffusion.GTRACT + description: This program will compute forward deformation from the given Transform. The size of the DF is equal to MNI space + version: 5.2.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Modules:GTRACT + license: http://mri.radiology.uiowa.edu/copyright/GTRACT-Copyright.txt + contributor: This tool was developed by Vincent Magnotta, Madhura Ingalhalikar, and Greg Harris + acknowledgements: Funding for this version of the GTRACT program was provided by NIH/NINDS R01NS050568-01A2S1 + """ + + input_fields = [ + ( + "inputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransform %s", + "help_string": "Input Transform File Name", + "exists": "True", + }, + ), + ), + ( + "inputReferenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReferenceVolume %s", + "help_string": "Required: input image file name to exemplify the anatomical space over which to vcl_express the transform as a displacement field.", + "exists": "True", + }, + ), + ), + ( + "outputDeformationFieldVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputDeformationFieldVolume %s", + "help_string": "Output deformation field", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputDeformationFieldVolume", + attr.ib( + type=File, + metadata={"help_string": "Output deformation field", "exists": "True"}, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="gtractTransformToDisplacementField", + executable=" gtractTransformToDisplacementField ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/diffusion/utilities.py b/pydra/tasks/sem/diffusion/utilities.py new file mode 100644 index 0000000..2d40151 --- /dev/null +++ b/pydra/tasks/sem/diffusion/utilities.py @@ -0,0 +1,392 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSDWICleanup: + """ + title: BRAINSDWICleanup + category: Diffusion.Utilities + description: Remove bad gradients/volumes from DWI NRRD file. + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: This tool was developed by Kent Williams. + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Required: input image is a 4D NRRD image.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "given a list of ", + "hash_files": "False", + }, + ), + ), + ( + "badGradients", + attr.ib( + type=InputMultiPath, + metadata={"argstr": "--badGradients %s", "sep": ","}, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={"help_string": "given a list of ", "exists": "True"}, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSDWICleanup", + executable=" BRAINSDWICleanup ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class ResampleDTIVolume: + """ + title: Resample DTI Volume + category: Diffusion.Utilities + description: Resampling an image is a very important task in image analysis. It is especially important in the frame of image registration. This module implements DT image resampling through the use of itk Transforms. The resampling is controlled by the Output Spacing. "Resampling" is performed in space coordinates, not pixel/grid coordinates. It is quite important to ensure that image spacing is properly set on the images involved. The interpolator is required since the mapping from one space to the other will often require evaluation of the intensity of the image at non-grid positions. + version: 1.0.2 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ResampleDTI + contributor: Francois Budin (UNC) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://nihroadmap.nih.gov/bioinformatics + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be resampled", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Resampled Volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "Reference", + attr.ib( + type=File, + metadata={ + "argstr": "--Reference %s", + "help_string": "Reference Volume (spacing,size,orientation,origin)", + "exists": "True", + }, + ), + ), + ( + "transformationFile", + attr.ib( + type=File, + metadata={"argstr": "--transformationFile %s", "exists": "True"}, + ), + ), + ( + "defField", + attr.ib( + type=File, + metadata={ + "argstr": "--defField %s", + "help_string": "File containing the deformation field (3D vector image containing vectors with 3 components)", + "exists": "True", + }, + ), + ), + ( + "hfieldtype", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--hfieldtype %s", + "help_string": "Set if the deformation field is an -Field", + }, + ), + ), + ( + "interpolation", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolation %s", + "help_string": "Sampling algorithm (linear , nn (nearest neighborhoor), ws (WindowedSinc), bs (BSpline) )", + }, + ), + ), + ( + "noMeasurementFrame", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--noMeasurementFrame ", + "help_string": "Do not use the measurement frame that is in the input image to transform the tensors. Uses the image orientation instead", + }, + ), + ), + ( + "correction", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--correction %s", + "help_string": "Correct the tensors if computed tensor is not semi-definite positive", + }, + ), + ), + ( + "transform_tensor_method", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transform_tensor_method %s", + "help_string": "Chooses between 2 methods to transform the tensors: Finite Strain (FS), faster but less accurate, or Preservation of the Principal Direction (PPD)", + }, + ), + ), + ( + "transform_order", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transform_order %s", + "help_string": "Select in what order the transforms are read", + }, + ), + ), + ( + "notbulk", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--notbulk ", + "help_string": "The transform following the BSpline transform is not set as a bulk transform for the BSpline transform", + }, + ), + ), + ( + "spaceChange", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--spaceChange ", + "help_string": "Space Orientation between transform and image is different (RAS/LPS) (warning: if the transform is a Transform Node in Slicer3, do not select)", + }, + ), + ), + ( + "rotation_point", + attr.ib( + type=traits.List, + metadata={ + "argstr": "--rotation_point %s", + "help_string": "Center of rotation (only for rigid and affine transforms)", + }, + ), + ), + ( + "centered_transform", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--centered_transform ", + "help_string": "Set the center of the transformation to the center of the input image (only for rigid and affine transforms)", + }, + ), + ), + ( + "image_center", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--image_center %s", + "help_string": "Image to use to center the transform (used only if 'Centered Transform' is selected)", + }, + ), + ), + ( + "Inverse_ITK_Transformation", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--Inverse_ITK_Transformation ", + "help_string": "Inverse the transformation before applying it from output image to input image (only for rigid and affine transforms)", + }, + ), + ), + ( + "spacing", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--spacing %s", + "help_string": "Spacing along each dimension (0 means use input spacing)", + "sep": ",", + }, + ), + ), + ( + "size", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--size %s", + "help_string": "Size along each dimension (0 means use input size)", + "sep": ",", + }, + ), + ), + ( + "origin", + attr.ib( + type=traits.List, + metadata={ + "argstr": "--origin %s", + "help_string": "Origin of the output Image", + }, + ), + ), + ( + "direction_matrix", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--direction_matrix %s", + "help_string": "9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)", + "sep": ",", + }, + ), + ), + ( + "number_of_thread", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--number_of_thread %d", + "help_string": "Number of thread used to compute the output image", + }, + ), + ), + ( + "default_pixel_value", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--default_pixel_value %f", + "help_string": "Default pixel value for samples falling outside of the input region", + }, + ), + ), + ( + "window_function", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--window_function %s", + "help_string": "Window Function \nh = Hamming \nc = Cosine \nw = Welch \nl = Lanczos \nb = Blackman", + }, + ), + ), + ( + "spline_order", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--spline_order %d", + "help_string": "Spline Order (Spline order may be from 0 to 5)", + }, + ), + ), + ( + "transform_matrix", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--transform_matrix %s", + "help_string": "12 parameters of the transform matrix by rows ( --last 3 being translation-- )", + "sep": ",", + }, + ), + ), + ( + "transform", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transform %s", + "help_string": "Transform algorithm\nrt = Rigid Transform\na = Affine Transform", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Resampled Volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ResampleDTIVolume", + executable=" ResampleDTIVolume ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/__init__.py b/pydra/tasks/sem/filtering/__init__.py new file mode 100644 index 0000000..a207ded --- /dev/null +++ b/pydra/tasks/sem/filtering/__init__.py @@ -0,0 +1,21 @@ +from arithmetic import ( + AddScalarVolumes, + CastScalarVolume, + MaskScalarVolume, + MultiplyScalarVolumes, + SubtractScalarVolumes, +) +from denoising import ( + CurvatureAnisotropicDiffusion, + GaussianBlurImageFilter, + GradientAnisotropicDiffusion, + MedianImageFilter, +) +from morphology import GrayscaleFillHoleImageFilter, GrayscaleGrindPeakImageFilter +from checkerboardfilter import CheckerBoardFilter +from histogrammatching import HistogramMatching +from imagelabelcombine import ImageLabelCombine +from n4itkbiasfieldcorrection import N4ITKBiasFieldCorrection +from resamplescalarvectordwivolume import ResampleScalarVectorDWIVolume +from thresholdscalarvolume import ThresholdScalarVolume +from votingbinaryholefillingimagefilter import VotingBinaryHoleFillingImageFilter diff --git a/pydra/tasks/sem/filtering/arithmetic.py b/pydra/tasks/sem/filtering/arithmetic.py new file mode 100644 index 0000000..79449d9 --- /dev/null +++ b/pydra/tasks/sem/filtering/arithmetic.py @@ -0,0 +1,433 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class AddScalarVolumes: + """ + title: Add Scalar Volumes + category: Filtering.Arithmetic + description: Adds two images. Although all image types are supported on input, only signed types are produced. The two images do not have to have the same dimensions. + version: 0.1.0.$Revision$(alpha) + documentation-url: https://www.slicer.org/wiki/Documentation/Nightly/Modules/Add + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "inputVolume1", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume 1", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "inputVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume 2", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Volume1 + Volume2", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "order", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--order %s", + "help_string": "Interpolation order if two images are in different coordinate frames or have different sampling.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Volume1 + Volume2", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="AddScalarVolumes", + executable=" AddScalarVolumes ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class CastScalarVolume: + """ + title: Cast Scalar Volume + category: Filtering.Arithmetic + description: Cast a volume to a given data type.\nUse at your own risk when casting an input volume into a lower precision type!\nAllows casting to the same type as the input volume. + version: 0.1.0.$Revision: 2104 $(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Cast + contributor: Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume, the volume to cast.", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output volume, cast to the new type.", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "type", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--type %s", + "help_string": "Scalar data type for the new output volume.", + }, + ), + ), + ] + output_fields = [ + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output volume, cast to the new type.", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="CastScalarVolume", + executable=" CastScalarVolume ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class MaskScalarVolume: + """ + title: Mask Scalar Volume + category: Filtering.Arithmetic + description: Masks two images. The output image is set to 0 everywhere except where the chosen label from the mask volume is present, at which point it will retain it's original values. The two images do not have to have the same dimensions. + version: 0.1.0.$Revision: 8595 $(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Mask + contributor: Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be masked", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "MaskVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Label volume containing the mask", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output volume: Input Volume masked by label value from Mask Volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "label", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--label %d", + "help_string": "Label value in the Mask Volume to use as the mask", + }, + ), + ), + ( + "replace", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--replace %d", + "help_string": "Value to use for the output volume outside of the mask", + }, + ), + ), + ] + output_fields = [ + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output volume: Input Volume masked by label value from Mask Volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="MaskScalarVolume", + executable=" MaskScalarVolume ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class MultiplyScalarVolumes: + """ + title: Multiply Scalar Volumes + category: Filtering.Arithmetic + description: Multiplies two images. Although all image types are supported on input, only signed types are produced. The two images do not have to have the same dimensions. + version: 0.1.0.$Revision: 8595 $(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Multiply + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "inputVolume1", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume 1", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "inputVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume 2", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Volume1 * Volume2", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "order", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--order %s", + "help_string": "Interpolation order if two images are in different coordinate frames or have different sampling.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Volume1 * Volume2", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="MultiplyScalarVolumes", + executable=" MultiplyScalarVolumes ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class SubtractScalarVolumes: + """ + title: Subtract Scalar Volumes + category: Filtering.Arithmetic + description: Subtracts two images. Although all image types are supported on input, only signed types are produced. The two images do not have to have the same dimensions. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Subtract + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "inputVolume1", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume 1", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "inputVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume 2", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Volume1 - Volume2", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "order", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--order %s", + "help_string": "Interpolation order if two images are in different coordinate frames or have different sampling.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Volume1 - Volume2", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="SubtractScalarVolumes", + executable=" SubtractScalarVolumes ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/checkerboardfilter.py b/pydra/tasks/sem/filtering/checkerboardfilter.py new file mode 100644 index 0000000..7ebcb4d --- /dev/null +++ b/pydra/tasks/sem/filtering/checkerboardfilter.py @@ -0,0 +1,100 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class CheckerBoardFilter: + """ + title: CheckerBoard Filter + category: Filtering + description: Create a checkerboard volume of two volumes. The output volume will show the two inputs alternating according to the user supplied checkerPattern. This filter is often used to compare the results of image registration. Note that the second input is resampled to the same origin, spacing and direction before it is composed with the first input. The scalar type of the output volume will be the same as the input image scalar type. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/CheckerBoard + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "checkerPattern", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--checkerPattern %s", + "help_string": "The pattern of input 1 and input 2 in the output image. The user can specify the number of checkers in each dimension. A checkerPattern of 2,2,1 means that images will alternate in every other checker in the first two dimensions. The same pattern will be used in the 3rd dimension.", + "sep": ",", + }, + ), + ), + ( + "inputVolume1", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "First Input volume", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "inputVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Second Input volume", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="CheckerBoardFilter", + executable=" CheckerBoardFilter ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/denoising.py b/pydra/tasks/sem/filtering/denoising.py new file mode 100644 index 0000000..15cdbb5 --- /dev/null +++ b/pydra/tasks/sem/filtering/denoising.py @@ -0,0 +1,354 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class CurvatureAnisotropicDiffusion: + """ + title: Curvature Anisotropic Diffusion + category: Filtering.Denoising + description: Performs anisotropic diffusion on an image using a modified curvature diffusion equation (MCDE).\n\nMCDE does not exhibit the edge enhancing properties of classic anisotropic diffusion, which can under certain conditions undergo a 'negative' diffusion, which enhances the contrast of edges. Equations of the form of MCDE always undergo positive diffusion, with the conductance term only varying the strength of that diffusion. \n\n Qualitatively, MCDE compares well with other non-linear diffusion techniques. It is less sensitive to contrast than classic Perona-Malik style diffusion, and preserves finer detailed structures in images. There is a potential speed trade-off for using this function in place of Gradient Anisotropic Diffusion. Each iteration of the solution takes roughly twice as long. Fewer iterations, however, may be required to reach an acceptable solution. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/CurvatureAnisotropicDiffusion + contributor: Bill Lorensen (GE) + acknowledgements: This command module was derived from Insight/Examples (copyright) Insight Software Consortium + """ + + input_fields = [ + ( + "conductance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--conductance %f", + "help_string": "Conductance controls the sensitivity of the conductance term. As a general rule, the lower the value, the more strongly the filter preserves edges. A high value will cause diffusion (smoothing) across edges. Note that the number of iterations controls how much smoothing is done within regions bounded by edges.", + }, + ), + ), + ( + "iterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--iterations %d", + "help_string": "The more iterations, the more smoothing. Each iteration takes the same amount of time. If it takes 10 seconds for one iteration, then it will take 100 seconds for 10 iterations. Note that the conductance controls how much each iteration smooths across edges.", + }, + ), + ), + ( + "timeStep", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--timeStep %f", + "help_string": "The time step depends on the dimensionality of the image. In Slicer the images are 3D and the default (.0625) time step will provide a stable solution.", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="CurvatureAnisotropicDiffusion", + executable=" CurvatureAnisotropicDiffusion ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class GaussianBlurImageFilter: + """ + title: Gaussian Blur Image Filter + category: Filtering.Denoising + description: Apply a gaussian blurr to an image + version: 0.1.0.$Revision: 1.1 $(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GaussianBlurImageFilter + contributor: Julien Jomier (Kitware), Stephen Aylward (Kitware) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "sigma", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--sigma %f", + "help_string": "Sigma value in physical units (e.g., mm) of the Gaussian kernel", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Blurred Volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Blurred Volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GaussianBlurImageFilter", + executable=" GaussianBlurImageFilter ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class GradientAnisotropicDiffusion: + """ + title: Gradient Anisotropic Diffusion + category: Filtering.Denoising + description: Runs gradient anisotropic diffusion on a volume.\n\nAnisotropic diffusion methods reduce noise (or unwanted detail) in images while preserving specific image features, like edges. For many applications, there is an assumption that light-dark transitions (edges) are interesting. Standard isotropic diffusion methods move and blur light-dark boundaries. Anisotropic diffusion methods are formulated to specifically preserve edges. The conductance term for this implementation is a function of the gradient magnitude of the image at each point, reducing the strength of diffusion at edges. The numerical implementation of this equation is similar to that described in the Perona-Malik paper, but uses a more robust technique for gradient magnitude estimation and has been generalized to N-dimensions. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GradientAnisotropicDiffusion + contributor: Bill Lorensen (GE) + acknowledgements: This command module was derived from Insight/Examples (copyright) Insight Software Consortium + """ + + input_fields = [ + ( + "conductance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--conductance %f", + "help_string": "Conductance controls the sensitivity of the conductance term. As a general rule, the lower the value, the more strongly the filter preserves edges. A high value will cause diffusion (smoothing) across edges. Note that the number of iterations controls how much smoothing is done within regions bounded by edges.", + }, + ), + ), + ( + "iterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--iterations %d", + "help_string": "The more iterations, the more smoothing. Each iteration takes the same amount of time. If it takes 10 seconds for one iteration, then it will take 100 seconds for 10 iterations. Note that the conductance controls how much each iteration smooths across edges.", + }, + ), + ), + ( + "timeStep", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--timeStep %f", + "help_string": "The time step depends on the dimensionality of the image. In Slicer the images are 3D and the default (.0625) time step will provide a stable solution.", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "useImageSpacing", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useImageSpacing ", + "help_string": "![CDATA[Take into account image spacing in the computation. It is advisable to turn this option on, especially when the pixel size is different in different dimensions. However, to produce results consistent with Slicer4.2 and earlier, this option should be turned off.]]", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GradientAnisotropicDiffusion", + executable=" GradientAnisotropicDiffusion ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class MedianImageFilter: + """ + title: Median Image Filter + category: Filtering.Denoising + description: The MedianImageFilter is commonly used as a robust approach for noise reduction. This filter is particularly efficient against "salt-and-pepper" noise. In other words, it is robust to the presence of gray-level outliers. MedianImageFilter computes the value of each output pixel as the statistical median of the neighborhood of values around the corresponding input pixel. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/MedianImageFilter + contributor: Bill Lorensen (GE) + acknowledgements: This command module was derived from Insight/Examples/Filtering/MedianImageFilter (copyright) Insight Software Consortium + """ + + input_fields = [ + ( + "neighborhood", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--neighborhood %s", + "help_string": "The size of the neighborhood in each dimension", + "sep": ",", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="MedianImageFilter", + executable=" MedianImageFilter ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/histogrammatching.py b/pydra/tasks/sem/filtering/histogrammatching.py new file mode 100644 index 0000000..b2c2931 --- /dev/null +++ b/pydra/tasks/sem/filtering/histogrammatching.py @@ -0,0 +1,119 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class HistogramMatching: + """ + title: Histogram Matching + category: Filtering + description: Normalizes the grayscale values of a source image based on the grayscale values of a reference image. This filter uses a histogram matching technique where the histograms of the two images are matched only at a specified number of quantile values.\n\nThe filter was originally designed to normalize MR images of the sameMR protocol and same body part. The algorithm works best if background pixels are excluded from both the source and reference histograms. A simple background exclusion method is to exclude all pixels whose grayscale values are smaller than the mean grayscale value. ThresholdAtMeanIntensity switches on this simple background exclusion method.\n\nNumber of match points governs the number of quantile values to be matched.\n\nThe filter assumes that both the source and reference are of the same type and that the input and output image type have the same number of dimension and have scalar pixel types. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/HistogramMatching + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "numberOfHistogramLevels", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfHistogramLevels %d", + "help_string": "The number of hisogram levels to use", + }, + ), + ), + ( + "numberOfMatchPoints", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfMatchPoints %d", + "help_string": "The number of match points to use", + }, + ), + ), + ( + "threshold", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--threshold ", + "help_string": "If on, only pixels above the mean in each volume are thresholded.", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "referenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume whose histogram will be matched", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output volume. This is the input volume with intensities matched to the reference volume.", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output volume. This is the input volume with intensities matched to the reference volume.", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="HistogramMatching", + executable=" HistogramMatching ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/imagelabelcombine.py b/pydra/tasks/sem/filtering/imagelabelcombine.py new file mode 100644 index 0000000..df02d32 --- /dev/null +++ b/pydra/tasks/sem/filtering/imagelabelcombine.py @@ -0,0 +1,98 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class ImageLabelCombine: + """ + title: Image Label Combine + category: Filtering + description: Combine two label maps into one + version: 0.1.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ImageLabelCombine + contributor: Alex Yarmarkovich (SPL, BWH) + """ + + input_fields = [ + ( + "InputLabelMap_A", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Label map image", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "InputLabelMap_B", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Label map image", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputLabelMap", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Resulting Label map image", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "first_overwrites", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--first_overwrites ", + "help_string": "Use first or second label when both are present", + }, + ), + ), + ] + output_fields = [ + ( + "OutputLabelMap", + attr.ib( + type=File, + metadata={ + "help_string": "Resulting Label map image", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ImageLabelCombine", + executable=" ImageLabelCombine ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/morphology.py b/pydra/tasks/sem/filtering/morphology.py new file mode 100644 index 0000000..239d821 --- /dev/null +++ b/pydra/tasks/sem/filtering/morphology.py @@ -0,0 +1,139 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class GrayscaleFillHoleImageFilter: + """ + title: Grayscale Fill Hole Image Filter + category: Filtering.Morphology + description: GrayscaleFillholeImageFilter fills holes in a grayscale image. Holes are local minima in the grayscale topography that are not connected to boundaries of the image. Gray level values adjacent to a hole are extrapolated across the hole.\n\nThis filter is used to smooth over local minima without affecting the values of local maxima. If you take the difference between the output of this filter and the original image (and perhaps threshold the difference above a small value), you'll obtain a map of the local minima.\n\nThis filter uses the itkGrayscaleGeodesicErodeImageFilter. It provides its own input as the "mask" input to the geodesic erosion. The "marker" image for the geodesic erosion is constructed such that boundary pixels match the boundary pixels of the input image and the interior pixels are set to the maximum pixel value in the input image.\n\n Geodesic morphology and the Fillhole algorithm is described in Chapter 6 of Pierre Soille's book "Morphological Image Analysis: Principles and Applications", Second Edition, Springer, 2003. \n\n A companion filter, Grayscale Grind Peak, removes peaks in grayscale images. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GrayscaleFillHoleImageFilter + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GrayscaleFillHoleImageFilter", + executable=" GrayscaleFillHoleImageFilter ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class GrayscaleGrindPeakImageFilter: + """ + title: Grayscale Grind Peak Image Filter + category: Filtering.Morphology + description: GrayscaleGrindPeakImageFilter removes peaks in a grayscale image. Peaks are local maxima in the grayscale topography that are not connected to boundaries of the image. Gray level values adjacent to a peak are extrapolated through the peak.\n\nThis filter is used to smooth over local maxima without affecting the values of local minima. If you take the difference between the output of this filter and the original image (and perhaps threshold the difference above a small value), you'll obtain a map of the local maxima.\n\nThis filter uses the GrayscaleGeodesicDilateImageFilter. It provides its own input as the "mask" input to the geodesic erosion. The "marker" image for the geodesic erosion is constructed such that boundary pixels match the boundary pixels of the input image and the interior pixels are set to the minimum pixel value in the input image.\n\nThis filter is the dual to the GrayscaleFillholeImageFilter which implements the Fillhole algorithm. Since it is a dual, it is somewhat superfluous but is provided as a convenience.\n\nGeodesic morphology and the Fillhole algorithm is described in Chapter 6 of Pierre Soille's book "Morphological Image Analysis: Principles and Applications", Second Edition, Springer, 2003.\n\nA companion filter, Grayscale Fill Hole, fills holes in grayscale images. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GrayscaleGrindPeakImageFilter + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GrayscaleGrindPeakImageFilter", + executable=" GrayscaleGrindPeakImageFilter ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/n4itkbiasfieldcorrection.py b/pydra/tasks/sem/filtering/n4itkbiasfieldcorrection.py new file mode 100644 index 0000000..13c7581 --- /dev/null +++ b/pydra/tasks/sem/filtering/n4itkbiasfieldcorrection.py @@ -0,0 +1,212 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class N4ITKBiasFieldCorrection: + """ + title: N4ITK MRI Bias correction + category: Filtering + description: Performs image bias correction using N4 algorithm. This module is based on the ITK filters contributed in the following publication: Tustison N, Gee J "N4ITK: Nick's N3 ITK Implementation For MRI Bias Field Correction", The Insight Journal 2009 January-June, http://hdl.handle.net/10380/3053 + version: 9 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/N4ITKBiasFieldCorrection + contributor: Nick Tustison (UPenn), Andrey Fedorov (SPL, BWH), Ron Kikinis (SPL, BWH) + acknowledgements: The development of this module was partially supported by NIH grants R01 AA016748-01, R01 CA111288 and U01 CA151261 as well as by NA-MIC, NAC, NCIGT and the Slicer community. + """ + + input_fields = [ + ( + "inputImageName", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input image where you observe signal inhomegeneity", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "maskimage", + attr.ib( + type=File, + metadata={ + "argstr": "--maskimage %s", + "help_string": "Binary mask that defines the structure of your interest. NOTE: This parameter is OPTIONAL. If the mask is not specified, the module will use internally Otsu thresholding to define this mask. Better processing results can often be obtained when a meaningful mask is defined.", + "exists": "True", + }, + ), + ), + ( + "outputImageName", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Result of processing", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "outputbiasfield", + attr.ib( + type=File, + metadata={ + "argstr": "--outputbiasfield %s", + "help_string": "Recovered bias field (OPTIONAL)", + "hash_files": "False", + }, + ), + ), + ( + "meshresolution", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--meshresolution %s", + "help_string": "Resolution of the initial bspline grid defined as a sequence of three numbers. The actual resolution will be defined by adding the bspline order (default is 3) to the resolution in each dimension specified here. For example, 1,1,1 will result in a 4x4x4 grid of control points. This parameter may need to be adjusted based on your input image. In the multi-resolution N4 framework, the resolution of the bspline grid at subsequent iterations will be doubled. The number of resolutions is implicitly defined by Number of iterations parameter (the size of this list is the number of resolutions)", + "sep": ",", + }, + ), + ), + ( + "splinedistance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--splinedistance %f", + "help_string": "An alternative means to define the spline grid, by setting the distance between the control points. This parameter is used only if the grid resolution is not specified.", + }, + ), + ), + ( + "bffwhm", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--bffwhm %f", + "help_string": "Bias field Full Width at Half Maximum. Zero implies use of the default value.", + }, + ), + ), + ( + "iterations", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--iterations %s", + "help_string": "Maximum number of iterations at each level of resolution. Larger values will increase execution time, but may lead to better results.", + "sep": ",", + }, + ), + ), + ( + "convergencethreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--convergencethreshold %f", + "help_string": "Stopping criterion for the iterative bias estimation. Larger values will lead to smaller execution time.", + }, + ), + ), + ( + "bsplineorder", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--bsplineorder %d", + "help_string": "Order of B-spline used in the approximation. Larger values will lead to longer execution times, may result in overfitting and poor result.", + }, + ), + ), + ( + "shrinkfactor", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--shrinkfactor %d", + "help_string": "Defines how much the image should be upsampled before estimating the inhomogeneity field. Increase if you want to reduce the execution time. 1 corresponds to the original resolution. Larger values will significantly reduce the computation time.", + }, + ), + ), + ( + "weightimage", + attr.ib( + type=File, + metadata={ + "argstr": "--weightimage %s", + "help_string": "Weight Image", + "exists": "True", + }, + ), + ), + ( + "wienerfilternoise", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--wienerfilternoise %f", + "help_string": "Wiener filter noise. Zero implies use of the default value.", + }, + ), + ), + ( + "nhistogrambins", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--nhistogrambins %d", + "help_string": "Number of histogram bins. Zero implies use of the default value.", + }, + ), + ), + ] + output_fields = [ + ( + "outputImageName", + attr.ib( + type=File, + metadata={ + "help_string": "Result of processing", + "position": "-1", + "exists": "True", + }, + ), + ), + ( + "outputbiasfield", + attr.ib( + type=File, + metadata={ + "help_string": "Recovered bias field (OPTIONAL)", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="N4ITKBiasFieldCorrection", + executable=" N4ITKBiasFieldCorrection ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/resamplescalarvectordwivolume.py b/pydra/tasks/sem/filtering/resamplescalarvectordwivolume.py new file mode 100644 index 0000000..059604d --- /dev/null +++ b/pydra/tasks/sem/filtering/resamplescalarvectordwivolume.py @@ -0,0 +1,297 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class ResampleScalarVectorDWIVolume: + """ + title: Resample Scalar/Vector/DWI Volume + category: Filtering + description: This module implements image and vector-image resampling through the use of itk Transforms.It can also handle diffusion weighted MRI image resampling. "Resampling" is performed in space coordinates, not pixel/grid coordinates. It is quite important to ensure that image spacing is properly set on the images involved. The interpolator is required since the mapping from one space to the other will often require evaluation of the intensity of the image at non-grid positions. \n\nWarning: To resample DWMR Images, use nrrd input and output files. \n\nWarning: Do not use to resample Diffusion Tensor Images, tensors would not be reoriented + version: 0.1 + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ResampleScalarVectorDWIVolume + contributor: Francois Budin (UNC) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://nihroadmap.nih.gov/bioinformatics + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input Volume to be resampled", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Resampled Volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "Reference", + attr.ib( + type=File, + metadata={ + "argstr": "--Reference %s", + "help_string": "Reference Volume (spacing,size,orientation,origin)", + "exists": "True", + }, + ), + ), + ( + "transformationFile", + attr.ib( + type=File, + metadata={"argstr": "--transformationFile %s", "exists": "True"}, + ), + ), + ( + "defField", + attr.ib( + type=File, + metadata={ + "argstr": "--defField %s", + "help_string": "File containing the deformation field (3D vector image containing vectors with 3 components)", + "exists": "True", + }, + ), + ), + ( + "hfieldtype", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--hfieldtype %s", + "help_string": "Set if the deformation field is an h-Field", + }, + ), + ), + ( + "interpolation", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolation %s", + "help_string": "Sampling algorithm (linear or nn (nearest neighborhoor), ws (WindowedSinc), bs (BSpline) )", + }, + ), + ), + ( + "transform_order", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transform_order %s", + "help_string": "Select in what order the transforms are read", + }, + ), + ), + ( + "notbulk", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--notbulk ", + "help_string": "The transform following the BSpline transform is not set as a bulk transform for the BSpline transform", + }, + ), + ), + ( + "spaceChange", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--spaceChange ", + "help_string": "Space Orientation between transform and image is different (RAS/LPS) (warning: if the transform is a Transform Node in Slicer3, do not select)", + }, + ), + ), + ( + "rotation_point", + attr.ib( + type=traits.List, + metadata={ + "argstr": "--rotation_point %s", + "help_string": "Rotation Point in case of rotation around a point (otherwise useless)", + }, + ), + ), + ( + "centered_transform", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--centered_transform ", + "help_string": "Set the center of the transformation to the center of the input image", + }, + ), + ), + ( + "image_center", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--image_center %s", + "help_string": "Image to use to center the transform (used only if 'Centered Transform' is selected)", + }, + ), + ), + ( + "Inverse_ITK_Transformation", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--Inverse_ITK_Transformation ", + "help_string": "Inverse the transformation before applying it from output image to input image", + }, + ), + ), + ( + "spacing", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--spacing %s", + "help_string": "Spacing along each dimension (0 means use input spacing)", + "sep": ",", + }, + ), + ), + ( + "size", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--size %s", + "help_string": "Size along each dimension (0 means use input size)", + "sep": ",", + }, + ), + ), + ( + "origin", + attr.ib( + type=traits.List, + metadata={ + "argstr": "--origin %s", + "help_string": "Origin of the output Image", + }, + ), + ), + ( + "direction_matrix", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--direction_matrix %s", + "help_string": "9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)", + "sep": ",", + }, + ), + ), + ( + "number_of_thread", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--number_of_thread %d", + "help_string": "Number of thread used to compute the output image", + }, + ), + ), + ( + "default_pixel_value", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--default_pixel_value %f", + "help_string": "Default pixel value for samples falling outside of the input region", + }, + ), + ), + ( + "window_function", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--window_function %s", + "help_string": "Window Function \nh = Hamming \nc = Cosine \nw = Welch \nl = Lanczos \nb = Blackman", + }, + ), + ), + ( + "spline_order", + attr.ib( + type=traits.Int, + metadata={"argstr": "--spline_order %d", "help_string": "Spline Order"}, + ), + ), + ( + "transform_matrix", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--transform_matrix %s", + "help_string": "12 parameters of the transform matrix by rows ( --last 3 being translation-- )", + "sep": ",", + }, + ), + ), + ( + "transform", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transform %s", + "help_string": "Transform algorithm\nrt = Rigid Transform\na = Affine Transform", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Resampled Volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ResampleScalarVectorDWIVolume", + executable=" ResampleScalarVectorDWIVolume ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/thresholdscalarvolume.py b/pydra/tasks/sem/filtering/thresholdscalarvolume.py new file mode 100644 index 0000000..3031d24 --- /dev/null +++ b/pydra/tasks/sem/filtering/thresholdscalarvolume.py @@ -0,0 +1,134 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class ThresholdScalarVolume: + """ + title: Threshold Scalar Volume + category: Filtering + description:

Threshold an image.

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.

+ version: 0.1.0.$Revision: 2104 $(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Threshold + contributor: Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH), Julien Finet (Kitware) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Thresholded input volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "thresholdtype", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--thresholdtype %s", + "help_string": "What kind of threshold to perform. If Outside is selected, uses Upper and Lower values. If Below is selected, uses the ThresholdValue, if Above is selected, uses the ThresholdValue.", + }, + ), + ), + ( + "threshold", + attr.ib( + type=traits.Float, + metadata={"argstr": "--threshold %f", "help_string": "Threshold value"}, + ), + ), + ( + "lower", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--lower %f", + "help_string": "Lower threshold value", + }, + ), + ), + ( + "upper", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--upper %f", + "help_string": "Upper threshold value", + }, + ), + ), + ( + "outsidevalue", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--outsidevalue %f", + "help_string": "Set the voxels to this value if they fall outside the threshold range", + }, + ), + ), + ( + "negate", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--negate ", + "help_string": "Swap the outside value with the inside value.", + }, + ), + ), + ] + output_fields = [ + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Thresholded input volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ThresholdScalarVolume", + executable=" ThresholdScalarVolume ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/filtering/votingbinaryholefillingimagefilter.py b/pydra/tasks/sem/filtering/votingbinaryholefillingimagefilter.py new file mode 100644 index 0000000..61961ad --- /dev/null +++ b/pydra/tasks/sem/filtering/votingbinaryholefillingimagefilter.py @@ -0,0 +1,118 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class VotingBinaryHoleFillingImageFilter: + """ + title: Voting Binary Hole Filling Image Filter + category: Filtering + description: Applies a voting operation in order to fill-in cavities. This can be used for smoothing contours and for filling holes in binary images. This technique is used frequently when segmenting complete organs that may have ducts or vasculature that may not have been included in the initial segmentation, e.g. lungs, kidneys, liver. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/VotingBinaryHoleFillingImageFilter + contributor: Bill Lorensen (GE) + acknowledgements: This command module was derived from Insight/Examples/Filtering/VotingBinaryHoleFillingImageFilter (copyright) Insight Software Consortium + """ + + input_fields = [ + ( + "radius", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--radius %s", + "help_string": "The radius of a hole to be filled", + "sep": ",", + }, + ), + ), + ( + "majorityThreshold", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--majorityThreshold %d", + "help_string": "The number of pixels over 50% that will decide whether an OFF pixel will become ON or not. For example, if the neighborhood of a pixel has 124 pixels (excluding itself), the 50% will be 62, and if you set a Majority threshold of 5, that means that the filter will require 67 or more neighbor pixels to be ON in order to switch the current OFF pixel to ON.", + }, + ), + ), + ( + "background", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--background %d", + "help_string": "The value associated with the background (not object)", + }, + ), + ), + ( + "foreground", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--foreground %d", + "help_string": "The value associated with the foreground (object)", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="VotingBinaryHoleFillingImageFilter", + executable=" VotingBinaryHoleFillingImageFilter ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/legacy/__init__.py b/pydra/tasks/sem/legacy/__init__.py new file mode 100644 index 0000000..fc3aa14 --- /dev/null +++ b/pydra/tasks/sem/legacy/__init__.py @@ -0,0 +1,3 @@ +from work import DiffusionTensorTest +from registration import ExpertAutomatedRegistration, TestGridTransformRegistration +from filtering import ResampleScalarVolume diff --git a/pydra/tasks/sem/legacy/filtering.py b/pydra/tasks/sem/legacy/filtering.py new file mode 100644 index 0000000..fef24a4 --- /dev/null +++ b/pydra/tasks/sem/legacy/filtering.py @@ -0,0 +1,98 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class ResampleScalarVolume: + """ + title: Resample Scalar Volume + category: Legacy.Filtering + description: Resampling an image is an important task in image analysis. It is especially important in the frame of image registration. This module implements image resampling through the use of itk Transforms. This module uses an Identity Transform. The resampling is controlled by the Output Spacing. "Resampling" is performed in space coordinates, not pixel/grid coordinates. It is quite important to ensure that image spacing is properly set on the images involved. The interpolator is required since the mapping from one space to the other will often require evaluation of the intensity of the image at non-grid positions. Several interpolators are available: linear, nearest neighbor, bspline and five flavors of sinc. The sinc interpolators, although more precise, are much slower than the linear and nearest neighbor interpolator. To resample label volumnes, nearest neighbor interpolation should be used exclusively. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ResampleVolume + contributor: Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "spacing", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--spacing %s", + "help_string": "Spacing along each dimension (0 means use input spacing)", + "sep": ",", + }, + ), + ), + ( + "interpolation", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolation %s", + "help_string": "Sampling algorithm (linear, nearest neighbor, bspline(cubic) or windowed sinc). There are several sinc algorithms available as described in the following publication: Erik H. W. Meijering, Wiro J. Niessen, Josien P. W. Pluim, Max A. Viergever: Quantitative Comparison of Sinc-Approximating Kernels for Medical Image Interpolation. MICCAI 1999, pp. 210-217. Each window has a radius of 3;", + }, + ), + ), + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be resampled", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Resampled Volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Resampled Volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ResampleScalarVolume", + executable=" ResampleScalarVolume ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/legacy/registration.py b/pydra/tasks/sem/legacy/registration.py new file mode 100644 index 0000000..d416026 --- /dev/null +++ b/pydra/tasks/sem/legacy/registration.py @@ -0,0 +1,429 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class ExpertAutomatedRegistration: + """ + title: Expert Automated Registration + category: Legacy.Registration + description: Provides rigid, affine, and BSpline registration methods via a simple GUI + version: 0.1.0.$Revision: 2104 $(alpha) + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ExpertAutomatedRegistration + contributor: Stephen R Aylward (Kitware), Casey B Goodlett (Kitware) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "fixedImage", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Image which defines the space into which the moving image is registered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "movingImage", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "The transform goes from the fixed image's space into the moving image's space", + "position": "-1", + "exists": "True", + }, + ), + ), + ( + "resampledImage", + attr.ib( + type=File, + metadata={ + "argstr": "--resampledImage %s", + "help_string": "Registration results", + "hash_files": "False", + }, + ), + ), + ( + "loadTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--loadTransform %s", + "help_string": "Load a transform that is immediately applied to the moving image", + "exists": "True", + }, + ), + ), + ( + "saveTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--saveTransform %s", + "help_string": "Save the transform that results from registration", + "hash_files": "False", + }, + ), + ), + ( + "initialization", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--initialization %s", + "help_string": "Method to prime the registration process", + }, + ), + ), + ( + "registration", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--registration %s", + "help_string": "Method for the registration process", + }, + ), + ), + ( + "metric", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--metric %s", + "help_string": "Method to quantify image match", + }, + ), + ), + ( + "expectedOffset", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--expectedOffset %f", + "help_string": "Expected misalignment after initialization", + }, + ), + ), + ( + "expectedRotation", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--expectedRotation %f", + "help_string": "Expected misalignment after initialization", + }, + ), + ), + ( + "expectedScale", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--expectedScale %f", + "help_string": "Expected misalignment after initialization", + }, + ), + ), + ( + "expectedSkew", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--expectedSkew %f", + "help_string": "Expected misalignment after initialization", + }, + ), + ), + ( + "verbosityLevel", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--verbosityLevel %s", + "help_string": "Level of detail of reporting progress", + }, + ), + ), + ( + "sampleFromOverlap", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--sampleFromOverlap ", + "help_string": "Limit metric evaluation to the fixed image region overlapped by the moving image", + }, + ), + ), + ( + "fixedImageMask", + attr.ib( + type=File, + metadata={ + "argstr": "--fixedImageMask %s", + "help_string": "Image which defines a mask for the fixed image", + "exists": "True", + }, + ), + ), + ( + "randomNumberSeed", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--randomNumberSeed %d", + "help_string": "Seed to generate a consistent random number sequence", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Number of CPU threads to use", + }, + ), + ), + ( + "minimizeMemory", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--minimizeMemory ", + "help_string": "Reduce the amount of memory required at the cost of increased computation time", + }, + ), + ), + ( + "interpolation", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolation %s", + "help_string": "Method for interpolation within the optimization process", + }, + ), + ), + ( + "fixedLandmarks", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--fixedLandmarks %s...", + "help_string": "Ordered list of landmarks in the fixed image", + }, + ), + ), + ( + "movingLandmarks", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--movingLandmarks %s...", + "help_string": "Ordered list of landmarks in the moving image", + }, + ), + ), + ( + "rigidMaxIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--rigidMaxIterations %d", + "help_string": "Maximum number of rigid optimization iterations", + }, + ), + ), + ( + "rigidSamplingRatio", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--rigidSamplingRatio %f", + "help_string": "Portion of the image to use in computing the metric during rigid registration", + }, + ), + ), + ( + "affineMaxIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--affineMaxIterations %d", + "help_string": "Maximum number of affine optimization iterations", + }, + ), + ), + ( + "affineSamplingRatio", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--affineSamplingRatio %f", + "help_string": "Portion of the image to use in computing the metric during affine registration", + }, + ), + ), + ( + "bsplineMaxIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--bsplineMaxIterations %d", + "help_string": "Maximum number of bspline optimization iterations", + }, + ), + ), + ( + "bsplineSamplingRatio", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--bsplineSamplingRatio %f", + "help_string": "Portion of the image to use in computing the metric during BSpline registration", + }, + ), + ), + ( + "controlPointSpacing", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--controlPointSpacing %d", + "help_string": "Number of pixels between control points", + }, + ), + ), + ] + output_fields = [ + ( + "resampledImage", + attr.ib( + type=File, + metadata={"help_string": "Registration results", "exists": "True"}, + ), + ), + ( + "saveTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Save the transform that results from registration", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ExpertAutomatedRegistration", + executable=" ExpertAutomatedRegistration ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class TestGridTransformRegistration: + """ + title: Test GridTransform registration + category: Legacy.Registration + description: Generates a GridTransform to test the communication facilities + version: 0.1.0.$Revision: 6760 $(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/TestGridTransformRegistration + contributor: Yinglin Lee (SPL, BWH) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "gridSize", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--gridSize %d", + "help_string": "Number of grid points on interior of image.", + }, + ), + ), + ( + "outputtransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputtransform %s", + "help_string": "The grid transform (deformation vector field).", + "hash_files": "False", + }, + ), + ), + ( + "FixedImageFileName", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Fixed image to which to register", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "MovingImageFileName", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Moving image", + "position": "-1", + "exists": "True", + }, + ), + ), + ] + output_fields = [ + ( + "outputtransform", + attr.ib( + type=File, + metadata={ + "help_string": "The grid transform (deformation vector field).", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="TestGridTransformRegistration", + executable=" TestGridTransformRegistration ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/legacy/work.py b/pydra/tasks/sem/legacy/work.py new file mode 100644 index 0000000..ab2b14e --- /dev/null +++ b/pydra/tasks/sem/legacy/work.py @@ -0,0 +1,75 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class DiffusionTensorTest: + """ + title: Simple IO Test + category: Legacy.Work in Progress.Diffusion Tensor.Test + description: Simple test of tensor IO + version: 0.1.0.$Revision$(alpha) + contributor: Bill Lorensen (GE) + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input tensor volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Filtered tensor volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Filtered tensor volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="DiffusionTensorTest", + executable=" DiffusionTensorTest ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/quantification.py b/pydra/tasks/sem/quantification.py new file mode 100644 index 0000000..cb93f8e --- /dev/null +++ b/pydra/tasks/sem/quantification.py @@ -0,0 +1,289 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSLabelStats: + """ + title: Label Statistics (BRAINS) + category: Quantification + description: Compute image statistics within each label of a label map. + version: 5.2.0 + documentation-url: http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSClassify + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Vincent A. Magnotta + acknowledgements: Funding for this work was provided by the Dana Foundation + """ + + input_fields = [ + ( + "imageVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--imageVolume %s", + "help_string": "Image Volume", + "exists": "True", + }, + ), + ), + ( + "labelVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--labelVolume %s", + "help_string": "Label Volume", + "exists": "True", + }, + ), + ), + ( + "labelNameFile", + attr.ib( + type=File, + metadata={ + "argstr": "--labelNameFile %s", + "help_string": "Label Name File", + "exists": "True", + }, + ), + ), + ( + "outputPrefixColumnNames", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--outputPrefixColumnNames %s", + "help_string": "Prefix Column Name(s)", + "sep": ",", + }, + ), + ), + ( + "outputPrefixColumnValues", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--outputPrefixColumnValues %s", + "help_string": "Prefix Column Value(s)", + "sep": ",", + }, + ), + ), + ( + "labelFileType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--labelFileType %s", + "help_string": "Label File Type", + }, + ), + ), + ( + "numberOfHistogramBins", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfHistogramBins %d", + "help_string": "Number Of Histogram Bins", + }, + ), + ), + ( + "minMaxType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--minMaxType %s", + "help_string": "Define minimim and maximum values based upon the image, label, or via command line", + }, + ), + ), + ( + "userDefineMinimum", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--userDefineMinimum %f", + "help_string": "User define minimum value", + }, + ), + ), + ( + "userDefineMaximum", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--userDefineMaximum %f", + "help_string": "User define maximum value", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSLabelStats", + executable=" BRAINSLabelStats ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class PETStandardUptakeValueComputation: + """ + title: PET Standard Uptake Value Computation + category: Quantification + description: Computes the standardized uptake value based on body weight. Takes an input PET image in DICOM and NRRD format (DICOM header must contain Radiopharmaceutical parameters). Produces a CSV file that contains patientID, studyDate, dose, labelID, suvmin, suvmax, suvmean, labelName for each volume of interest. It also displays some of the information as output strings in the GUI, the CSV file is optional in that case. The CSV file is appended to on each execution of the CLI. + version: 0.1.0.$Revision: 8595 $(alpha) + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ComputeSUVBodyWeight + contributor: Wendy Plesniak (SPL, BWH), Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + acknowledgements: This work is funded by the Harvard Catalyst, and the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "petDICOMPath", + attr.ib( + type=Directory, + metadata={ + "argstr": "--petDICOMPath %s", + "help_string": "Input path to a directory containing a PET volume containing DICOM header information for SUV computation", + "exists": "True", + }, + ), + ), + ( + "petVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--petVolume %s", + "help_string": "Input PET volume for SUVbw computation (must be the same volume as pointed to by the DICOM path!).", + "exists": "True", + }, + ), + ), + ( + "labelMap", + attr.ib( + type=File, + metadata={ + "argstr": "--labelMap %s", + "help_string": "Input label volume containing the volumes of interest", + "exists": "True", + }, + ), + ), + ( + "color", + attr.ib( + type=File, + metadata={ + "argstr": "--color %s", + "help_string": "Color table to to map labels to colors and names", + "exists": "True", + }, + ), + ), + ( + "csvFile", + attr.ib( + type=File, + metadata={ + "argstr": "--csvFile %s", + "help_string": "A table holding the output SUV values in comma separated lines, one per label. Optional.", + "hash_files": "False", + }, + ), + ), + ( + "OutputLabel", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--OutputLabel %s", + "help_string": "List of labels for which SUV values were computed", + }, + ), + ), + ( + "OutputLabelValue", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--OutputLabelValue %s", + "help_string": "List of label values for which SUV values were computed", + }, + ), + ), + ( + "SUVMax", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--SUVMax %s", + "help_string": "SUV max for each label", + }, + ), + ), + ( + "SUVMean", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--SUVMean %s", + "help_string": "SUV mean for each label", + }, + ), + ), + ( + "SUVMin", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--SUVMin %s", + "help_string": "SUV minimum for each label", + }, + ), + ), + ] + output_fields = [ + ( + "csvFile", + attr.ib( + type=File, + metadata={ + "help_string": "A table holding the output SUV values in comma separated lines, one per label. Optional.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="PETStandardUptakeValueComputation", + executable=" PETStandardUptakeValueComputation ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/registration/__init__.py b/pydra/tasks/sem/registration/__init__.py new file mode 100644 index 0000000..ab74afb --- /dev/null +++ b/pydra/tasks/sem/registration/__init__.py @@ -0,0 +1,9 @@ +from specialized import ( + ACPCTransform, + BRAINSTransformFromFiducials, + FiducialRegistration, +) +from brainsfit import BRAINSFit +from brainsresample import BRAINSResample +from brainsresize import BRAINSResize +from performmetrictest import PerformMetricTest diff --git a/pydra/tasks/sem/registration/brainsfit.py b/pydra/tasks/sem/registration/brainsfit.py new file mode 100644 index 0000000..eebf3a6 --- /dev/null +++ b/pydra/tasks/sem/registration/brainsfit.py @@ -0,0 +1,797 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSFit: + """ + title: General Registration (BRAINS) + category: Registration + description: Register a three-dimensional volume to a reference volume (Mattes Mutual Information by default). Full documentation avalable here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSFit. Method described in BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit, Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. http://hdl.handle.net/1926/1291 + version: 5.2.0 + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSFit + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Hans J. Johnson (hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu), Ali Ghayoor + acknowledgements: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3); Andriy Fedorov(5); Ali Ghayoor(4) 1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard + """ + + input_fields = [ + ( + "fixedVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--fixedVolume %s", + "help_string": "Input fixed image (the moving image will be transformed into this image space).", + "exists": "True", + }, + ), + ), + ( + "movingVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--movingVolume %s", + "help_string": "Input moving image (this image will be transformed into the fixed image space).", + "exists": "True", + }, + ), + ), + ( + "samplingPercentage", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--samplingPercentage %f", + "help_string": "Fraction of voxels of the fixed image that will be used for registration. The number has to be larger than zero and less or equal to one. Higher values increase the computation time but may give more accurate results. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. The default is 0.002 (use approximately 0.2% of voxels, resulting in 100000 samples in a 512x512x192 volume) to provide a very fast registration in most cases. Typical values range from 0.01 (1%) for low detail images to 0.2 (20%) for high detail images.", + }, + ), + ), + ( + "splineGridSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--splineGridSize %s", + "help_string": "Number of BSpline grid subdivisions along each axis of the fixed image, centered on the image space. Values must be 3 or higher for the BSpline to be correctly computed.", + "sep": ",", + }, + ), + ), + ( + "linearTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--linearTransform %s", + "help_string": "(optional) Output estimated transform - in case the computed transform is not BSpline. NOTE: You must set at least one output object (transform and/or output volume).", + "hash_files": "False", + }, + ), + ), + ( + "bsplineTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--bsplineTransform %s", + "help_string": "(optional) Output estimated transform - in case the computed transform is BSpline. NOTE: You must set at least one output object (transform and/or output volume).", + "hash_files": "False", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "(optional) Output image: the moving image warped to the fixed image space. NOTE: You must set at least one output object (transform and/or output volume).", + "hash_files": "False", + }, + ), + ), + ( + "initialTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--initialTransform %s", + "help_string": "Transform to be applied to the moving image to initialize the registration. This can only be used if Initialize Transform Mode is Off.", + "exists": "True", + }, + ), + ), + ( + "initializeTransformMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--initializeTransformMode %s", + "help_string": "Determine how to initialize the transform center. useMomentsAlign assumes that the center of mass of the images represent similar structures. useCenterOfHeadAlign attempts to use the top of head and shape of neck to drive a center of mass estimate. useGeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Off assumes that the physical space of the images are close. This flag is mutually exclusive with the Initialization transform.", + }, + ), + ), + ( + "useRigid", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useRigid ", + "help_string": "Perform a rigid registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set.", + }, + ), + ), + ( + "useScaleVersor3D", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useScaleVersor3D ", + "help_string": "Perform a ScaleVersor3D registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set.", + }, + ), + ), + ( + "useScaleSkewVersor3D", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useScaleSkewVersor3D ", + "help_string": "Perform a ScaleSkewVersor3D registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set.", + }, + ), + ), + ( + "useAffine", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useAffine ", + "help_string": "Perform an Affine registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set.", + }, + ), + ), + ( + "useBSpline", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useBSpline ", + "help_string": "Perform a BSpline registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set.", + }, + ), + ), + ( + "useSyN", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useSyN ", + "help_string": "Perform a SyN registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set.", + }, + ), + ), + ( + "useComposite", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useComposite ", + "help_string": "Perform a Composite registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set.", + }, + ), + ), + ( + "maskProcessingMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--maskProcessingMode %s", + "help_string": "Specifies a mask to only consider a certain image region for the registration. If ROIAUTO is chosen, then the mask is computed using Otsu thresholding and hole filling. If ROI is chosen then the mask has to be specified as in input.", + }, + ), + ), + ( + "fixedBinaryVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--fixedBinaryVolume %s", + "help_string": "Fixed Image binary mask volume, required if Masking Option is ROI. Image areas where the mask volume has zero value are ignored during the registration.", + "exists": "True", + }, + ), + ), + ( + "movingBinaryVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--movingBinaryVolume %s", + "help_string": "Moving Image binary mask volume, required if Masking Option is ROI. Image areas where the mask volume has zero value are ignored during the registration.", + "exists": "True", + }, + ), + ), + ( + "outputFixedVolumeROI", + attr.ib( + type=File, + metadata={ + "argstr": "--outputFixedVolumeROI %s", + "help_string": "ROI that is automatically computed from the fixed image. Only available if Masking Option is ROIAUTO. Image areas where the mask volume has zero value are ignored during the registration.", + "hash_files": "False", + }, + ), + ), + ( + "outputMovingVolumeROI", + attr.ib( + type=File, + metadata={ + "argstr": "--outputMovingVolumeROI %s", + "help_string": "ROI that is automatically computed from the moving image. Only available if Masking Option is ROIAUTO. Image areas where the mask volume has zero value are ignored during the registration.", + "hash_files": "False", + }, + ), + ), + ( + "useROIBSpline", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useROIBSpline ", + "help_string": "If enabled then the bounding box of the input ROIs defines the BSpline grid support region. Otherwise the BSpline grid support region is the whole fixed image.", + }, + ), + ), + ( + "histogramMatch", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--histogramMatch ", + "help_string": "Apply histogram matching operation for the input images to make them more similar. This is suitable for images of the same modality that may have different brightness or contrast, but the same overall intensity profile. Do NOT use if registering images from different modalities.", + }, + ), + ), + ( + "medianFilterSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--medianFilterSize %s", + "help_string": "Apply median filtering to reduce noise in the input volumes. The 3 values specify the radius for the optional MedianImageFilter preprocessing in all 3 directions (in voxels).", + "sep": ",", + }, + ), + ), + ( + "removeIntensityOutliers", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--removeIntensityOutliers %f", + "help_string": "Remove very high and very low intensity voxels from the input volumes. The parameter specifies the half percentage to decide outliers of image intensities. The default value is zero, which means no outlier removal. If the value of 0.005 is given, the 0.005% of both tails will be thrown away, so 0.01% of intensities in total would be ignored in the statistic calculation.", + }, + ), + ), + ( + "fixedVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "--fixedVolume2 %s", + "help_string": "Input fixed image that will be used for multimodal registration. (the moving image will be transformed into this image space).", + "exists": "True", + }, + ), + ), + ( + "movingVolume2", + attr.ib( + type=File, + metadata={ + "argstr": "--movingVolume2 %s", + "help_string": "Input moving image that will be used for multimodal registration(this image will be transformed into the fixed image space).", + "exists": "True", + }, + ), + ), + ( + "outputVolumePixelType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--outputVolumePixelType %s", + "help_string": "Data type for representing a voxel of the Output Volume.", + }, + ), + ), + ( + "backgroundFillValue", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--backgroundFillValue %f", + "help_string": "This value will be used for filling those areas of the output image that have no corresponding voxels in the input moving image.", + }, + ), + ), + ( + "scaleOutputValues", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--scaleOutputValues ", + "help_string": "If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType.", + }, + ), + ), + ( + "interpolationMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolationMode %s", + "help_string": "Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, Hamming, Cosine, Welch, Lanczos, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation.", + }, + ), + ), + ( + "numberOfIterations", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--numberOfIterations %s", + "help_string": "The maximum number of iterations to try before stopping the optimization. When using a lower value (500-1000) then the registration is forced to terminate earlier but there is a higher risk of stopping before an optimal solution is reached.", + "sep": ",", + }, + ), + ), + ( + "maximumStepLength", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maximumStepLength %f", + "help_string": "Starting step length of the optimizer. In general, higher values allow for recovering larger initial misalignments but there is an increased chance that the registration will not converge.", + }, + ), + ), + ( + "minimumStepLength", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--minimumStepLength %s", + "help_string": "Each step in the optimization takes steps at least this big. When none are possible, registration is complete. Smaller values allows the optimizer to make smaller adjustments, but the registration time may increase.", + "sep": ",", + }, + ), + ), + ( + "relaxationFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--relaxationFactor %f", + "help_string": "Specifies how quickly the optimization step length is decreased during registration. The value must be larger than 0 and smaller than 1. Larger values result in slower step size decrease, which allow for recovering larger initial misalignments but it increases the registration time and the chance that the registration will not converge.", + }, + ), + ), + ( + "translationScale", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--translationScale %f", + "help_string": "How much to scale up changes in position (in mm) compared to unit rotational changes (in radians) -- decrease this to allow for more rotation in the search pattern.", + }, + ), + ), + ( + "reproportionScale", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--reproportionScale %f", + "help_string": "ScaleVersor3D 'Scale' compensation factor. Increase this to allow for more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern. 1.0 works well with a translationScale of 1000.0", + }, + ), + ), + ( + "skewScale", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--skewScale %f", + "help_string": "ScaleSkewVersor3D Skew compensation factor. Increase this to allow for more skew in a ScaleSkewVersor3D search pattern. 1.0 works well with a translationScale of 1000.0", + }, + ), + ), + ( + "maxBSplineDisplacement", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maxBSplineDisplacement %f", + "help_string": "Maximum allowed displacements in image physical coordinates (mm) 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., ", + }, + ), + ), + ( + "fixedVolumeTimeIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--fixedVolumeTimeIndex %d", + "help_string": "The index in the time series for the 3D fixed image to fit. Only allowed if the fixed input volume is 4-dimensional.", + }, + ), + ), + ( + "movingVolumeTimeIndex", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--movingVolumeTimeIndex %d", + "help_string": "The index in the time series for the 3D moving image to fit. Only allowed if the moving input volume is 4-dimensional", + }, + ), + ), + ( + "numberOfHistogramBins", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfHistogramBins %d", + "help_string": "The number of histogram levels used for mutual information metric estimation.", + }, + ), + ), + ( + "numberOfMatchPoints", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfMatchPoints %d", + "help_string": "Number of histogram match points used for mutual information metric estimation.", + }, + ), + ), + ( + "costMetric", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--costMetric %s", + "help_string": "The cost metric to be used during fitting. Defaults to MMI. Options are MMI (Mattes Mutual Information), MSE (Mean Square Error), NC (Normalized Correlation), MC (Match Cardinality for binary images)", + }, + ), + ), + ( + "maskInferiorCutOffFromCenter", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maskInferiorCutOffFromCenter %f", + "help_string": "If Initialize Transform Mode is set to useCenterOfHeadAlign or Masking Option is ROIAUTO then this value defines the how much is cut of from the inferior part of the image. The cut-off distance is specified in millimeters, relative to the image center. If the value is 1000 or larger then no cut-off performed.", + }, + ), + ), + ( + "ROIAutoDilateSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--ROIAutoDilateSize %f", + "help_string": "This flag is only relevant when using ROIAUTO mode for initializing masks. It defines the final dilation size to capture a bit of background outside the tissue region. A setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.", + }, + ), + ), + ( + "ROIAutoClosingSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--ROIAutoClosingSize %f", + "help_string": "This flag is only relevant when using ROIAUTO mode for initializing masks. It defines the hole closing size in mm. It is rounded up to the nearest whole pixel size in each direction. The default is to use a closing size of 9mm. For mouse data this value may need to be reset to 0.9 or smaller.", + }, + ), + ), + ( + "numberOfSamples", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfSamples %d", + "help_string": "The number of voxels sampled for mutual information computation. Increase this for higher accuracy, at the cost of longer computation time.\nNOTE that it is suggested to use samplingPercentage instead of this option. However, if set to non-zero, numberOfSamples overwrites the samplingPercentage option. ", + }, + ), + ), + ( + "strippedOutputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--strippedOutputTransform %s", + "help_string": "Rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE: This value is overridden if either bsplineTransform or linearTransform is set.", + "hash_files": "False", + }, + ), + ), + ( + "transformType", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--transformType %s", + "help_string": "Specifies a list of registration types to be used. The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, BSpline and SyN. Specifying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.", + "sep": ",", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransform %s", + "help_string": "(optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.", + "hash_files": "False", + }, + ), + ), + ( + "initializeRegistrationByCurrentGenericTransform", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--initializeRegistrationByCurrentGenericTransform ", + "help_string": "If this flag is ON, the current generic composite transform, resulted from the linear registration stages, is set to initialize the follow nonlinear registration process. However, by the default behaviour, the moving image is first warped based on the existant transform before it is passed to the BSpline registration filter. It is done to speed up the BSpline registration by reducing the computations of composite transform Jacobian.", + }, + ), + ), + ( + "writeOutputTransformInFloat", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeOutputTransformInFloat ", + "help_string": "By default, the output registration transforms (either the output composite transform or each transform component) are written to the disk in double precision. If this flag is ON, the output transforms will be written in single (float) precision. It is especially important if the output transform is a displacement field transform, or it is a composite transform that includes several displacement fields.", + }, + ), + ), + ( + "failureExitCode", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--failureExitCode %d", + "help_string": "If the fit fails, exit with this status code. (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations.", + }, + ), + ), + ( + "writeTransformOnFailure", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeTransformOnFailure ", + "help_string": "Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 )", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use. (default is auto-detected)", + }, + ), + ), + ( + "debugLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--debugLevel %d", + "help_string": "Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.", + }, + ), + ), + ( + "costFunctionConvergenceFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--costFunctionConvergenceFactor %f", + "help_string": "From itkLBFGSBOptimizer.h: Set/Get the CostFunctionConvergenceFactor. Algorithm terminates when the reduction in cost function is less than (factor * epsmcj) where epsmch is the machine precision. Typical values for factor: 1e+12 for low accuracy; 1e+7 for moderate accuracy and 1e+1 for extremely high accuracy. 1e+9 seems to work well., ", + }, + ), + ), + ( + "projectedGradientTolerance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--projectedGradientTolerance %f", + "help_string": "From itkLBFGSBOptimizer.h: Set/Get the ProjectedGradientTolerance. Algorithm terminates when the project gradient is below the tolerance. Default lbfgsb value is 1e-5, but 1e-4 seems to work well., ", + }, + ), + ), + ( + "maximumNumberOfEvaluations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--maximumNumberOfEvaluations %d", + "help_string": "Maximum number of evaluations for line search in lbfgsb optimizer.", + }, + ), + ), + ( + "maximumNumberOfCorrections", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--maximumNumberOfCorrections %d", + "help_string": "Maximum number of corrections in lbfgsb optimizer.", + }, + ), + ), + ( + "gui", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--gui ", + "help_string": "Display intermediate image volumes for debugging. NOTE: This is not part of the standard build sytem, and probably does nothing on your installation.", + }, + ), + ), + ( + "promptUser", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--promptUser ", + "help_string": "Prompt the user to hit enter each time an image is sent to the DebugImageViewer", + }, + ), + ), + ( + "metricSamplingStrategy", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--metricSamplingStrategy %s", + "help_string": "It defines the method that registration filter uses to sample the input fixed image. Only Random is supported for now.", + }, + ), + ), + ( + "logFileReport", + attr.ib( + type=File, + metadata={ + "argstr": "--logFileReport %s", + "help_string": "A file to write out final information report in CSV file: MetricName,MetricValue,FixedImageName,FixedMaskName,MovingImageName,MovingMaskName", + "hash_files": "False", + }, + ), + ), + ( + "printVersionInfo", + attr.ib(type=traits.Bool, metadata={"argstr": "--printVersionInfo "}), + ), + ] + output_fields = [ + ( + "linearTransform", + attr.ib( + type=File, + metadata={ + "help_string": "(optional) Output estimated transform - in case the computed transform is not BSpline. NOTE: You must set at least one output object (transform and/or output volume).", + "exists": "True", + }, + ), + ), + ( + "bsplineTransform", + attr.ib( + type=File, + metadata={ + "help_string": "(optional) Output estimated transform - in case the computed transform is BSpline. NOTE: You must set at least one output object (transform and/or output volume).", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "(optional) Output image: the moving image warped to the fixed image space. NOTE: You must set at least one output object (transform and/or output volume).", + "exists": "True", + }, + ), + ), + ( + "outputFixedVolumeROI", + attr.ib( + type=File, + metadata={ + "help_string": "ROI that is automatically computed from the fixed image. Only available if Masking Option is ROIAUTO. Image areas where the mask volume has zero value are ignored during the registration.", + "exists": "True", + }, + ), + ), + ( + "outputMovingVolumeROI", + attr.ib( + type=File, + metadata={ + "help_string": "ROI that is automatically computed from the moving image. Only available if Masking Option is ROIAUTO. Image areas where the mask volume has zero value are ignored during the registration.", + "exists": "True", + }, + ), + ), + ( + "strippedOutputTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE: This value is overridden if either bsplineTransform or linearTransform is set.", + "exists": "True", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "help_string": "(optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option.", + "exists": "True", + }, + ), + ), + ( + "logFileReport", + attr.ib( + type=File, + metadata={ + "help_string": "A file to write out final information report in CSV file: MetricName,MetricValue,FixedImageName,FixedMaskName,MovingImageName,MovingMaskName", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSFit", + executable=" BRAINSFit ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/registration/brainsresample.py b/pydra/tasks/sem/registration/brainsresample.py new file mode 100644 index 0000000..e59d009 --- /dev/null +++ b/pydra/tasks/sem/registration/brainsresample.py @@ -0,0 +1,166 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSResample: + """ + title: Resample Image (BRAINS) + category: Registration + description: This program collects together three common image processing tasks that all involve resampling an image volume: Resampling to a new resolution and spacing, applying a transformation (using an ITK transform IO mechanisms) and Warping (using a vector image deformation field). Full documentation available here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSResample. + version: 5.2.0 + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSResample + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: This tool was developed by Vincent Magnotta, Greg Harris, and Hans Johnson. + acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Image To Warp", + "exists": "True", + }, + ), + ), + ( + "referenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--referenceVolume %s", + "help_string": "Reference image used only to define the output space. If not specified, the warping is done in the same space as the image to warp.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Resulting deformed image", + "hash_files": "False", + }, + ), + ), + ( + "pixelType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--pixelType %s", + "help_string": "Specifies the pixel type for the input/output images. The 'binary' pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk.", + }, + ), + ), + ( + "deformationVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--deformationVolume %s", + "help_string": "Displacement Field to be used to warp the image (ITKv3 or earlier)", + "exists": "True", + }, + ), + ), + ( + "warpTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--warpTransform %s", + "help_string": "Filename for the BRAINSFit transform (ITKv3 or earlier) or composite transform file (ITKv4)", + "exists": "True", + }, + ), + ), + ( + "interpolationMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolationMode %s", + "help_string": "Type of interpolation to be used when applying transform to moving volume. Options are Linear, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc", + }, + ), + ), + ( + "inverseTransform", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--inverseTransform ", + "help_string": "True/False is to compute inverse of given transformation. Default is false", + }, + ), + ), + ( + "defaultValue", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--defaultValue %f", + "help_string": "Default voxel value", + }, + ), + ), + ( + "gridSpacing", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--gridSpacing %s", + "help_string": "Add warped grid to output image to help show the deformation that occured with specified spacing. A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane). This is useful for makeing a 2D image of grid lines from the 3D space", + "sep": ",", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={"help_string": "Resulting deformed image", "exists": "True"}, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSResample", + executable=" BRAINSResample ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/registration/brainsresize.py b/pydra/tasks/sem/registration/brainsresize.py new file mode 100644 index 0000000..9011c6e --- /dev/null +++ b/pydra/tasks/sem/registration/brainsresize.py @@ -0,0 +1,91 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSResize: + """ + title: Resize Image (BRAINS) + category: Registration + description: This program is useful for downsampling an image by a constant scale factor. + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: This tool was developed by Hans Johnson. + acknowledgements: The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Image To Scale", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Resulting scaled image", + "hash_files": "False", + }, + ), + ), + ( + "pixelType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--pixelType %s", + "help_string": "Specifies the pixel type for the input/output images. The 'binary' pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk.", + }, + ), + ), + ( + "scaleFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--scaleFactor %f", + "help_string": "The scale factor for the image spacing.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={"help_string": "Resulting scaled image", "exists": "True"}, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSResize", + executable=" BRAINSResize ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/registration/performmetrictest.py b/pydra/tasks/sem/registration/performmetrictest.py new file mode 100644 index 0000000..1ee0510 --- /dev/null +++ b/pydra/tasks/sem/registration/performmetrictest.py @@ -0,0 +1,95 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class PerformMetricTest: + """ + title: Metric Test + category: Registration + description: Compare Mattes/MSQ metric value for two input images and a possible input BSpline transform. + version: 5.2.0 + documentation-url: A utility to compare metric value between two input images. + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputBSplineTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--inputBSplineTransform %s", + "help_string": ", Input transform that is use to warp moving image before metric comparison., ", + "exists": "True", + }, + ), + ), + ( + "inputFixedImage", + attr.ib( + type=File, metadata={"argstr": "--inputFixedImage %s", "exists": "True"} + ), + ), + ( + "inputMovingImage", + attr.ib( + type=File, + metadata={"argstr": "--inputMovingImage %s", "exists": "True"}, + ), + ), + ( + "metricType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--metricType %s", + "help_string": "Comparison metric type", + }, + ), + ), + ( + "numberOfSamples", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfSamples %d", + "help_string": "The number of voxels sampled for metric evaluation.", + }, + ), + ), + ( + "numberOfHistogramBins", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfHistogramBins %d", + "help_string": "The number of historgram bins when MMI (Mattes) is metric type.", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="PerformMetricTest", + executable=" PerformMetricTest ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/registration/specialized.py b/pydra/tasks/sem/registration/specialized.py new file mode 100644 index 0000000..1953d6f --- /dev/null +++ b/pydra/tasks/sem/registration/specialized.py @@ -0,0 +1,289 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class ACPCTransform: + """ + title: ACPC Transform + category: Registration.Specialized + description:

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.

+ version: 1.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ACPCTransform + license: slicer3 + contributor: Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "acpc", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--acpc %s...", + "help_string": "ACPC line, a list of two fiducial points, one at the anterior commissure and one at the posterior commissure.", + }, + ), + ), + ( + "midline", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--midline %s...", + "help_string": "The midline is a series of points (at least 3) defining the division between the hemispheres of the brain (the mid sagittal plane).", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransform %s", + "help_string": "A transform filled in from the ACPC and Midline registration calculation.", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "help_string": "A transform filled in from the ACPC and Midline registration calculation.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ACPCTransform", + executable=" ACPCTransform ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSTransformFromFiducials: + """ + title: Fiducial Registration (BRAINS) + category: Registration.Specialized + description: Computes a rigid, similarity or affine transform from a matched list of fiducials + version: 5.2.0 + documentation-url: http://www.slicer.org/slicerWiki/index.php/Modules:TransformFromFiducials-Documentation-3.6 + contributor: Casey B Goodlett + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "fixedLandmarks", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--fixedLandmarks %s...", + "help_string": "Ordered list of landmarks in the fixed image", + }, + ), + ), + ( + "movingLandmarks", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--movingLandmarks %s...", + "help_string": "Ordered list of landmarks in the moving image", + }, + ), + ), + ( + "saveTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--saveTransform %s", + "help_string": "Save the transform that results from registration", + "hash_files": "False", + }, + ), + ), + ( + "transformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transformType %s", + "help_string": "Type of transform to produce", + }, + ), + ), + ( + "fixedLandmarksFile", + attr.ib( + type=File, + metadata={ + "argstr": "--fixedLandmarksFile %s", + "help_string": "An fcsv formatted file with a list of landmark points.", + "exists": "True", + }, + ), + ), + ( + "movingLandmarksFile", + attr.ib( + type=File, + metadata={ + "argstr": "--movingLandmarksFile %s", + "help_string": "An fcsv formatted file with a list of landmark points.", + "exists": "True", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "saveTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Save the transform that results from registration", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSTransformFromFiducials", + executable=" BRAINSTransformFromFiducials ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class FiducialRegistration: + """ + title: Fiducial Registration + category: Registration.Specialized + description: Computes a rigid, similarity or affine transform from a matched list of fiducials + version: 0.1.0.$Revision$ + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/TransformFromFiducials + contributor: Casey B Goodlett (Kitware), Dominik Meier (SPL, BWH) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "fixedLandmarks", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--fixedLandmarks %s...", + "help_string": "Ordered list of landmarks in the fixed image", + }, + ), + ), + ( + "movingLandmarks", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--movingLandmarks %s...", + "help_string": "Ordered list of landmarks in the moving image", + }, + ), + ), + ( + "saveTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--saveTransform %s", + "help_string": "Save the transform that results from registration", + "hash_files": "False", + }, + ), + ), + ( + "transformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--transformType %s", + "help_string": "Type of transform to produce", + }, + ), + ), + ( + "rms", + attr.ib( + type=traits.Float, + metadata={"argstr": "--rms %f", "help_string": "Display RMS Error."}, + ), + ), + ( + "outputMessage", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--outputMessage %s", + "help_string": "Provides more information on the output", + }, + ), + ), + ] + output_fields = [ + ( + "saveTransform", + attr.ib( + type=File, + metadata={ + "help_string": "Save the transform that results from registration", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="FiducialRegistration", + executable=" FiducialRegistration ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/segmentation/__init__.py b/pydra/tasks/sem/segmentation/__init__.py new file mode 100644 index 0000000..b8eb0eb --- /dev/null +++ b/pydra/tasks/sem/segmentation/__init__.py @@ -0,0 +1,13 @@ +from specialized import ( + BRAINSABC, + BRAINSCleanMask, + BRAINSConstellationDetector, + BRAINSCreateLabelMapFromProbabilityMaps, + BRAINSMultiSTAPLE, + BRAINSROIAuto, + BinaryMaskEditorBasedOnLandmarks, + ESLR, + RobustStatisticsSegmenter, + simpleEM, +) +from simpleregiongrowingsegmentation import SimpleRegionGrowingSegmentation diff --git a/pydra/tasks/sem/segmentation/simpleregiongrowingsegmentation.py b/pydra/tasks/sem/segmentation/simpleregiongrowingsegmentation.py new file mode 100644 index 0000000..1a2c5d0 --- /dev/null +++ b/pydra/tasks/sem/segmentation/simpleregiongrowingsegmentation.py @@ -0,0 +1,147 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class SimpleRegionGrowingSegmentation: + """ + title: Simple Region Growing Segmentation + category: Segmentation + description: A simple region growing segmentation algorithm based on intensity statistics. To create a list of fiducials (Seeds) for this algorithm, click on the tool bar icon of an arrow pointing to a sphere fiducial to enter the 'place a new object mode' and then use the Markups module. This module uses the Slicer Command Line Interface (CLI) and the ITK filters CurvatureFlowImageFilter and ConfidenceConnectedImageFilter. + version: 0.1.0.$Revision$(alpha) + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/SimpleRegionGrowingSegmentation + contributor: Jim Miller (GE) + acknowledgements: This command module was derived from Insight/Examples (copyright) Insight Software Consortium + """ + + input_fields = [ + ( + "smoothingIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--smoothingIterations %d", + "help_string": "Number of smoothing iterations", + }, + ), + ), + ( + "timestep", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--timestep %f", + "help_string": "Timestep for curvature flow", + }, + ), + ), + ( + "iterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--iterations %d", + "help_string": "Number of iterations of region growing", + }, + ), + ), + ( + "multiplier", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--multiplier %f", + "help_string": "Number of standard deviations to include in intensity model", + }, + ), + ), + ( + "neighborhood", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--neighborhood %d", + "help_string": "The radius of the neighborhood over which to calculate intensity model", + }, + ), + ), + ( + "labelvalue", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--labelvalue %d", + "help_string": "The integer value (0-255) to use for the segmentation results. This will determine the color of the segmentation that will be generated by the Region growing algorithm", + }, + ), + ), + ( + "seed", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--seed %s...", + "help_string": "Seed point(s) for region growing", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input volume to be filtered", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output filtered", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output filtered", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="SimpleRegionGrowingSegmentation", + executable=" SimpleRegionGrowingSegmentation ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/segmentation/specialized.py b/pydra/tasks/sem/segmentation/specialized.py new file mode 100644 index 0000000..4bcc2ba --- /dev/null +++ b/pydra/tasks/sem/segmentation/specialized.py @@ -0,0 +1,1941 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSABC: + """ + title: Intra-subject registration, bias Correction, and tissue classification (BRAINS) + category: Segmentation.Specialized + description: Atlas-based tissue segmentation method. This is an algorithmic extension of work done by XXXX at UNC and Utah XXXX need more description here. + """ + + input_fields = [ + ( + "inputVolumes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputVolumes %s...", + "help_string": "The list of input image files to be segmented.", + }, + ), + ), + ( + "atlasDefinition", + attr.ib( + type=File, + metadata={ + "argstr": "--atlasDefinition %s", + "help_string": "Contains all parameters for Atlas", + "exists": "True", + }, + ), + ), + ( + "restoreState", + attr.ib( + type=File, + metadata={ + "argstr": "--restoreState %s", + "help_string": "The initial state for the registration process", + "exists": "True", + }, + ), + ), + ( + "saveState", + attr.ib( + type=File, + metadata={ + "argstr": "--saveState %s", + "help_string": "(optional) Filename to which save the final state of the registration", + "hash_files": "False", + }, + ), + ), + ( + "inputVolumeTypes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputVolumeTypes %s", + "help_string": "The list of input image types corresponding to the inputVolumes.", + "sep": ",", + }, + ), + ), + ( + "outputDir", + attr.ib( + type=Directory, + metadata={ + "argstr": "--outputDir %s", + "help_string": "Ouput directory", + "hash_files": "False", + }, + ), + ), + ( + "atlasToSubjectTransformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--atlasToSubjectTransformType %s", + "help_string": " What type of linear transform type do you want to use to register the atlas to the reference subject image.", + }, + ), + ), + ( + "atlasToSubjectTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--atlasToSubjectTransform %s", + "help_string": "The transform from atlas to the subject", + "hash_files": "False", + }, + ), + ), + ( + "atlasToSubjectInitialTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--atlasToSubjectInitialTransform %s", + "help_string": "The initial transform from atlas to the subject", + "hash_files": "False", + }, + ), + ), + ( + "subjectIntermodeTransformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--subjectIntermodeTransformType %s", + "help_string": " What type of transform type do you want to run intra subject registeration. Only Identity and Rigid are allowed.", + }, + ), + ), + ( + "outputVolumes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--outputVolumes %s...", + "help_string": "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location.", + "hash_files": "False", + }, + ), + ), + ( + "outputLabels", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLabels %s", + "help_string": "Output Label Image", + "hash_files": "False", + }, + ), + ), + ( + "outputDirtyLabels", + attr.ib( + type=File, + metadata={ + "argstr": "--outputDirtyLabels %s", + "help_string": "Output Dirty Label Image", + "hash_files": "False", + }, + ), + ), + ( + "posteriorTemplate", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--posteriorTemplate %s", + "help_string": "filename template for Posterior output files", + }, + ), + ), + ( + "outputFormat", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--outputFormat %s", + "help_string": "Output format", + }, + ), + ), + ( + "interpolationMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolationMode %s", + "help_string": "Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation.", + }, + ), + ), + ( + "maxIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--maxIterations %d", + "help_string": "Filter iterations", + }, + ), + ), + ( + "medianFilterSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--medianFilterSize %s", + "help_string": "The radius for the optional MedianImageFilter preprocessing in all 3 directions.", + "sep": ",", + }, + ), + ), + ( + "filterIteration", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--filterIteration %d", + "help_string": "Filter iterations", + }, + ), + ), + ( + "filterTimeStep", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--filterTimeStep %f", + "help_string": "Filter time step should be less than (PixelSpacing/(1^(DIM+1)), value is set to negative, then allow automatic setting of this value. ", + }, + ), + ), + ( + "filterMethod", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--filterMethod %s", + "help_string": "Filter method for preprocessing of registration", + }, + ), + ), + ( + "maxBiasDegree", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--maxBiasDegree %d", + "help_string": "Maximum bias degree", + }, + ), + ), + ( + "useKNN", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--useKNN ", + "help_string": "Use the KNN stage of estimating posteriors.", + }, + ), + ), + ( + "purePlugsThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--purePlugsThreshold %f", + "help_string": "If this threshold value is greater than zero, only pure samples are used to compute the distributions in EM classification, and only pure samples are used for KNN training. The default value is set to 0, that means not using pure plugs. However, a value between 0 and 1 should be set as the threshold if you want to activate using pure plugs option. Empirically a value of 0.1 is suggested.", + }, + ), + ), + ( + "numberOfSubSamplesInEachPlugArea", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--numberOfSubSamplesInEachPlugArea %s", + "help_string": "Number of continous index samples taken at each direction of lattice space for each plug volume.", + "sep": ",", + }, + ), + ), + ( + "atlasWarpingOff", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--atlasWarpingOff ", + "help_string": "Deformable registration of atlas to subject", + }, + ), + ), + ( + "gridSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--gridSize %s", + "help_string": "Grid size for atlas warping with BSplines", + "sep": ",", + }, + ), + ), + ( + "defaultSuffix", + attr.ib(type=traits.Str, metadata={"argstr": "--defaultSuffix %s"}), + ), + ( + "implicitOutputs", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--implicitOutputs %s...", + "help_string": "Outputs to be made available to NiPype. Needed because not all BRAINSABC outputs have command line arguments.", + "hash_files": "False", + }, + ), + ), + ( + "debuglevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--debuglevel %d", + "help_string": "Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.", + }, + ), + ), + ( + "writeLess", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--writeLess ", + "help_string": "Does not write posteriors and filtered, bias corrected images", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "saveState", + attr.ib( + type=File, + metadata={ + "help_string": "(optional) Filename to which save the final state of the registration", + "exists": "True", + }, + ), + ), + ( + "outputDir", + attr.ib( + type=Directory, + metadata={"help_string": "Ouput directory", "exists": "True"}, + ), + ), + ( + "atlasToSubjectTransform", + attr.ib( + type=File, + metadata={ + "help_string": "The transform from atlas to the subject", + "exists": "True", + }, + ), + ), + ( + "atlasToSubjectInitialTransform", + attr.ib( + type=File, + metadata={ + "help_string": "The initial transform from atlas to the subject", + "exists": "True", + }, + ), + ), + ( + "outputVolumes", + attr.ib( + type=OutputMultiPath, + metadata={ + "help_string": "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location.", + "exists": "True", + }, + ), + ), + ( + "outputLabels", + attr.ib( + type=File, + metadata={"help_string": "Output Label Image", "exists": "True"}, + ), + ), + ( + "outputDirtyLabels", + attr.ib( + type=File, + metadata={"help_string": "Output Dirty Label Image", "exists": "True"}, + ), + ), + ( + "implicitOutputs", + attr.ib( + type=OutputMultiPath, + metadata={ + "help_string": "Outputs to be made available to NiPype. Needed because not all BRAINSABC outputs have command line arguments.", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSABC", + executable=" BRAINSABC ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSCleanMask: + """ + title: Mask Hole Filling (BRAINS) + category: Segmentation.Specialized + description: Cleans up a mask image by filling any holes + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "The mask image to be cleaned up.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "The cleaned mask image.", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={"help_string": "The cleaned mask image.", "exists": "True"}, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSCleanMask", + executable=" BRAINSCleanMask ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSConstellationDetector: + """ + title: Brain Landmark Constellation Detector (BRAINS) + category: Segmentation.Specialized + description: This program will find the mid-sagittal plane, a constellation of landmarks in a volume, and create an AC/PC aligned data set with the AC point at the center of the voxel lattice (labeled at the origin of the image physical space.) Part of this work is an extention of the algorithms originally described by Dr. Babak A. Ardekani, Alvin H. Bachman, Model-based automatic detection of the anterior and posterior commissures on MRI scans, NeuroImage, Volume 46, Issue 3, 1 July 2009, Pages 677-682, ISSN 1053-8119, DOI: 10.1016/j.neuroimage.2009.02.030. (http://www.sciencedirect.com/science/article/B6WNP-4VRP25C-4/2/8207b962a38aa83c822c6379bc43fe4c) + version: 5.2.0 + documentation-url: http://www.nitrc.org/projects/brainscdetector/ + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Hans J. Johnson (hans-johnson -at- uiowa.edu), Ali Ghayoor + acknowledgements: Hans Johnson(1,2,3); Ali Ghayoor(3); Wei Lu(3) 1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Biomedical Engineering, 3=University of Iowa Department of Electrical and Computer Engineering + """ + + input_fields = [ + ( + "houghEyeDetectorMode", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--houghEyeDetectorMode %d", + "help_string": ", This flag controls the mode of Hough eye detector. By default, value of 1 is for T1W images, while the value of 0 is for T2W and PD images., ", + }, + ), + ), + ( + "inputTemplateModel", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTemplateModel %s", + "help_string": "User-specified template model., ", + "exists": "True", + }, + ), + ), + ( + "LLSModel", + attr.ib( + type=File, + metadata={ + "argstr": "--LLSModel %s", + "help_string": "Linear least squares model filename in HD5 format", + "exists": "True", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input image in which to find ACPC points", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "ACPC-aligned output image with the same voxels as the input image, but updated origin, and direction cosign so that the AC point would fall at the physical location (0.0,0.0,0.0), and the mid-sagital plane is the plane where physical L/R coordinate is 0.0. No interpolation method is involved to create the 'outputVolume', and this output image is created using 'resample in place' filter.", + "hash_files": "False", + }, + ), + ), + ( + "outputResampledVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputResampledVolume %s", + "help_string": "ACPC-aligned output image in a resampled uniform isotropic space. Currently this is a 1mm, 256^3 image with identity direction cosign. Choose desired interpolation mode to generate the outputResampledVolume.", + "hash_files": "False", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransform %s", + "help_string": "The filename for the original space to ACPC alignment to be written (in .h5 format)., ", + "hash_files": "False", + }, + ), + ), + ( + "outputLandmarksInInputSpace", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLandmarksInInputSpace %s", + "help_string": ", The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (.fcsv) with the landmarks in the original image space (the detected RP, AC, PC, and VN4) in it to be written., ", + "hash_files": "False", + }, + ), + ), + ( + "outputLandmarksInACPCAlignedSpace", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLandmarksInACPCAlignedSpace %s", + "help_string": ", The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (.fcsv) with the landmarks in the output image space (the detected RP, AC, PC, and VN4) in it to be written., ", + "hash_files": "False", + }, + ), + ), + ( + "outputMRML", + attr.ib( + type=File, + metadata={ + "argstr": "--outputMRML %s", + "help_string": ", The filename for the new subject-specific scene definition file in the same format produced by Slicer3 (in .mrml format). Only the components that were specified by the user on command line would be generated. Compatible components include inputVolume, outputVolume, outputLandmarksInInputSpace, outputLandmarksInACPCAlignedSpace, and outputTransform., ", + "hash_files": "False", + }, + ), + ), + ( + "outputVerificationScript", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVerificationScript %s", + "help_string": ", The filename for the Slicer3 script that verifies the aligned landmarks against the aligned image file. This will happen only in conjunction with saveOutputLandmarks and an outputVolume., ", + "hash_files": "False", + }, + ), + ), + ( + "mspQualityLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--mspQualityLevel %d", + "help_string": ", Flag cotrols how agressive the MSP is estimated. 0=quick estimate (9 seconds), 1=normal estimate (11 seconds), 2=great estimate (22 seconds), 3=best estimate (58 seconds), NOTE: -1= Prealigned so no estimate!., ", + }, + ), + ), + ( + "otsuPercentileThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--otsuPercentileThreshold %f", + "help_string": ", This is a parameter to FindLargestForegroundFilledMask, which is employed when acLowerBound is set and an outputUntransformedClippedVolume is requested., ", + }, + ), + ), + ( + "acLowerBound", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--acLowerBound %f", + "help_string": ", When generating a resampled output image, replace the image with the BackgroundFillValue everywhere below the plane This Far in physical units (millimeters) below (inferior to) the AC point (as found by the model.) The oversize default was chosen to have no effect. Based on visualizing a thousand masks in the IPIG study, we recommend a limit no smaller than 80.0 mm., ", + }, + ), + ), + ( + "cutOutHeadInOutputVolume", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--cutOutHeadInOutputVolume ", + "help_string": ", Flag to cut out just the head tissue when producing an (un)transformed clipped volume., ", + }, + ), + ), + ( + "outputUntransformedClippedVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputUntransformedClippedVolume %s", + "help_string": "Output image in which to store neck-clipped input image, with the use of --acLowerBound and maybe --cutOutHeadInUntransformedVolume.", + "hash_files": "False", + }, + ), + ), + ( + "rescaleIntensities", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--rescaleIntensities ", + "help_string": ", Flag to turn on rescaling image intensities on input., ", + }, + ), + ), + ( + "trimRescaledIntensities", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trimRescaledIntensities %f", + "help_string": ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", + }, + ), + ), + ( + "rescaleIntensitiesOutputRange", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--rescaleIntensitiesOutputRange %s", + "help_string": ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", + "sep": ",", + }, + ), + ), + ( + "BackgroundFillValue", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--BackgroundFillValue %s", + "help_string": "Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number.", + }, + ), + ), + ( + "interpolationMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolationMode %s", + "help_string": "Type of interpolation to be used when applying transform to moving volume to create OutputResampledVolume. Options are Linear, NearestNeighbor, BSpline, or WindowedSinc", + }, + ), + ), + ( + "forceACPoint", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--forceACPoint %s", + "help_string": ", Manually specify the AC point from the original image in RAS coordinates (i.e. Slicer coordinates)., ", + "sep": ",", + }, + ), + ), + ( + "forcePCPoint", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--forcePCPoint %s", + "help_string": ", Manually specify the PC point from the original image in RAS coordinates (i.e. Slicer coordinates)., ", + "sep": ",", + }, + ), + ), + ( + "forceVN4Point", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--forceVN4Point %s", + "help_string": ", Manually specify the VN4 point from the original image in RAS coordinates (i.e. Slicer coordinates)., ", + "sep": ",", + }, + ), + ), + ( + "forceRPPoint", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--forceRPPoint %s", + "help_string": ", Manually specify the RP point from the original image in RAS coordinates (i.e. Slicer coordinates)., ", + "sep": ",", + }, + ), + ), + ( + "inputLandmarksEMSP", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarksEMSP %s", + "help_string": ", The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (in .fcsv) with the landmarks in the estimated MSP aligned space to be loaded. The detector will only process landmarks not enlisted on the file., ", + "exists": "True", + }, + ), + ), + ( + "forceHoughEyeDetectorReportFailure", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--forceHoughEyeDetectorReportFailure ", + "help_string": ", Flag indicates whether the Hough eye detector should report failure, ", + }, + ), + ), + ( + "rmpj", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--rmpj %f", + "help_string": ", Search radius for MPJ in unit of mm, ", + }, + ), + ), + ( + "rac", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--rac %f", + "help_string": ", Search radius for AC in unit of mm, ", + }, + ), + ), + ( + "rpc", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--rpc %f", + "help_string": ", Search radius for PC in unit of mm, ", + }, + ), + ), + ( + "rVN4", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--rVN4 %f", + "help_string": ", Search radius for VN4 in unit of mm, ", + }, + ), + ), + ( + "debug", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--debug ", + "help_string": ", Show internal debugging information., ", + }, + ), + ), + ( + "verbose", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--verbose ", + "help_string": ", Show more verbose output, ", + }, + ), + ), + ( + "writeBranded2DImage", + attr.ib( + type=File, + metadata={ + "argstr": "--writeBranded2DImage %s", + "help_string": ", The filename for the 2D .png branded midline debugging image. This will happen only in conjunction with requesting an outputVolume., ", + "hash_files": "False", + }, + ), + ), + ( + "resultsDir", + attr.ib( + type=Directory, + metadata={ + "argstr": "--resultsDir %s", + "help_string": ", The directory for the debuging images to be written., ", + "hash_files": "False", + }, + ), + ), + ( + "writedebuggingImagesLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--writedebuggingImagesLevel %d", + "help_string": ", This flag controls if debugging images are produced. By default value of 0 is no images. Anything greater than zero will be increasing level of debugging images., ", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ( + "atlasVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--atlasVolume %s", + "help_string": "Atlas volume image to be used for BRAINSFit registration to redefine the final ACPC-aligned transform by registering original input image to the Atlas image. The initial registration transform is created by passing BCD_ACPC_Landmarks and atlasLandmarks to BRAINSLandmarkInitializer. This flag should be used with atlasLandmarks and atlasLandmarkWeights flags. Note that using this flag causes that AC point in the final acpcLandmark file not be exactly placed at 0,0,0 coordinates., ", + "exists": "True", + }, + ), + ), + ( + "atlasLandmarks", + attr.ib( + type=File, + metadata={ + "argstr": "--atlasLandmarks %s", + "help_string": "Atlas landmarks to be used for BRAINSFit registration initialization, ", + "exists": "True", + }, + ), + ), + ( + "atlasLandmarkWeights", + attr.ib( + type=File, + metadata={ + "argstr": "--atlasLandmarkWeights %s", + "help_string": "Weights associated with atlas landmarks to be used for BRAINSFit registration initialization, ", + "exists": "True", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "ACPC-aligned output image with the same voxels as the input image, but updated origin, and direction cosign so that the AC point would fall at the physical location (0.0,0.0,0.0), and the mid-sagital plane is the plane where physical L/R coordinate is 0.0. No interpolation method is involved to create the 'outputVolume', and this output image is created using 'resample in place' filter.", + "exists": "True", + }, + ), + ), + ( + "outputResampledVolume", + attr.ib( + type=File, + metadata={ + "help_string": "ACPC-aligned output image in a resampled uniform isotropic space. Currently this is a 1mm, 256^3 image with identity direction cosign. Choose desired interpolation mode to generate the outputResampledVolume.", + "exists": "True", + }, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={ + "help_string": "The filename for the original space to ACPC alignment to be written (in .h5 format)., ", + "exists": "True", + }, + ), + ), + ( + "outputLandmarksInInputSpace", + attr.ib( + type=File, + metadata={ + "help_string": ", The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (.fcsv) with the landmarks in the original image space (the detected RP, AC, PC, and VN4) in it to be written., ", + "exists": "True", + }, + ), + ), + ( + "outputLandmarksInACPCAlignedSpace", + attr.ib( + type=File, + metadata={ + "help_string": ", The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (.fcsv) with the landmarks in the output image space (the detected RP, AC, PC, and VN4) in it to be written., ", + "exists": "True", + }, + ), + ), + ( + "outputMRML", + attr.ib( + type=File, + metadata={ + "help_string": ", The filename for the new subject-specific scene definition file in the same format produced by Slicer3 (in .mrml format). Only the components that were specified by the user on command line would be generated. Compatible components include inputVolume, outputVolume, outputLandmarksInInputSpace, outputLandmarksInACPCAlignedSpace, and outputTransform., ", + "exists": "True", + }, + ), + ), + ( + "outputVerificationScript", + attr.ib( + type=File, + metadata={ + "help_string": ", The filename for the Slicer3 script that verifies the aligned landmarks against the aligned image file. This will happen only in conjunction with saveOutputLandmarks and an outputVolume., ", + "exists": "True", + }, + ), + ), + ( + "outputUntransformedClippedVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output image in which to store neck-clipped input image, with the use of --acLowerBound and maybe --cutOutHeadInUntransformedVolume.", + "exists": "True", + }, + ), + ), + ( + "writeBranded2DImage", + attr.ib( + type=File, + metadata={ + "help_string": ", The filename for the 2D .png branded midline debugging image. This will happen only in conjunction with requesting an outputVolume., ", + "exists": "True", + }, + ), + ), + ( + "resultsDir", + attr.ib( + type=Directory, + metadata={ + "help_string": ", The directory for the debuging images to be written., ", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSConstellationDetector", + executable=" BRAINSConstellationDetector ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSCreateLabelMapFromProbabilityMaps: + """ + title: Create Label Map From Probability Maps (BRAINS) + category: Segmentation.Specialized + description: Given A list of Probability Maps, generate a LabelMap. + """ + + input_fields = [ + ( + "inputProbabilityVolume", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputProbabilityVolume %s...", + "help_string": "The list of proobabilityimages.", + }, + ), + ), + ( + "priorLabelCodes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--priorLabelCodes %s", + "help_string": "A list of PriorLabelCode values used for coding the output label images", + "sep": ",", + }, + ), + ), + ( + "foregroundPriors", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--foregroundPriors %s", + "help_string": "A list: For each Prior Label, 1 if foreground, 0 if background", + "sep": ",", + }, + ), + ), + ( + "nonAirRegionMask", + attr.ib( + type=File, + metadata={ + "argstr": "--nonAirRegionMask %s", + "help_string": "a mask representing the 'NonAirRegion' -- Just force pixels in this region to zero", + "exists": "True", + }, + ), + ), + ( + "inclusionThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--inclusionThreshold %f", + "help_string": "tolerance for inclusion", + }, + ), + ), + ( + "dirtyLabelVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--dirtyLabelVolume %s", + "help_string": "the labels prior to cleaning", + "hash_files": "False", + }, + ), + ), + ( + "cleanLabelVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--cleanLabelVolume %s", + "help_string": "the foreground labels volume", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "dirtyLabelVolume", + attr.ib( + type=File, + metadata={ + "help_string": "the labels prior to cleaning", + "exists": "True", + }, + ), + ), + ( + "cleanLabelVolume", + attr.ib( + type=File, + metadata={ + "help_string": "the foreground labels volume", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSCreateLabelMapFromProbabilityMaps", + executable=" BRAINSCreateLabelMapFromProbabilityMaps ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSMultiSTAPLE: + """ + title: Create best representative label map) + category: Segmentation.Specialized + description: given a list of label map images, create a representative/average label map. + """ + + input_fields = [ + ( + "inputCompositeT1Volume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputCompositeT1Volume %s", + "help_string": "Composite T1, all label maps transofrmed into the space for this image.", + "exists": "True", + }, + ), + ), + ( + "inputLabelVolume", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputLabelVolume %s...", + "help_string": "The list of proobabilityimages.", + }, + ), + ), + ( + "inputTransform", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputTransform %s...", + "help_string": "transforms to apply to label volumes", + }, + ), + ), + ( + "labelForUndecidedPixels", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--labelForUndecidedPixels %d", + "help_string": "Label for undecided pixels", + }, + ), + ), + ( + "resampledVolumePrefix", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--resampledVolumePrefix %s", + "help_string": "if given, write out resampled volumes with this prefix", + }, + ), + ), + ( + "skipResampling", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--skipResampling ", + "help_string": "Omit resampling images into reference space", + }, + ), + ), + ( + "outputMultiSTAPLE", + attr.ib( + type=File, + metadata={ + "argstr": "--outputMultiSTAPLE %s", + "help_string": "the MultiSTAPLE average of input label volumes", + "hash_files": "False", + }, + ), + ), + ( + "outputConfusionMatrix", + attr.ib( + type=File, + metadata={ + "argstr": "--outputConfusionMatrix %s", + "help_string": "Confusion Matrix", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputMultiSTAPLE", + attr.ib( + type=File, + metadata={ + "help_string": "the MultiSTAPLE average of input label volumes", + "exists": "True", + }, + ), + ), + ( + "outputConfusionMatrix", + attr.ib( + type=File, + metadata={"help_string": "Confusion Matrix", "exists": "True"}, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSMultiSTAPLE", + executable=" BRAINSMultiSTAPLE ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSROIAuto: + """ + title: Foreground masking (BRAINS) + category: Segmentation.Specialized + description: This program is used to create a mask over the most prominant forground region in an image. This is accomplished via a combination of otsu thresholding and a closing operation. More documentation is available here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/ForegroundMasking. + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu + acknowledgements: Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3); Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard) + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "The input image for finding the largest region filled mask.", + "exists": "True", + }, + ), + ), + ( + "outputROIMaskVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputROIMaskVolume %s", + "help_string": "The ROI automatically found from the input image.", + "hash_files": "False", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "The inputVolume with optional [maskOutput|cropOutput] to the region of the brain mask.", + "hash_files": "False", + }, + ), + ), + ( + "maskOutput", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--maskOutput ", + "help_string": "The inputVolume multiplied by the ROI mask.", + }, + ), + ), + ( + "cropOutput", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--cropOutput ", + "help_string": "The inputVolume cropped to the region of the ROI mask.", + }, + ), + ), + ( + "otsuPercentileThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--otsuPercentileThreshold %f", + "help_string": "Parameter to the Otsu threshold algorithm.", + }, + ), + ), + ( + "thresholdCorrectionFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--thresholdCorrectionFactor %f", + "help_string": "A factor to scale the Otsu algorithm's result threshold, in case clipping mangles the image.", + }, + ), + ), + ( + "closingSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--closingSize %f", + "help_string": "The Closing Size (in millimeters) for largest connected filled mask. This value is divided by image spacing and rounded to the next largest voxel number.", + }, + ), + ), + ( + "ROIAutoDilateSize", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--ROIAutoDilateSize %f", + "help_string": "This flag is only relavent when using ROIAUTO mode for initializing masks. It defines the final dilation size to capture a bit of background outside the tissue region. At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better.", + }, + ), + ), + ( + "outputVolumePixelType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--outputVolumePixelType %s", + "help_string": "The output image Pixel Type is the scalar datatype for representation of the Output Volume.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputROIMaskVolume", + attr.ib( + type=File, + metadata={ + "help_string": "The ROI automatically found from the input image.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "The inputVolume with optional [maskOutput|cropOutput] to the region of the brain mask.", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSROIAuto", + executable=" BRAINSROIAuto ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BinaryMaskEditorBasedOnLandmarks: + """ + title: BRAINS Binary Mask Editor Based On Landmarks(BRAINS) + category: Segmentation.Specialized + version: 5.2.0 + documentation-url: http://www.nitrc.org/projects/brainscdetector/ + """ + + input_fields = [ + ( + "inputBinaryVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputBinaryVolume %s", + "help_string": "Input binary image in which to be edited", + "exists": "True", + }, + ), + ), + ( + "outputBinaryVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputBinaryVolume %s", + "help_string": "Output binary image in which to be edited", + "hash_files": "False", + }, + ), + ), + ( + "inputLandmarksFilename", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarksFilename %s", + "help_string": " The filename for the landmark definition file in the same format produced by Slicer3 (.fcsv). ", + "exists": "True", + }, + ), + ), + ( + "inputLandmarkNames", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputLandmarkNames %s", + "help_string": " A target input landmark name to be edited. This should be listed in the inputLandmakrFilename Given. ", + "sep": ",", + }, + ), + ), + ( + "setCutDirectionForLandmark", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--setCutDirectionForLandmark %s", + "help_string": "Setting the cutting out direction of the input binary image to the one of anterior, posterior, left, right, superior or posterior. (ENUMERATION: ANTERIOR, POSTERIOR, LEFT, RIGHT, SUPERIOR, POSTERIOR) ", + "sep": ",", + }, + ), + ), + ( + "setCutDirectionForObliquePlane", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--setCutDirectionForObliquePlane %s", + "help_string": "If this is true, the mask will be thresholded out to the direction of inferior, posterior, and/or left. Default behavrior is that cutting out to the direction of superior, anterior and/or right. ", + "sep": ",", + }, + ), + ), + ( + "inputLandmarkNamesForObliquePlane", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputLandmarkNamesForObliquePlane %s", + "help_string": " Three subset landmark names of inputLandmarksFilename for a oblique plane computation. The plane computed for binary volume editing. ", + "sep": ",", + }, + ), + ), + ] + output_fields = [ + ( + "outputBinaryVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output binary image in which to be edited", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BinaryMaskEditorBasedOnLandmarks", + executable=" BinaryMaskEditorBasedOnLandmarks ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class ESLR: + """ + title: Clean Contiguous Label Map (BRAINS) + category: Segmentation.Specialized + description: From a range of label map values, extract the largest contiguous region of those labels + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input Label Volume", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Output Label Volume", + "hash_files": "False", + }, + ), + ), + ( + "low", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--low %d", + "help_string": "The lower bound of the labels to be used.", + }, + ), + ), + ( + "high", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--high %d", + "help_string": "The higher bound of the labels to be used.", + }, + ), + ), + ( + "closingSize", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--closingSize %d", + "help_string": "The closing size for hole filling.", + }, + ), + ), + ( + "openingSize", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--openingSize %d", + "help_string": "The opening size for hole filling.", + }, + ), + ), + ( + "safetySize", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--safetySize %d", + "help_string": "The safetySize size for the clipping region.", + }, + ), + ), + ( + "preserveOutside", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--preserveOutside ", + "help_string": "For values outside the specified range, preserve those values.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={"help_string": "Output Label Volume", "exists": "True"}, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ESLR", executable=" ESLR ", input_spec=input_spec, output_spec=output_spec + ) + + +class RobustStatisticsSegmenter: + """ + title: Robust Statistics Segmenter + category: Segmentation.Specialized + description: Active contour segmentation using robust statistic. + version: 1.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/RobustStatisticsSegmenter + contributor: Yi Gao (gatech), Allen Tannenbaum (gatech), Ron Kikinis (SPL, BWH) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health + """ + + input_fields = [ + ( + "expectedVolume", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--expectedVolume %f", + "help_string": "The approximate volume of the object, in mL.", + }, + ), + ), + ( + "intensityHomogeneity", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--intensityHomogeneity %f", + "help_string": "What is the homogeneity of intensity within the object? Given constant intensity at 1.0 score and extreme fluctuating intensity at 0.", + }, + ), + ), + ( + "curvatureWeight", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--curvatureWeight %f", + "help_string": "Given sphere 1.0 score and extreme rough bounday/surface 0 score, what is the expected smoothness of the object?", + }, + ), + ), + ( + "labelValue", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--labelValue %d", + "help_string": "Label value of the output image", + }, + ), + ), + ( + "maxRunningTime", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maxRunningTime %f", + "help_string": "The program will stop if this time is reached.", + }, + ), + ), + ( + "originalImageFileName", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Original image to be segmented", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "labelImageFileName", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Label image for initialization", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "segmentedImageFileName", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Segmented image", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "segmentedImageFileName", + attr.ib( + type=File, + metadata={ + "help_string": "Segmented image", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="RobustStatisticsSegmenter", + executable=" RobustStatisticsSegmenter ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class simpleEM: + """ + title: simpleEM (BRAINS) + category: Segmentation.Specialized + description: Atlas-based tissue segmentation method + """ + + input_fields = [ + ( + "t1Volume", + attr.ib( + type=File, + metadata={ + "argstr": "--t1Volume %s", + "help_string": "T1 Volume", + "exists": "True", + }, + ), + ), + ( + "t2Volume", + attr.ib( + type=File, + metadata={ + "argstr": "--t2Volume %s", + "help_string": "T2 Volume", + "exists": "True", + }, + ), + ), + ( + "pdVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--pdVolume %s", + "help_string": "PD Volume", + "exists": "True", + }, + ), + ), + ( + "templateVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--templateVolume %s", + "help_string": "template Volume", + "exists": "True", + }, + ), + ), + ( + "priorsList", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--priorsList %s", + "help_string": " number of input should same to the number of priorsList", + "sep": ",", + }, + ), + ), + ( + "priorsWeightList", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--priorsWeightList %s", + "help_string": " number of input should same to the number of priorsList", + "sep": ",", + }, + ), + ), + ( + "likelihoodTolerance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--likelihoodTolerance %f", + "help_string": " a convergence parameter (0 indicates take the default from the EMSegmentationFilter constructor.)", + }, + ), + ), + ("warp", attr.ib(type=traits.Bool, metadata={"argstr": "--warp "})), + ( + "degreeOfBiasFieldCorrection", + attr.ib( + type=traits.Int, metadata={"argstr": "--degreeOfBiasFieldCorrection %d"} + ), + ), + ( + "maxIteration", + attr.ib(type=traits.Int, metadata={"argstr": "--maxIteration %d"}), + ), + ( + "OutputFileNamePrefix", + attr.ib(type=traits.Str, metadata={"argstr": "--OutputFileNamePrefix %s"}), + ), + ( + "inputPixelType", + attr.ib( + type=traits.Enum, + metadata={"argstr": "--inputPixelType %s", "help_string": "Input Type"}, + ), + ), + ( + "outputPixelType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--outputPixelType %s", + "help_string": "Input Type", + }, + ), + ), + ( + "priorPixelType", + attr.ib( + type=traits.Enum, + metadata={"argstr": "--priorPixelType %s", "help_string": "prior Type"}, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="simpleEM", + executable=" simpleEM ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/setup.py b/pydra/tasks/sem/setup.py new file mode 100644 index 0000000..d872620 --- /dev/null +++ b/pydra/tasks/sem/setup.py @@ -0,0 +1,20 @@ +def configuration(parent_package="", top_path=None): + from numpy.distutils.misc_util import Configuration + + config = Configuration("", parent_package, top_path) + + config.add_data_dir("registration") + config.add_data_dir("filtering") + config.add_data_dir("segmentation") + config.add_data_dir("utilities") + config.add_data_dir("diffusion") + config.add_data_dir("brains") + config.add_data_dir("legacy") + + return config + + +if __name__ == "__main__": + from numpy.distutils.core import setup + + setup(**configuration(top_path="").todict()) diff --git a/pydra/tasks/sem/superresolution.py b/pydra/tasks/sem/superresolution.py new file mode 100644 index 0000000..43b0626 --- /dev/null +++ b/pydra/tasks/sem/superresolution.py @@ -0,0 +1,151 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class GenerateEdgeMapImage: + """ + title: GenerateEdgeMapImage + category: SuperResolution + description: Inverse of Maximum Gradient Image + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputMRVolumes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputMRVolumes %s...", + "help_string": "Input image files names", + }, + ), + ), + ( + "inputMask", + attr.ib( + type=File, + metadata={ + "argstr": "--inputMask %s", + "help_string": "Input mask file name. If set, image histogram percentiles will be calculated within the mask", + "exists": "True", + }, + ), + ), + ( + "outputMaximumGradientImage", + attr.ib( + type=File, + metadata={ + "argstr": "--outputMaximumGradientImage %s", + "help_string": "output gradient image file name", + "hash_files": "False", + }, + ), + ), + ( + "outputEdgeMap", + attr.ib( + type=File, + metadata={ + "argstr": "--outputEdgeMap %s", + "help_string": "output edgemap file name", + "hash_files": "False", + }, + ), + ), + ( + "lowerPercentileMatching", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--lowerPercentileMatching %f", + "help_string": "Map lower quantile and below to minOutputRange. It should be a value between zero and one.", + }, + ), + ), + ( + "upperPercentileMatching", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--upperPercentileMatching %f", + "help_string": "Map upper quantile and above to maxOutputRange. It should be a value between zero and one.", + }, + ), + ), + ( + "minimumOutputRange", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--minimumOutputRange %d", + "help_string": "Map lower quantile and below to minimum output range. It should be an epsilon number greater than zero. Default is 1.", + }, + ), + ), + ( + "maximumOutputRange", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--maximumOutputRange %d", + "help_string": "Map upper quantile and above to maximum output range. Default is 255 that is the maximum range of unsigned char.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputMaximumGradientImage", + attr.ib( + type=File, + metadata={ + "help_string": "output gradient image file name", + "exists": "True", + }, + ), + ), + ( + "outputEdgeMap", + attr.ib( + type=File, + metadata={"help_string": "output edgemap file name", "exists": "True"}, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GenerateEdgeMapImage", + executable=" GenerateEdgeMapImage ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/surface.py b/pydra/tasks/sem/surface.py new file mode 100644 index 0000000..9b998ed --- /dev/null +++ b/pydra/tasks/sem/surface.py @@ -0,0 +1,716 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class GrayscaleModelMaker: + """ + title: Grayscale Model Maker + category: Surface Models + description: Create 3D surface models from grayscale data. This module uses Marching Cubes to create an isosurface at a given threshold. The resulting surface consists of triangles that separate a volume into regions below and above the threshold. The resulting surface can be smoothed and decimated. This model works on continuous data while the module Model Maker works on labeled (or discrete) data. + version: 3.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GrayscaleModelMaker + license: slicer3 + contributor: Nicole Aucoin (SPL, BWH), Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Volume containing the input grayscale data.", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputGeometry", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output that contains geometry model.", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ( + "threshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--threshold %f", + "help_string": "Grayscale threshold of isosurface. The resulting surface of triangles separates the volume into voxels that lie above (inside) and below (outside) the threshold.", + }, + ), + ), + ( + "name", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--name %s", + "help_string": "Name to use for this model.", + }, + ), + ), + ( + "smooth", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--smooth %d", + "help_string": "Number of smoothing iterations. If 0, no smoothing will be done.", + }, + ), + ), + ( + "decimate", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--decimate %f", + "help_string": "Target reduction during decimation, as a decimal percentage reduction in the number of polygons. If 0, no decimation will be done.", + }, + ), + ), + ( + "splitnormals", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--splitnormals ", + "help_string": "Splitting normals is useful for visualizing sharp features. However it creates holes in surfaces which affect measurements", + }, + ), + ), + ( + "pointnormals", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--pointnormals ", + "help_string": "Calculate the point normals? Calculated point normals make the surface appear smooth. Without point normals, the surface will appear faceted.", + }, + ), + ), + ( + "debug", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--debug ", + "help_string": "Turn this flag on to log more details during execution.", + }, + ), + ), + ] + output_fields = [ + ( + "OutputGeometry", + attr.ib( + type=File, + metadata={ + "help_string": "Output that contains geometry model.", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GrayscaleModelMaker", + executable=" GrayscaleModelMaker ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class LabelMapSmoothing: + """ + title: Label Map Smoothing + category: Surface Models + description: This filter smoothes a binary label map. With a label map as input, this filter runs an anti-alising algorithm followed by a Gaussian smoothing algorithm. The output is a smoothed label map. + version: 1.0 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/LabelMapSmoothing + contributor: Dirk Padfield (GE), Josh Cates (Utah), Ross Whitaker (Utah) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. This filter is based on work developed at the University of Utah, and implemented at GE Research. + """ + + input_fields = [ + ( + "labelToSmooth", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--labelToSmooth %d", + "help_string": "The label to smooth. All others will be ignored. If no label is selected by the user, the maximum label in the image is chosen by default.", + }, + ), + ), + ( + "numberOfIterations", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfIterations %d", + "help_string": "The number of iterations of the level set AntiAliasing algorithm", + }, + ), + ), + ( + "maxRMSError", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--maxRMSError %f", + "help_string": "The maximum RMS error.", + }, + ), + ), + ( + "gaussianSigma", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--gaussianSigma %f", + "help_string": "The standard deviation of the Gaussian kernel", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input label map to smooth", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Smoothed label map", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Smoothed label map", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="LabelMapSmoothing", + executable=" LabelMapSmoothing ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class MergeModels: + """ + title: Merge Models + category: Surface Models + description: Merge the polydata from two input models and output a new model with the combined polydata. Uses the vtkAppendPolyData filter. Works on .vtp and .vtk surface files. + version: $Revision$ + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/MergeModels + contributor: Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH), Daniel Haehn (SPL, BWH, UPenn) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "Model1", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input model 1", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "Model2", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input model 2", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "ModelOutput", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output model", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "ModelOutput", + attr.ib( + type=File, + metadata={ + "help_string": "Output model", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="MergeModels", + executable=" MergeModels ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class ModelMaker: + """ + title: Model Maker + category: Surface Models + description: Create 3D surface models from segmented data.

Models are imported into Slicer under a model hierarchy node in a MRML scene. The model colors are set by the color table associated with the input volume (these colours will only be visible if you load the model scene file).

IO:

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()

+ version: 4.4 + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ModelMaker + license: slicer4 + contributor: Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH), Bill Lorensen (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input label map. The Input Volume drop down menu is populated with the label map volumes that are present in the scene, select one from which to generate models.", + "position": "-1", + "exists": "True", + }, + ), + ), + ( + "color", + attr.ib( + type=File, + metadata={ + "argstr": "--color %s", + "help_string": "Color table to make labels to colors and objects", + "exists": "True", + }, + ), + ), + ( + "modelSceneFile", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--modelSceneFile %s...", + "help_string": "Generated models, under a model hierarchy node. Models are imported into Slicer under a model hierarchy node, and their colors are set by the color table associated with the input label map volume. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu. If you're running from the command line, a model hierarchy node in a new mrml scene will be created for you.", + "hash_files": "False", + }, + ), + ), + ( + "name", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--name %s", + "help_string": "Name to use for this model. Any text entered in the entry box will be the starting string for the created model file names. The label number and the color name will also be part of the file name. If making multiple models, use this as a prefix to the label and color name.", + }, + ), + ), + ( + "generateAll", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--generateAll ", + "help_string": "Generate models for all labels in the input volume. select this option if you want to create all models that correspond to all values in a labelmap volume (using the Joint Smoothing option below is useful with this option). Ignores Labels, Start Label, End Label settings. Skips label 0.", + }, + ), + ), + ( + "labels", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--labels %s", + "help_string": "A comma separated list of label values from which to make models. f you specify a list of Labels, it will override any start/end label settings. If you click Generate All Models it will override the list of labels and any start/end label settings.", + "sep": ",", + }, + ), + ), + ( + "start", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--start %d", + "help_string": "If you want to specify a continuous range of labels from which to generate models, enter the lower label here. Voxel value from which to start making models. Used instead of the label list to specify a range (make sure the label list is empty or it will over ride this).", + }, + ), + ), + ( + "end", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--end %d", + "help_string": "If you want to specify a continuous range of labels from which to generate models, enter the higher label here. Voxel value up to which to continue making models. Skip any values with zero voxels.", + }, + ), + ), + ( + "skipUnNamed", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--skipUnNamed ", + "help_string": "Select this to not generate models from labels that do not have names defined in the color look up table associated with the input label map. If true, only models which have an entry in the color table will be generated. If false, generate all models that exist within the label range.", + }, + ), + ), + ( + "jointsmooth", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--jointsmooth ", + "help_string": "This will ensure that all resulting models fit together smoothly, like jigsaw puzzle pieces. Otherwise the models will be smoothed independently and may overlap.", + }, + ), + ), + ( + "smooth", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--smooth %d", + "help_string": "Here you can set the number of smoothing iterations for Laplacian smoothing, or the degree of the polynomial approximating the windowed Sinc function. Use 0 if you wish no smoothing. ", + }, + ), + ), + ( + "filtertype", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--filtertype %s", + "help_string": "You can control the type of smoothing done on the models by selecting a filter type of either Sinc or Laplacian.", + }, + ), + ), + ( + "decimate", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--decimate %f", + "help_string": "Chose the target reduction in number of polygons as a decimal percentage (between 0 and 1) of the number of polygons. Specifies the percentage of triangles to be removed. For example, 0.1 means 10% reduction and 0.9 means 90% reduction.", + }, + ), + ), + ( + "splitnormals", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--splitnormals ", + "help_string": "Splitting normals is useful for visualizing sharp features. However it creates holes in surfaces which affects measurements.", + }, + ), + ), + ( + "pointnormals", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--pointnormals ", + "help_string": "Turn this flag on if you wish to calculate the normal vectors for the points.", + }, + ), + ), + ( + "pad", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--pad ", + "help_string": "Pad the input volume with zero value voxels on all 6 faces in order to ensure the production of closed surfaces. Sets the origin translation and extent translation so that the models still line up with the unpadded input volume.", + }, + ), + ), + ( + "modelHierarchyFile", + attr.ib( + type=File, + metadata={ + "argstr": "--modelHierarchyFile %s", + "help_string": "A mrml file that contains a template model hierarchy tree with a hierarchy node per color used in the input volume's color table. Color names used for the models are matched to template hierarchy names to create a multi level output tree. Create a hierarchy in the Models GUI and save a scene, then clean it up to remove everything but the model hierarchy and display nodes.", + "exists": "True", + }, + ), + ), + ( + "saveIntermediateModels", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--saveIntermediateModels ", + "help_string": "You can save a copy of the models after each of the intermediate steps (marching cubes, smoothing, and decimation if not joint smoothing, otherwise just after decimation). These intermediate models are not saved in the mrml file, you have to load them manually after turning off deleting temporary files in they python console (View ->Python Interactor) using the following command slicer.modules.modelmaker.cliModuleLogic().DeleteTemporaryFilesOff().", + }, + ), + ), + ( + "debug", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--debug ", + "help_string": "turn this flag on in order to see debugging output (look in the Error Log window that is accessed via the View menu)", + }, + ), + ), + ] + output_fields = [ + ( + "modelSceneFile", + attr.ib( + type=OutputMultiPath, + metadata={ + "help_string": "Generated models, under a model hierarchy node. Models are imported into Slicer under a model hierarchy node, and their colors are set by the color table associated with the input label map volume. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu. If you're running from the command line, a model hierarchy node in a new mrml scene will be created for you.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ModelMaker", + executable=" ModelMaker ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class ModelToLabelMap: + """ + title: Model To LabelMap + category: Surface Models + description: Intersects an input model with a reference volume and produces an output label map, filling voxels inside the model with the specified label value. + version: $Revision: 8643 $ + documentation-url: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ModelToLabelMap + contributor: Andras Lasso (PerkLab), Csaba Pinter (PerkLab), Nicole Aucoin (SPL, BWH), Xiaodong Tao (GE) + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + """ + + input_fields = [ + ( + "labelValue", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--labelValue %d", + "help_string": "The unsigned char label value to use in the output label map.", + }, + ), + ), + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output volume will have the same origin, spacing, axis directions, and extent as this volume.", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "surface", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input model", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Unsigned char label map volume", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "OutputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Unsigned char label map volume", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ModelToLabelMap", + executable=" ModelToLabelMap ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class ProbeVolumeWithModel: + """ + title: Probe Volume With Model + category: Surface Models + description: Paint a model by a volume (using vtkProbeFilter). + version: 0.1.0.$Revision: 1892 $(alpha) + documentation-url: http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ProbeVolumeWithModel + contributor: Lauren O'Donnell (SPL, BWH) + acknowledgements: BWH, NCIGT/LMI + """ + + input_fields = [ + ( + "InputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Volume to use to 'paint' the model", + "position": "-3", + "exists": "True", + }, + ), + ), + ( + "InputModel", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Input model", + "position": "-2", + "exists": "True", + }, + ), + ), + ( + "OutputModel", + attr.ib( + type=File, + metadata={ + "argstr": "%s", + "help_string": "Output 'painted' model", + "position": "-1", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "OutputModel", + attr.ib( + type=File, + metadata={ + "help_string": "Output 'painted' model", + "position": "-1", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ProbeVolumeWithModel", + executable=" ProbeVolumeWithModel ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/testing.py b/pydra/tasks/sem/testing.py new file mode 100644 index 0000000..8c11f97 --- /dev/null +++ b/pydra/tasks/sem/testing.py @@ -0,0 +1,230 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class CLIROITest: + """ + title: CLI ROI Test + category: Testing + version: 1.0 + """ + + input_fields = [ + ("ri", attr.ib(type=traits.List, metadata={"argstr": "--ri %s"})), + ("ro", attr.ib(type=InputMultiPath, metadata={"argstr": "--ro %s..."})), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="CLIROITest", + executable=" CLIROITest ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class ComputeReflectiveCorrelationMetric: + """ + title: Compute RC metric values in exhausive search + category: Testing + version: 5.2.0 + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input image.", + "exists": "True", + }, + ), + ), + ( + "outputCSVFile", + attr.ib( + type=File, + metadata={ + "argstr": "--outputCSVFile %s", + "help_string": "A file to write out final information report in CSV file: HA,BA,LR,MetricValue(cc)", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputCSVFile", + attr.ib( + type=File, + metadata={ + "help_string": "A file to write out final information report in CSV file: HA,BA,LR,MetricValue(cc)", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="ComputeReflectiveCorrelationMetric", + executable=" ComputeReflectiveCorrelationMetric ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class GenerateAverageLmkFile: + """ + title: Average Fiducials + category: Testing + description: This program gets several fcsv file each one contains several landmarks with the same name but slightly different coordinates. For EACH landmark we compute the average coordination. + version: 5.2.0 + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputLandmarkFiles", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputLandmarkFiles %s", + "help_string": "Input landmark files names (.fcsv or .wts).", + "sep": ",", + }, + ), + ), + ( + "inputLandmarkListFile", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarkListFile %s", + "help_string": "A single file for a list of filenames one per line.", + "exists": "True", + }, + ), + ), + ( + "outputLandmarkFile", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLandmarkFile %s", + "help_string": "Ouput landmark file name that includes average values for landmarks (.fcsv or .wts)", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputLandmarkFile", + attr.ib( + type=File, + metadata={ + "help_string": "Ouput landmark file name that includes average values for landmarks (.fcsv or .wts)", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GenerateAverageLmkFile", + executable=" GenerateAverageLmkFile ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class LandmarksCompare: + """ + title: Compare Fiducials + category: Testing + description: Compares two .fcsv or .wts text files and verifies that they are identicle. Used for testing landmarks files. + version: 5.2.0 + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputLandmarkFile1", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarkFile1 %s", + "help_string": "First input landmark file (.fcsv or .wts)", + "exists": "True", + }, + ), + ), + ( + "inputLandmarkFile2", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputLandmarkFile2 %s", + "help_string": "Second input landmark file. This can be a vector of baseline file names (.fcsv or .wts)", + "sep": ",", + }, + ), + ), + ( + "weights", + attr.ib( + type=File, + metadata={ + "argstr": "--weights %s", + "help_string": "Weights on the tolerance to accept ( tolerance / weights )", + "exists": "True", + }, + ), + ), + ( + "tolerance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--tolerance %f", + "help_string": "The maximum error (in mm) allowed in each direction of a landmark", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="LandmarksCompare", + executable=" LandmarksCompare ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/utilities/__init__.py b/pydra/tasks/sem/utilities/__init__.py new file mode 100644 index 0000000..7072333 --- /dev/null +++ b/pydra/tasks/sem/utilities/__init__.py @@ -0,0 +1,24 @@ +from brains import ( + BRAINSAlignMSP, + BRAINSClipInferior, + BRAINSConstellationDetectorGUI, + BRAINSConstellationLandmarksTransform, + BRAINSConstellationModeler, + BRAINSEyeDetector, + BRAINSInitializedControlPoints, + BRAINSLandmarkInitializer, + BRAINSLinearModelerEPCA, + BRAINSLmkTransform, + BRAINSMultiModeSegment, + BRAINSMush, + BRAINSSnapShotWriter, + BRAINSTransformConvert, + BRAINSTrimForegroundInDirection, + FindCenterOfBrain, + GenerateLabelMapFromProbabilityMap, + fcsv_to_hdf5, + insertMidACPCpoint, + landmarksConstellationAligner, + landmarksConstellationWeights, +) +from brainsstriprotation import BRAINSStripRotation diff --git a/pydra/tasks/sem/utilities/brains.py b/pydra/tasks/sem/utilities/brains.py new file mode 100644 index 0000000..3ea488c --- /dev/null +++ b/pydra/tasks/sem/utilities/brains.py @@ -0,0 +1,2157 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSAlignMSP: + """ + title: Align Mid Saggital Brain (BRAINS) + category: Utilities.BRAINS + description: Resample an image into ACPC alignement ACPCDetect + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": ", The Image to be resampled, ", + "exists": "True", + }, + ), + ), + ( + "OutputresampleMSP", + attr.ib( + type=File, + metadata={ + "argstr": "--OutputresampleMSP %s", + "help_string": ", The image to be output., ", + "hash_files": "False", + }, + ), + ), + ( + "verbose", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--verbose ", + "help_string": ", Show more verbose output, ", + }, + ), + ), + ( + "resultsDir", + attr.ib( + type=Directory, + metadata={ + "argstr": "--resultsDir %s", + "help_string": ", The directory for the results to be written., ", + "hash_files": "False", + }, + ), + ), + ( + "writedebuggingImagesLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--writedebuggingImagesLevel %d", + "help_string": ", This flag controls if debugging images are produced. By default value of 0 is no images. Anything greater than zero will be increasing level of debugging images., ", + }, + ), + ), + ( + "mspQualityLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--mspQualityLevel %d", + "help_string": ", Flag cotrols how agressive the MSP is estimated. 0=quick estimate (9 seconds), 1=normal estimate (11 seconds), 2=great estimate (22 seconds), 3=best estimate (58 seconds)., ", + }, + ), + ), + ( + "rescaleIntensities", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--rescaleIntensities ", + "help_string": ", Flag to turn on rescaling image intensities on input., ", + }, + ), + ), + ( + "trimRescaledIntensities", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trimRescaledIntensities %f", + "help_string": ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", + }, + ), + ), + ( + "rescaleIntensitiesOutputRange", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--rescaleIntensitiesOutputRange %s", + "help_string": ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", + "sep": ",", + }, + ), + ), + ( + "BackgroundFillValue", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--BackgroundFillValue %s", + "help_string": "Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number.", + }, + ), + ), + ( + "interpolationMode", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--interpolationMode %s", + "help_string": "Type of interpolation to be used when applying transform to moving volume. Options are Linear, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "OutputresampleMSP", + attr.ib( + type=File, + metadata={ + "help_string": ", The image to be output., ", + "exists": "True", + }, + ), + ), + ( + "resultsDir", + attr.ib( + type=Directory, + metadata={ + "help_string": ", The directory for the results to be written., ", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSAlignMSP", + executable=" BRAINSAlignMSP ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSClipInferior: + """ + title: Clip Inferior of Center of Brain (BRAINS) + category: Utilities.BRAINS + description: This program will read the inputVolume as a short int image, write the BackgroundFillValue everywhere inferior to the lower bound, and write the resulting clipped short int image in the outputVolume. + version: 5.2.0 + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input image to make a clipped short int copy from.", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Output image, a short int copy of the upper portion of the input image, filled with BackgroundFillValue.", + "hash_files": "False", + }, + ), + ), + ( + "acLowerBound", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--acLowerBound %f", + "help_string": ", When the input image to the output image, replace the image with the BackgroundFillValue everywhere below the plane This Far in physical units (millimeters) below (inferior to) the AC point (assumed to be the voxel field middle.) The oversize default was chosen to have no effect. Based on visualizing a thousand masks in the IPIG study, we recommend a limit no smaller than 80.0 mm., ", + }, + ), + ), + ( + "BackgroundFillValue", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--BackgroundFillValue %s", + "help_string": "Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output image, a short int copy of the upper portion of the input image, filled with BackgroundFillValue.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSClipInferior", + executable=" BRAINSClipInferior ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSConstellationDetectorGUI: + """ + title: ConstellationDetectorGUI (BRAINS) + category: Utilities.BRAINS + description: This program provides the user with a GUI tool to view/manipulate landmarks for an input volume. + version: 5.2.0 + documentation-url: http://www.nitrc.org/projects/brainscdetector/ + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "The filename of the input NIfTI volume to view/manipulate", + "exists": "True", + }, + ), + ), + ( + "inputLandmarks", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarks %s", + "help_string": ", The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (in a .fcsv format) with the landmarks in the original image space in it to be read in., ", + "exists": "True", + }, + ), + ), + ( + "outputLandmarks", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLandmarks %s", + "help_string": ", The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (in a .fcsv format) with the landmarks in the original image space in it to be written., ", + "exists": "True", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSConstellationDetectorGUI", + executable=" BRAINSConstellationDetectorGUI ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSConstellationLandmarksTransform: + """ + title: Landmarks Transformation + category: Utilities.BRAINS + description: This program converts the original landmark file to the target landmark file using the input transform. + version: 5.2.0 + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputLandmarksFile", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarksFile %s", + "help_string": "Input landmarks file (.fcsv)", + "exists": "True", + }, + ), + ), + ( + "inputTransformFile", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTransformFile %s", + "help_string": "input composite transform file (.h5,.hdf5)", + "exists": "True", + }, + ), + ), + ( + "outputLandmarksFile", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLandmarksFile %s", + "help_string": "Output landmarks file (.fcsv)", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputLandmarksFile", + attr.ib( + type=File, + metadata={ + "help_string": "Output landmarks file (.fcsv)", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSConstellationLandmarksTransform", + executable=" BRAINSConstellationLandmarksTransform ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSConstellationModeler: + """ + title: Generate Landmarks Model (BRAINS) + category: Utilities.BRAINS + description: Train up a model for BRAINSConstellationDetector + """ + + input_fields = [ + ( + "verbose", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--verbose ", + "help_string": ", Show more verbose output, ", + }, + ), + ), + ( + "inputTrainingList", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTrainingList %s", + "help_string": ", Setup file, giving all parameters for training up a template model for each landmark., ", + "exists": "True", + }, + ), + ), + ( + "outputModel", + attr.ib( + type=File, + metadata={ + "argstr": "--outputModel %s", + "help_string": ", The full filename of the output model file., ", + "hash_files": "False", + }, + ), + ), + ( + "saveOptimizedLandmarks", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--saveOptimizedLandmarks ", + "help_string": ", Flag to make a new subject-specific landmark definition file in the same format produced by Slicer3 with the optimized landmark (the detected RP, AC, and PC) in it. Useful to tighten the variances in the ConstellationModeler., ", + }, + ), + ), + ( + "optimizedLandmarksFilenameExtender", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--optimizedLandmarksFilenameExtender %s", + "help_string": ", If the trainingList is (indexFullPathName) and contains landmark data filenames [path]/[filename].fcsv , make the optimized landmarks filenames out of [path]/[filename](thisExtender) and the optimized version of the input trainingList out of (indexFullPathName)(thisExtender) , when you rewrite all the landmarks according to the saveOptimizedLandmarks flag., ", + }, + ), + ), + ( + "resultsDir", + attr.ib( + type=Directory, + metadata={ + "argstr": "--resultsDir %s", + "help_string": ", The directory for the results to be written., ", + "hash_files": "False", + }, + ), + ), + ( + "mspQualityLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--mspQualityLevel %d", + "help_string": ", Flag cotrols how agressive the MSP is estimated. 0=quick estimate (9 seconds), 1=normal estimate (11 seconds), 2=great estimate (22 seconds), 3=best estimate (58 seconds)., ", + }, + ), + ), + ( + "rescaleIntensities", + attr.ib( + type=traits.Bool, + metadata={ + "argstr": "--rescaleIntensities ", + "help_string": ", Flag to turn on rescaling image intensities on input., ", + }, + ), + ), + ( + "trimRescaledIntensities", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--trimRescaledIntensities %f", + "help_string": ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", + }, + ), + ), + ( + "rescaleIntensitiesOutputRange", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--rescaleIntensitiesOutputRange %s", + "help_string": ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", + "sep": ",", + }, + ), + ), + ( + "BackgroundFillValue", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--BackgroundFillValue %s", + "help_string": "Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number.", + }, + ), + ), + ( + "writedebuggingImagesLevel", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--writedebuggingImagesLevel %d", + "help_string": ", This flag controls if debugging images are produced. By default value of 0 is no images. Anything greater than zero will be increasing level of debugging images., ", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputModel", + attr.ib( + type=File, + metadata={ + "help_string": ", The full filename of the output model file., ", + "exists": "True", + }, + ), + ), + ( + "resultsDir", + attr.ib( + type=Directory, + metadata={ + "help_string": ", The directory for the results to be written., ", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSConstellationModeler", + executable=" BRAINSConstellationModeler ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSEyeDetector: + """ + title: Eye Detector (BRAINS) + category: Utilities.BRAINS + version: 5.2.0 + documentation-url: http://www.nitrc.org/projects/brainscdetector/ + """ + + input_fields = [ + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "The input volume", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "The output volume", + "hash_files": "False", + }, + ), + ), + ( + "debugDir", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--debugDir %s", + "help_string": "A place for debug information", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={"help_string": "The output volume", "exists": "True"}, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSEyeDetector", + executable=" BRAINSEyeDetector ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSInitializedControlPoints: + """ + title: Initialized Control Points (BRAINS) + category: Utilities.BRAINS + description: Outputs bspline control points as landmarks + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Mark Scully + acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for Mark Scully and Hans Johnson at the University of Iowa. + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input Volume", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Output Volume", + "hash_files": "False", + }, + ), + ), + ( + "splineGridSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--splineGridSize %s", + "help_string": "The number of subdivisions of the BSpline Grid to be centered on the image space. Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. ", + "sep": ",", + }, + ), + ), + ( + "permuteOrder", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--permuteOrder %s", + "help_string": "The permutation order for the images. The default is 0,1,2 (i.e. no permutation)", + "sep": ",", + }, + ), + ), + ( + "outputLandmarksFile", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--outputLandmarksFile %s", + "help_string": "Output filename", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, metadata={"help_string": "Output Volume", "exists": "True"} + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSInitializedControlPoints", + executable=" BRAINSInitializedControlPoints ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSLandmarkInitializer: + """ + title: BRAINSLandmarkInitializer + category: Utilities.BRAINS + description: Create transformation file (*.h5) from a pair of landmarks (*fcsv) files. + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Eunyoung Regina Kim, Ali Ghayoor, and Hans J. Johnson + acknowledgements: SINAPSE Lab + """ + + input_fields = [ + ( + "inputFixedLandmarkFilename", + attr.ib( + type=File, + metadata={ + "argstr": "--inputFixedLandmarkFilename %s", + "help_string": "input landmarks from fixed image *.fcsv", + "exists": "True", + }, + ), + ), + ( + "inputMovingLandmarkFilename", + attr.ib( + type=File, + metadata={ + "argstr": "--inputMovingLandmarkFilename %s", + "help_string": "input landmarks from moving image *.fcsv", + "exists": "True", + }, + ), + ), + ( + "inputWeightFilename", + attr.ib( + type=File, + metadata={ + "argstr": "--inputWeightFilename %s", + "help_string": "Input weight file name for landmarks. Higher weighted landmark will be considered more heavily. Weights are propotional, that is the magnitude of weights will be normalized by its minimum and maximum value. ", + "exists": "True", + }, + ), + ), + ( + "outputTransformFilename", + attr.ib( + type=File, + metadata={ + "argstr": "--outputTransformFilename %s", + "help_string": "output transform file name (ex: ./moving2fixed.h5) that is appropriate for applying to the moving image to align with the fixed image. The _Inverse file is also written that is approporate for placing the moving Landmarks with the fixed image. ", + "hash_files": "False", + }, + ), + ), + ( + "outputTransformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--outputTransformType %s", + "help_string": "The target transformation type. ", + }, + ), + ), + ( + "inputReferenceImageFilename", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReferenceImageFilename %s", + "help_string": "Set the reference image to define the parametric domain for the BSpline transform. ", + "exists": "True", + }, + ), + ), + ( + "bsplineNumberOfControlPoints", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--bsplineNumberOfControlPoints %d", + "help_string": "Set the number of control points to define the parametric domain for the BSpline transform. ", + }, + ), + ), + ] + output_fields = [ + ( + "outputTransformFilename", + attr.ib( + type=File, + metadata={ + "help_string": "output transform file name (ex: ./moving2fixed.h5) that is appropriate for applying to the moving image to align with the fixed image. The _Inverse file is also written that is approporate for placing the moving Landmarks with the fixed image. ", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSLandmarkInitializer", + executable=" BRAINSLandmarkInitializer ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSLinearModelerEPCA: + """ + title: Landmark Linear Modeler (BRAINS) + category: Utilities.BRAINS + description: Training linear model using EPCA. Implementation based on my MS thesis, "A METHOD FOR AUTOMATED LANDMARK CONSTELLATION DETECTION USING EVOLUTIONARY PRINCIPAL COMPONENTS AND STATISTICAL SHAPE MODELS" + version: 5.2.0 + documentation-url: http://www.nitrc.org/projects/brainscdetector/ + """ + + input_fields = [ + ( + "inputTrainingList", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTrainingList %s", + "help_string": "Input Training Landmark List Filename, ", + "exists": "True", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSLinearModelerEPCA", + executable=" BRAINSLinearModelerEPCA ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSLmkTransform: + """ + title: Landmark Transform (BRAINS) + category: Utilities.BRAINS + description: This utility program estimates the affine transform to align the fixed landmarks to the moving landmarks, and then generate the resampled moving image to the same physical space as that of the reference image. + version: 5.2.0 + documentation-url: http://www.nitrc.org/projects/brainscdetector/ + """ + + input_fields = [ + ( + "inputMovingLandmarks", + attr.ib( + type=File, + metadata={ + "argstr": "--inputMovingLandmarks %s", + "help_string": "Input Moving Landmark list file in fcsv, ", + "exists": "True", + }, + ), + ), + ( + "inputFixedLandmarks", + attr.ib( + type=File, + metadata={ + "argstr": "--inputFixedLandmarks %s", + "help_string": "Input Fixed Landmark list file in fcsv, ", + "exists": "True", + }, + ), + ), + ( + "outputAffineTransform", + attr.ib( + type=File, + metadata={ + "argstr": "--outputAffineTransform %s", + "help_string": "The filename for the estimated affine transform, ", + "hash_files": "False", + }, + ), + ), + ( + "inputMovingVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputMovingVolume %s", + "help_string": "The filename of input moving volume", + "exists": "True", + }, + ), + ), + ( + "inputReferenceVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputReferenceVolume %s", + "help_string": "The filename of the reference volume", + "exists": "True", + }, + ), + ), + ( + "outputResampledVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputResampledVolume %s", + "help_string": "The filename of the output resampled volume", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputAffineTransform", + attr.ib( + type=File, + metadata={ + "help_string": "The filename for the estimated affine transform, ", + "exists": "True", + }, + ), + ), + ( + "outputResampledVolume", + attr.ib( + type=File, + metadata={ + "help_string": "The filename of the output resampled volume", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSLmkTransform", + executable=" BRAINSLmkTransform ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSMultiModeSegment: + """ + title: Segment based on rectangular region of joint histogram (BRAINS) + category: Utilities.BRAINS + description: This tool creates binary regions based on segmenting multiple image modalitities at once. + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu + acknowledgements: Hans Johnson(1,3,4); Gregory Harris(1), Vincent Magnotta(1,2,3); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering) + """ + + input_fields = [ + ( + "inputVolumes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputVolumes %s...", + "help_string": "The input image volumes for finding the largest region filled mask.", + }, + ), + ), + ( + "inputMaskVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputMaskVolume %s", + "help_string": "The ROI for region to compute histogram levels.", + "exists": "True", + }, + ), + ), + ( + "outputROIMaskVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputROIMaskVolume %s", + "help_string": "The ROI automatically found from the input image.", + "hash_files": "False", + }, + ), + ), + ( + "outputClippedVolumeROI", + attr.ib( + type=File, + metadata={ + "argstr": "--outputClippedVolumeROI %s", + "help_string": "The inputVolume clipped to the region of the brain mask.", + "hash_files": "False", + }, + ), + ), + ( + "lowerThreshold", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--lowerThreshold %s", + "help_string": "Lower thresholds on the valid histogram regions for each modality", + "sep": ",", + }, + ), + ), + ( + "upperThreshold", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--upperThreshold %s", + "help_string": "Upper thresholds on the valid histogram regions for each modality", + "sep": ",", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputROIMaskVolume", + attr.ib( + type=File, + metadata={ + "help_string": "The ROI automatically found from the input image.", + "exists": "True", + }, + ), + ), + ( + "outputClippedVolumeROI", + attr.ib( + type=File, + metadata={ + "help_string": "The inputVolume clipped to the region of the brain mask.", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSMultiModeSegment", + executable=" BRAINSMultiModeSegment ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSMush: + """ + title: Brain Extraction from T1/T2 image (BRAINS) + category: Utilities.BRAINS + description: This program: 1) generates a weighted mixture image optimizing the mean and variance and 2) produces a mask of the brain volume + version: 5.2.0 + documentation-url: http:://mri.radiology.uiowa.edu + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: This tool is a modification by Steven Dunn of a program developed by Greg Harris and Ron Pierson. + acknowledgements: This work was developed by the University of Iowa Departments of Radiology and Psychiatry. This software was supported in part of NIH/NINDS award NS050568. + """ + + input_fields = [ + ( + "inputFirstVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputFirstVolume %s", + "help_string": "Input image (1) for mixture optimization", + "exists": "True", + }, + ), + ), + ( + "inputSecondVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputSecondVolume %s", + "help_string": "Input image (2) for mixture optimization", + "exists": "True", + }, + ), + ), + ( + "inputMaskVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputMaskVolume %s", + "help_string": "Input label image for mixture optimization", + "exists": "True", + }, + ), + ), + ( + "outputWeightsFile", + attr.ib( + type=File, + metadata={ + "argstr": "--outputWeightsFile %s", + "help_string": "Output Weights File", + "hash_files": "False", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "The MUSH image produced from the T1 and T2 weighted images", + "hash_files": "False", + }, + ), + ), + ( + "outputMask", + attr.ib( + type=File, + metadata={ + "argstr": "--outputMask %s", + "help_string": "The brain volume mask generated from the MUSH image", + "hash_files": "False", + }, + ), + ), + ( + "seed", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--seed %s", + "help_string": "Seed Point for Brain Region Filling", + "sep": ",", + }, + ), + ), + ( + "desiredMean", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--desiredMean %f", + "help_string": "Desired mean within the mask for weighted sum of both images.", + }, + ), + ), + ( + "desiredVariance", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--desiredVariance %f", + "help_string": "Desired variance within the mask for weighted sum of both images.", + }, + ), + ), + ( + "lowerThresholdFactorPre", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--lowerThresholdFactorPre %f", + "help_string": "Lower threshold factor for finding an initial brain mask", + }, + ), + ), + ( + "upperThresholdFactorPre", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--upperThresholdFactorPre %f", + "help_string": "Upper threshold factor for finding an initial brain mask", + }, + ), + ), + ( + "lowerThresholdFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--lowerThresholdFactor %f", + "help_string": "Lower threshold factor for defining the brain mask", + }, + ), + ), + ( + "upperThresholdFactor", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--upperThresholdFactor %f", + "help_string": "Upper threshold factor for defining the brain mask", + }, + ), + ), + ( + "boundingBoxSize", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--boundingBoxSize %s", + "help_string": "Size of the cubic bounding box mask used when no brain mask is present", + "sep": ",", + }, + ), + ), + ( + "boundingBoxStart", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--boundingBoxStart %s", + "help_string": "XYZ point-coordinate for the start of the cubic bounding box mask used when no brain mask is present", + "sep": ",", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputWeightsFile", + attr.ib( + type=File, + metadata={"help_string": "Output Weights File", "exists": "True"}, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "The MUSH image produced from the T1 and T2 weighted images", + "exists": "True", + }, + ), + ), + ( + "outputMask", + attr.ib( + type=File, + metadata={ + "help_string": "The brain volume mask generated from the MUSH image", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSMush", + executable=" BRAINSMush ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSSnapShotWriter: + """ + title: BRAINSSnapShotWriter + category: Utilities.BRAINS + description: Create 2D snapshot of input images. Mask images are color-coded + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Eunyoung Regina Kim + """ + + input_fields = [ + ( + "inputVolumes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputVolumes %s...", + "help_string": "Input image volume list to be extracted as 2D image. Multiple input is possible. At least one input is required.", + }, + ), + ), + ( + "inputBinaryVolumes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputBinaryVolumes %s...", + "help_string": "Input mask (binary) volume list to be extracted as 2D image. Multiple input is possible.", + }, + ), + ), + ( + "inputSliceToExtractInPhysicalPoint", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputSliceToExtractInPhysicalPoint %s", + "help_string": "2D slice number of input images. For autoWorkUp output, which AC-PC aligned, 0,0,0 will be the center.", + "sep": ",", + }, + ), + ), + ( + "inputSliceToExtractInIndex", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputSliceToExtractInIndex %s", + "help_string": "2D slice number of input images. For size of 256*256*256 image, 128 is usually used.", + "sep": ",", + }, + ), + ), + ( + "inputSliceToExtractInPercent", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputSliceToExtractInPercent %s", + "help_string": "2D slice number of input images. Percentage input from 0%-100%. (ex. --inputSliceToExtractInPercent 50,50,50", + "sep": ",", + }, + ), + ), + ( + "inputPlaneDirection", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputPlaneDirection %s", + "help_string": "Plane to display. In general, 0=saggital, 1=coronal, and 2=axial plane.", + "sep": ",", + }, + ), + ), + ( + "outputFilename", + attr.ib( + type=File, + metadata={ + "argstr": "--outputFilename %s", + "help_string": "2D file name of input images. Required.", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputFilename", + attr.ib( + type=File, + metadata={ + "help_string": "2D file name of input images. Required.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSSnapShotWriter", + executable=" BRAINSSnapShotWriter ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSTransformConvert: + """ + title: BRAINS Transform Convert + category: Utilities.BRAINS + description: Convert ITK transforms to higher order transforms + version: 5.2.0 + documentation-url: A utility to convert between transform file formats. + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Hans J. Johnson,Kent Williams, Ali Ghayoor + """ + + input_fields = [ + ( + "inputTransform", + attr.ib( + type=File, metadata={"argstr": "--inputTransform %s", "exists": "True"} + ), + ), + ( + "referenceVolume", + attr.ib( + type=File, metadata={"argstr": "--referenceVolume %s", "exists": "True"} + ), + ), + ( + "outputTransformType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--outputTransformType %s", + "help_string": "The target transformation type. Must be conversion-compatible with the input transform type", + }, + ), + ), + ( + "outputPrecisionType", + attr.ib( + type=traits.Enum, + metadata={ + "argstr": "--outputPrecisionType %s", + "help_string": "Precision type of the output transform. It can be either single precision or double precision", + }, + ), + ), + ( + "displacementVolume", + attr.ib( + type=File, + metadata={"argstr": "--displacementVolume %s", "hash_files": "False"}, + ), + ), + ( + "outputTransform", + attr.ib( + type=File, + metadata={"argstr": "--outputTransform %s", "hash_files": "False"}, + ), + ), + ] + output_fields = [ + ("displacementVolume", attr.ib(type=File, metadata={"exists": "True"})), + ("outputTransform", attr.ib(type=File, metadata={"exists": "True"})), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSTransformConvert", + executable=" BRAINSTransformConvert ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class BRAINSTrimForegroundInDirection: + """ + title: Trim Foreground In Direction (BRAINS) + category: Utilities.BRAINS + description: This program will trim off the neck and also air-filling noise from the inputImage. + version: 5.2.0 + documentation-url: http://www.nitrc.org/projects/art/ + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Input image to trim off the neck (and also air-filling noise.)", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Output image with neck and air-filling noise trimmed isotropic image with AC at center of image.", + "hash_files": "False", + }, + ), + ), + ( + "directionCode", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--directionCode %d", + "help_string": ", This flag chooses which dimension to compare. The sign lets you flip direction., ", + }, + ), + ), + ( + "otsuPercentileThreshold", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--otsuPercentileThreshold %f", + "help_string": ", This is a parameter to FindLargestForegroundFilledMask, which is employed to trim off air-filling noise., ", + }, + ), + ), + ( + "closingSize", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--closingSize %d", + "help_string": ", This is a parameter to FindLargestForegroundFilledMask, ", + }, + ), + ), + ( + "headSizeLimit", + attr.ib( + type=traits.Float, + metadata={ + "argstr": "--headSizeLimit %f", + "help_string": ", Use this to vary from the command line our search for how much upper tissue is head for the center-of-mass calculation. Units are CCs, not cubic millimeters., ", + }, + ), + ), + ( + "BackgroundFillValue", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--BackgroundFillValue %s", + "help_string": "Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number.", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "help_string": "Output image with neck and air-filling noise trimmed isotropic image with AC at center of image.", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSTrimForegroundInDirection", + executable=" BRAINSTrimForegroundInDirection ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class FindCenterOfBrain: + """ + title: Center Of Brain (BRAINS) + category: Utilities.BRAINS + description: Finds the center point of a brain + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu + acknowledgements: Hans Johnson(1,3,4); Kent Williams(1); (1=University of Iowa Department of Psychiatry, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "The image in which to find the center.", + "exists": "True", + }, + ), + ), + ( + "imageMask", + attr.ib(type=File, metadata={"argstr": "--imageMask %s", "exists": "True"}), + ), + ( + "clippedImageMask", + attr.ib( + type=File, + metadata={"argstr": "--clippedImageMask %s", "hash_files": "False"}, + ), + ), + ("maximize", attr.ib(type=traits.Bool, metadata={"argstr": "--maximize "})), + ("axis", attr.ib(type=traits.Int, metadata={"argstr": "--axis %d"})), + ( + "otsuPercentileThreshold", + attr.ib( + type=traits.Float, metadata={"argstr": "--otsuPercentileThreshold %f"} + ), + ), + ( + "closingSize", + attr.ib(type=traits.Int, metadata={"argstr": "--closingSize %d"}), + ), + ( + "headSizeLimit", + attr.ib(type=traits.Float, metadata={"argstr": "--headSizeLimit %f"}), + ), + ( + "headSizeEstimate", + attr.ib(type=traits.Float, metadata={"argstr": "--headSizeEstimate %f"}), + ), + ( + "backgroundValue", + attr.ib(type=traits.Int, metadata={"argstr": "--backgroundValue %d"}), + ), + ( + "generateDebugImages", + attr.ib(type=traits.Bool, metadata={"argstr": "--generateDebugImages "}), + ), + ( + "debugDistanceImage", + attr.ib( + type=File, + metadata={"argstr": "--debugDistanceImage %s", "hash_files": "False"}, + ), + ), + ( + "debugGridImage", + attr.ib( + type=File, + metadata={"argstr": "--debugGridImage %s", "hash_files": "False"}, + ), + ), + ( + "debugAfterGridComputationsForegroundImage", + attr.ib( + type=File, + metadata={ + "argstr": "--debugAfterGridComputationsForegroundImage %s", + "hash_files": "False", + }, + ), + ), + ( + "debugClippedImageMask", + attr.ib( + type=File, + metadata={ + "argstr": "--debugClippedImageMask %s", + "hash_files": "False", + }, + ), + ), + ( + "debugTrimmedImage", + attr.ib( + type=File, + metadata={"argstr": "--debugTrimmedImage %s", "hash_files": "False"}, + ), + ), + ] + output_fields = [ + ("clippedImageMask", attr.ib(type=File, metadata={"exists": "True"})), + ("debugDistanceImage", attr.ib(type=File, metadata={"exists": "True"})), + ("debugGridImage", attr.ib(type=File, metadata={"exists": "True"})), + ( + "debugAfterGridComputationsForegroundImage", + attr.ib(type=File, metadata={"exists": "True"}), + ), + ("debugClippedImageMask", attr.ib(type=File, metadata={"exists": "True"})), + ("debugTrimmedImage", attr.ib(type=File, metadata={"exists": "True"})), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="FindCenterOfBrain", + executable=" FindCenterOfBrain ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class GenerateLabelMapFromProbabilityMap: + """ + title: Label Map from Probability Images + category: Utilities.BRAINS + description: Given a list of probability maps for labels, create a discrete label map where only the highest probability region is used for the labeling. + version: 5.2.0 + contributor: University of Iowa Department of Psychiatry, http:://www.psychiatry.uiowa.edu + """ + + input_fields = [ + ( + "inputVolumes", + attr.ib( + type=InputMultiPath, + metadata={ + "argstr": "--inputVolumes %s...", + "help_string": "The Input probaiblity images to be computed for lable maps", + }, + ), + ), + ( + "outputLabelVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLabelVolume %s", + "help_string": "The Input binary image for region of interest", + "hash_files": "False", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "outputLabelVolume", + attr.ib( + type=File, + metadata={ + "help_string": "The Input binary image for region of interest", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="GenerateLabelMapFromProbabilityMap", + executable=" GenerateLabelMapFromProbabilityMap ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class fcsv_to_hdf5: + """ + title: fcsv_to_hdf5 (BRAINS) + category: Utilities.BRAINS + description: Convert a collection of fcsv files to a HDF5 format file + """ + + input_fields = [ + ( + "versionID", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--versionID %s", + "help_string": ", Current version ID. It should be match with the version of BCD that will be using the output model file, ", + }, + ), + ), + ( + "landmarksInformationFile", + attr.ib( + type=File, + metadata={ + "argstr": "--landmarksInformationFile %s", + "help_string": ", name of HDF5 file to write matrices into, ", + "hash_files": "False", + }, + ), + ), + ( + "landmarkTypesList", + attr.ib( + type=File, + metadata={ + "argstr": "--landmarkTypesList %s", + "help_string": ", file containing list of landmark types, ", + "exists": "True", + }, + ), + ), + ( + "modelFile", + attr.ib( + type=File, + metadata={ + "argstr": "--modelFile %s", + "help_string": ", name of HDF5 file containing BRAINSConstellationDetector Model file (LLSMatrices, LLSMeans and LLSSearchRadii), ", + "hash_files": "False", + }, + ), + ), + ( + "landmarkGlobPattern", + attr.ib( + type=traits.Str, + metadata={ + "argstr": "--landmarkGlobPattern %s", + "help_string": "Glob pattern to select fcsv files", + }, + ), + ), + ( + "numberOfThreads", + attr.ib( + type=traits.Int, + metadata={ + "argstr": "--numberOfThreads %d", + "help_string": "Explicitly specify the maximum number of threads to use.", + }, + ), + ), + ] + output_fields = [ + ( + "landmarksInformationFile", + attr.ib( + type=File, + metadata={ + "help_string": ", name of HDF5 file to write matrices into, ", + "exists": "True", + }, + ), + ), + ( + "modelFile", + attr.ib( + type=File, + metadata={ + "help_string": ", name of HDF5 file containing BRAINSConstellationDetector Model file (LLSMatrices, LLSMeans and LLSSearchRadii), ", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="fcsv_to_hdf5", + executable=" fcsv_to_hdf5 ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class insertMidACPCpoint: + """ + title: MidACPC Landmark Insertion + category: Utilities.BRAINS + description: 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 + version: 5.2.0 + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputLandmarkFile", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarkFile %s", + "help_string": "Input landmark file (.fcsv)", + "exists": "True", + }, + ), + ), + ( + "outputLandmarkFile", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLandmarkFile %s", + "help_string": "Output landmark file (.fcsv)", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputLandmarkFile", + attr.ib( + type=File, + metadata={ + "help_string": "Output landmark file (.fcsv)", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="insertMidACPCpoint", + executable=" insertMidACPCpoint ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class landmarksConstellationAligner: + """ + title: MidACPC Landmark Insertion + category: Utilities.BRAINS + description: This program converts the original landmark files to the acpc-aligned landmark files + version: 5.2.0 + contributor: Ali Ghayoor + """ + + input_fields = [ + ( + "inputLandmarksPaired", + attr.ib( + type=File, + metadata={ + "argstr": "--inputLandmarksPaired %s", + "help_string": "Input landmark file (.fcsv)", + "exists": "True", + }, + ), + ), + ( + "outputLandmarksPaired", + attr.ib( + type=File, + metadata={ + "argstr": "--outputLandmarksPaired %s", + "help_string": "Output landmark file (.fcsv)", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputLandmarksPaired", + attr.ib( + type=File, + metadata={ + "help_string": "Output landmark file (.fcsv)", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="landmarksConstellationAligner", + executable=" landmarksConstellationAligner ", + input_spec=input_spec, + output_spec=output_spec, + ) + + +class landmarksConstellationWeights: + """ + title: Generate Landmarks Weights (BRAINS) + category: Utilities.BRAINS + description: Train up a list of Weights for the Landmarks in BRAINSConstellationDetector + """ + + input_fields = [ + ( + "inputTrainingList", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTrainingList %s", + "help_string": ", Setup file, giving all parameters for training up a Weight list for landmark., ", + "exists": "True", + }, + ), + ), + ( + "inputTemplateModel", + attr.ib( + type=File, + metadata={ + "argstr": "--inputTemplateModel %s", + "help_string": "User-specified template model., ", + "exists": "True", + }, + ), + ), + ( + "LLSModel", + attr.ib( + type=File, + metadata={ + "argstr": "--LLSModel %s", + "help_string": "Linear least squares model filename in HD5 format", + "exists": "True", + }, + ), + ), + ( + "outputWeightsList", + attr.ib( + type=File, + metadata={ + "argstr": "--outputWeightsList %s", + "help_string": ", The filename of a csv file which is a list of landmarks and their corresponding weights., ", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputWeightsList", + attr.ib( + type=File, + metadata={ + "help_string": ", The filename of a csv file which is a list of landmarks and their corresponding weights., ", + "exists": "True", + }, + ), + ) + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="landmarksConstellationWeights", + executable=" landmarksConstellationWeights ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/pydra/tasks/sem/utilities/brainsstriprotation.py b/pydra/tasks/sem/utilities/brainsstriprotation.py new file mode 100644 index 0000000..004ce3a --- /dev/null +++ b/pydra/tasks/sem/utilities/brainsstriprotation.py @@ -0,0 +1,91 @@ +""" +Autogenerated file - DO NOT EDIT +If you spot a bug, please report it on the mailing list and/or change the generator. +""" + +import attr +from nipype.interfaces.base import ( + Directory, + File, + InputMultiPath, + OutputMultiPath, + traits, +) +from pydra import ShellCommandTask +from pydra.engine.specs import SpecInfo, ShellSpec + + +class BRAINSStripRotation: + """ + title: BRAINS Strip Rotation + category: Utilities + description: Read an Image, write out same image with identity rotation matrix plus an ITK transform file + version: 5.2.0 + license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + contributor: Kent WIlliams + """ + + input_fields = [ + ( + "inputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--inputVolume %s", + "help_string": "Image To Warp", + "exists": "True", + }, + ), + ), + ( + "outputVolume", + attr.ib( + type=File, + metadata={ + "argstr": "--outputVolume %s", + "help_string": "Resulting deformed image", + "hash_files": "False", + }, + ), + ), + ( + "transform", + attr.ib( + type=File, + metadata={ + "argstr": "--transform %s", + "help_string": "Filename for the transform file", + "hash_files": "False", + }, + ), + ), + ] + output_fields = [ + ( + "outputVolume", + attr.ib( + type=File, + metadata={"help_string": "Resulting deformed image", "exists": "True"}, + ), + ), + ( + "transform", + attr.ib( + type=File, + metadata={ + "help_string": "Filename for the transform file", + "exists": "True", + }, + ), + ), + ] + + input_spec = SpecInfo(name="Input", fields=input_fields, bases=(ShellSpec,)) + output_spec = SpecInfo(name="Output", fields=output_fields, bases=(ShellSpec,)) + + task = ShellCommandTask( + name="BRAINSStripRotation", + executable=" BRAINSStripRotation ", + input_spec=input_spec, + output_spec=output_spec, + ) diff --git a/setup.cfg b/setup.cfg index 4265f47..01964ac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,10 @@ [DEFAULT] -subpackage = TODO +subpackage = sem [metadata] -author = TODO -author_email = TODO -description = TODO +author = Hans Johnson, Michal Brzus, Benjamin Gorman, Chase Johnson +author_email = hans-johnson@uiowa.edu, michal-brzus@uiowa.edu, benjamin-gorman@uiowa.edu, charles-e-johnson@uiowa.edu +description = sem (Slicer Execution Model) functions wrapped in pydra tasks [options] python_requires = >=3.7 diff --git a/setup.py b/setup.py index aebce26..06ef33a 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ if __name__ == "__main__": setup( - name="pydra-TODO", + name="pydra-sem", setup_requires=SETUP_REQUIRES, version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000..9149f46 --- /dev/null +++ b/tools/README.md @@ -0,0 +1,23 @@ +### Contents + +* `xmls`: a directory containing all the xmls from which pydra tasks should be generated. +* `generate_tasks.py`: the script which automatically generates pydra tasks. + +### How to use + +`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] +``` + +* `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. + +### Command to use + +```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..cf37c3f --- /dev/null +++ b/tools/generate_tasks.py @@ -0,0 +1,717 @@ +""" +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\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()) +""" + +template = """\ +class {module_name}(): + \""" +{docstring}\ + \""" + + 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=(ShellSpec,)) + + task = ShellCommandTask( + name="{module_name}", + executable="{launcher} {module} ", + input_spec=input_spec, + output_spec=output_spec, + ) +""" + + +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", ", ") + ) + + 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 = "InputMultiPath" + 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": + type = "InputMultiPath" + 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["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" + ): + 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.pop("hash_files") + outputTraits.append( + '("{name}", attr.ib(type={type}, metadata={{{params}}}))'.format( + name=name, + type=type.replace("Input", "Output"), + 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.

]]>
+ 1.0 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ACPCTransform + slicer3 + Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + + + + + + ACPC + + --acpc + + 0,0,0 + + + Midline + + --midline + + 0,0,0 + + + OutputTransform + --outputTransform + + + output + + +
diff --git a/tools/xmls/AddScalarVolumes.xml b/tools/xmls/AddScalarVolumes.xml new file mode 100644 index 0000000..63f08fb --- /dev/null +++ b/tools/xmls/AddScalarVolumes.xml @@ -0,0 +1,51 @@ + + + Filtering.Arithmetic + Add Scalar Volumes + + 0.1.0.$Revision$(alpha) + https://www.slicer.org/wiki/Documentation/Nightly/Modules/Add + + Bill Lorensen (GE) + + + + + + inputVolume1 + + input + 0 + + + + inputVolume2 + + input + 1 + + + + outputVolume + + output + 2 + + + + + + + + order + + 1 + 0 + 1 + 2 + 3 + order + + + + diff --git a/tools/xmls/BRAINSABC.xml b/tools/xmls/BRAINSABC.xml new file mode 100644 index 0000000..94d968c --- /dev/null +++ b/tools/xmls/BRAINSABC.xml @@ -0,0 +1,331 @@ + + + + Segmentation.Specialized + Intra-subject registration, bias Correction, and tissue classification (BRAINS) + Atlas-based tissue segmentation method. This is an algorithmic extension of work done by XXXX at UNC and Utah XXXX need more description here. + + + + + + Input parameters + + + input_Volumes + + inputVolumes + i + input + The list of input image files to be segmented. + + + atlasDefinition + + atlasDefinition + input + + Contains all parameters for Atlas + + + restoreState + restoreState + + The initial state for the registration process + input + + + saveState + saveState + + (optional) Filename to which save the final state of the registration + output + + + + + input_VolumeTypes + + The list of input image types corresponding to the inputVolumes. + inputVolumeTypes + + + + outputDir + + + outputDir + output + Ouput directory + + + + + atlasToSubjectTransformType + + atlasToSubjectTransformType + What type of linear transform type do you want to use to register the atlas to the reference subject image. + Identity + Rigid + Affine + BSpline + SyN + SyN + + + atlasToSubjectTransform + + The transform from atlas to the subject + atlasToSubjectTransform + output + + + atlasToSubjectInitialTransform + + The initial transform from atlas to the subject + atlasToSubjectInitialTransform + output + + + subjectIntermodeTransformType + + subjectIntermodeTransformType + What type of transform type do you want to run intra subject registeration. Only Identity and Rigid are allowed. + Identity + Rigid + Rigid + + + + + Output filename specifications + + output_Volumes + + outputVolumes + output + %s_corrected_%d.nii.gz + Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location. + + + + outputLabels + + outputLabels + output + + Output Label Image + + + + outputDirtyLabels + + outputDirtyLabels + output + + Output Dirty Label Image + + + + posteriorTemplate + + posteriorTemplate + POST_%s.nii.gz + filename template for Posterior output files + + + + + Advanced parameters for the creation of the segmentation file + + + outputFormat + outputFormat + Output format + NIFTI + Meta + Nrrd + NIFTI + + + + resamplerInterpolatorType + interpolationMode + Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation. + BSpline + NearestNeighbor + WindowedSinc + Linear + ResampleInPlace + BSpline + Hamming + Cosine + Welch + Lanczos + Blackman + + + maxIterations + Filter iterations + + maxIterations + 40 + + 1 + 100 + 1 + + + + + + medianFilterSize + medianFilterSize + + The radius for the optional MedianImageFilter preprocessing in all 3 directions. + 0,0,0 + + + filterIteration + Filter iterations + + filterIteration + 5 + + 0 + 50 + 1 + + + + filterTimeStep + Filter time step should be less than (PixelSpacing/(1^(DIM+1)), value is set to negative, then allow automatic setting of this value. + + filterTimeStep + -1.0 + + 0 + 0.5 + 0.01 + + + + filterMethod + + filterMethod + Filter method for preprocessing of registration + None + CurvatureFlow + GradientAnisotropicDiffusion + Median + None + + + + maxBiasDegree + Maximum bias degree + + maxBiasDegree + 4 + + 0 + 20 + 1 + + + + + useKNN + Use the KNN stage of estimating posteriors. + + useKNN + false + + + + purePlugsThreshold + purePlugsThreshold + + input + If this threshold value is greater than zero, only pure samples are used to compute the distributions in EM classification, and only pure samples are used for KNN training. The default value is set to 0, that means not using pure plugs. However, a value between 0 and 1 should be set as the threshold if you want to activate using pure plugs option. Empirically a value of 0.1 is suggested. + 0.0 + + + + numberOfSubSamplesInEachPlugArea + numberOfSubSamplesInEachPlugArea + + input + Number of continous index samples taken at each direction of lattice space for each plug volume. + 0,0,0 + + + + atlasWarpingOff + false + + atlasWarpingOff + Deformable registration of atlas to subject + + + gridSize + Grid size for atlas warping with BSplines + + gridSize + 5,5,5 + + + + + + + + defaultSuffix + + s + defaultSuffix + BRAINSABC + + + + + + + Options + + + implicitOutputs + + Outputs to be made available to NiPype. Needed because not all BRAINSABC outputs have command line arguments. + implicitOutputs + output + + + + debuglevel + + Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging. + debuglevel + 0 + + + + writeLess + + Does not write posteriors and filtered, bias corrected images + writeLess + false + + + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + + diff --git a/tools/xmls/BRAINSAlignMSP.xml b/tools/xmls/BRAINSAlignMSP.xml new file mode 100644 index 0000000..c43acc7 --- /dev/null +++ b/tools/xmls/BRAINSAlignMSP.xml @@ -0,0 +1,138 @@ + + + Utilities.BRAINS + Align Mid Saggital Brain (BRAINS) + Resample an image into ACPC alignement ACPCDetect + + + inputVolume + + i + inputVolume + + + The Image to be resampled + + input + + + resampleMSP + + o + OutputresampleMSP + + + The image to be output. + + output + + + verbose + + v + verbose + false + + Show more verbose output + + + + resultsDir + + r + resultsDir + ./ + + The directory for the results to be written. + + output + + + writedebuggingImagesLevel + + writedebuggingImagesLevel + w + + This flag controls if debugging images are produced. By default value of 0 is no images. Anything greater than zero will be increasing level of debugging images. + + 0 + + + mspQualityLevel + + mspQualityLevel + q + + Flag cotrols how agressive the MSP is estimated. 0=quick estimate (9 seconds), 1=normal estimate (11 seconds), 2=great estimate (22 seconds), 3=best estimate (58 seconds). + + 2 + + 0 + 3 + 1 + + + + rescaleIntensities + + rescaleIntensities + n + + Flag to turn on rescaling image intensities on input. + + 0 + + + trimRescaledIntensities + + trimRescaledIntensities + x + + Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean. + + 4.4172 + + + rescaleIntensitiesOutputRange + + rescaleIntensitiesOutputRange + y + + This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue. + + 40,4000 + + + backgroundFillValueString + BackgroundFillValue + z + Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number. + + 0 + + + interpolationMode + interpolationMode + + Type of interpolation to be used when applying transform to moving volume. Options are Linear, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc + Linear + NearestNeighbor + Linear + ResampleInPlace + BSpline + WindowedSinc + Hamming + Cosine + Welch + Lanczos + Blackman + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSCleanMask.xml b/tools/xmls/BRAINSCleanMask.xml new file mode 100644 index 0000000..d66a995 --- /dev/null +++ b/tools/xmls/BRAINSCleanMask.xml @@ -0,0 +1,37 @@ + + + + Segmentation.Specialized + Mask Hole Filling (BRAINS) + Cleans up a mask image by filling any holes + + + + inputVolume + + --inputVolume + i + input + The mask image to be cleaned up. + + + outputVolume + + --outputVolume + o + output + The cleaned mask image. + + + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + + diff --git a/tools/xmls/BRAINSClipInferior.xml b/tools/xmls/BRAINSClipInferior.xml new file mode 100644 index 0000000..ee30160 --- /dev/null +++ b/tools/xmls/BRAINSClipInferior.xml @@ -0,0 +1,54 @@ + + + Utilities.BRAINS + Clip Inferior of Center of Brain (BRAINS) + This program will read the inputVolume as a short int image, write the BackgroundFillValue everywhere inferior to the lower bound, and write the resulting clipped short int image in the outputVolume. + + + 5.2.0 + + + inputVolume + i + inputVolume + + Input image to make a clipped short int copy from. + input + + + + outputVolume + o + outputVolume + + Output image, a short int copy of the upper portion of the input image, filled with BackgroundFillValue. + output + + + + acLowerBound + + acLowerBound + b + + When the input image to the output image, replace the image with the BackgroundFillValue everywhere below the plane This Far in physical units (millimeters) below (inferior to) the AC point (assumed to be the voxel field middle.) The oversize default was chosen to have no effect. Based on visualizing a thousand masks in the IPIG study, we recommend a limit no smaller than 80.0 mm. + + 1000.0 + + + backgroundFillValueString + BackgroundFillValue + z + Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number. + + 0 + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSConstellationDetector.xml b/tools/xmls/BRAINSConstellationDetector.xml new file mode 100644 index 0000000..6379991 --- /dev/null +++ b/tools/xmls/BRAINSConstellationDetector.xml @@ -0,0 +1,402 @@ + + + Segmentation.Specialized + Brain Landmark Constellation Detector (BRAINS) + + This program will find the mid-sagittal plane, a constellation of landmarks in a volume, and create an AC/PC aligned data set with the AC point at the center of the voxel lattice (labeled at the origin of the image physical space.) Part of this work is an extention of the algorithms originally described by Dr. Babak A. Ardekani, Alvin H. Bachman, Model-based automatic detection of the anterior and posterior commissures on MRI scans, NeuroImage, Volume 46, Issue 3, 1 July 2009, Pages 677-682, ISSN 1053-8119, DOI: 10.1016/j.neuroimage.2009.02.030. (http://www.sciencedirect.com/science/article/B6WNP-4VRP25C-4/2/8207b962a38aa83c822c6379bc43fe4c) + + Hans J. Johnson (hans-johnson -at- uiowa.edu), Ali Ghayoor + + 5.2.0 + http://www.nitrc.org/projects/brainscdetector/ + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + + + + houghEyeDetectorMode + + houghEyeDetectorMode + + This flag controls the mode of Hough eye detector. By default, value of 1 is for T1W images, while the value of 0 is for T2W and PD images. + + 1 + + + inputTemplateModel + + + inputTemplateModel + User-specified template model. + + input + + + llsModel + + + LLSModel + Linear least squares model filename in HD5 format + input + + + inputVolume + i + inputVolume + + Input image in which to find ACPC points + input + + + + outputVolume + o + outputVolume + + ACPC-aligned output image with the same voxels as the input image, but updated origin, and direction cosign so that the AC point would fall at the physical location (0.0,0.0,0.0), and the mid-sagital plane is the plane where physical L/R coordinate is 0.0. No interpolation method is involved to create the "outputVolume", and this output image is created using "resample in place" filter. + output + + + + outputResampledVolume + outputResampledVolume + + ACPC-aligned output image in a resampled uniform isotropic space. Currently this is a 1mm, 256^3 image with identity direction cosign. Choose desired interpolation mode to generate the outputResampledVolume. + output + + + + outputTransform + + + outputTransform + The filename for the original space to ACPC alignment to be written (in .h5 format). + + output + + + outputLandmarksInInputSpace + + outputLandmarksInInputSpace + + + The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (.fcsv) with the landmarks in the original image space (the detected RP, AC, PC, and VN4) in it to be written. + + output + + + outputLandmarksInACPCAlignedSpace + + outputLandmarksInACPCAlignedSpace + + + The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (.fcsv) with the landmarks in the output image space (the detected RP, AC, PC, and VN4) in it to be written. + + output + + + outputMRML + + outputMRML + + + The filename for the new subject-specific scene definition file in the same format produced by Slicer3 (in .mrml format). Only the components that were specified by the user on command line would be generated. Compatible components include inputVolume, outputVolume, outputLandmarksInInputSpace, outputLandmarksInACPCAlignedSpace, and outputTransform. + + output + + + outputVerificationScript + + outputVerificationScript + + + The filename for the Slicer3 script that verifies the aligned landmarks against the aligned image file. This will happen only in conjunction with saveOutputLandmarks and an outputVolume. + + output + + + mspQualityLevel + + mspQualityLevel + + Flag cotrols how agressive the MSP is estimated. 0=quick estimate (9 seconds), 1=normal estimate (11 seconds), 2=great estimate (22 seconds), 3=best estimate (58 seconds), NOTE: -1= Prealigned so no estimate!. + + 2 + + -1 + 3 + 1 + + + + otsuPercentileThreshold + + otsuPercentileThreshold + + This is a parameter to FindLargestForegroundFilledMask, which is employed when acLowerBound is set and an outputUntransformedClippedVolume is requested. + + 0.01 + + + acLowerBound + + acLowerBound + + When generating a resampled output image, replace the image with the BackgroundFillValue everywhere below the plane This Far in physical units (millimeters) below (inferior to) the AC point (as found by the model.) The oversize default was chosen to have no effect. Based on visualizing a thousand masks in the IPIG study, we recommend a limit no smaller than 80.0 mm. + + 1000.0 + + + cutOutHeadInOutputVolume + + cutOutHeadInOutputVolume + + Flag to cut out just the head tissue when producing an (un)transformed clipped volume. + + false + + + outputUntransformedClippedVolume + outputUntransformedClippedVolume + + Output image in which to store neck-clipped input image, with the use of --acLowerBound and maybe --cutOutHeadInUntransformedVolume. + output + + + + rescaleIntensities + + rescaleIntensities + + Flag to turn on rescaling image intensities on input. + + false + + + trimRescaledIntensities + + trimRescaledIntensities + + Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean. + + 4.4172 + + + rescaleIntensitiesOutputRange + + rescaleIntensitiesOutputRange + + This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue. + + 40,4000 + + + backgroundFillValueString + BackgroundFillValue + Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number. + + 0 + + + interpolationMode + interpolationMode + + Type of interpolation to be used when applying transform to moving volume to create OutputResampledVolume. Options are Linear, NearestNeighbor, BSpline, or WindowedSinc + Linear + NearestNeighbor + Linear + BSpline + WindowedSinc + Hamming + Cosine + Welch + Lanczos + Blackman + + + + + Manually force the location of the points in original image space. + + forceACPoint + + forceACPoint + + Manually specify the AC point from the original image in RAS coordinates (i.e. Slicer coordinates). + + + + + forcePCPoint + + forcePCPoint + + Manually specify the PC point from the original image in RAS coordinates (i.e. Slicer coordinates). + + + + + forceVN4Point + + forceVN4Point + + Manually specify the VN4 point from the original image in RAS coordinates (i.e. Slicer coordinates). + + + + + forceRPPoint + + forceRPPoint + + Manually specify the RP point from the original image in RAS coordinates (i.e. Slicer coordinates). + + + + + inputLandmarksEMSP + + inputLandmarksEMSP + + + The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (in .fcsv) with the landmarks in the estimated MSP aligned space to be loaded. The detector will only process landmarks not enlisted on the file. + + input + + + forceHoughEyeDetectorReportFailure + + forceHoughEyeDetectorReportFailure + + Flag indicates whether the Hough eye detector should report failure + + false + + + + + Override the default values from the model files. + + radiusMPJ + rmpj + + Search radius for MPJ in unit of mm + + -1 + + + radiusAC + rac + + Search radius for AC in unit of mm + + -1 + + + radiusPC + rpc + + Search radius for PC in unit of mm + + -1 + + + radiusVN4 + rVN4 + + Search radius for VN4 in unit of mm + + -1 + + + + + Options to control the amount of debugging information that is presented. + + debug + + debug + false + + Show internal debugging information. + + + + verbose + + v + verbose + false + + Show more verbose output + + + + writeBranded2DImage + + writeBranded2DImage + + + The filename for the 2D .png branded midline debugging image. This will happen only in conjunction with requesting an outputVolume. + + output + + + resultsDir + + r + resultsDir + ./ + + The directory for the debuging images to be written. + + output + + + writedebuggingImagesLevel + + writedebuggingImagesLevel + w + + This flag controls if debugging images are produced. By default value of 0 is no images. Anything greater than zero will be increasing level of debugging images. + + 0 + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + atlasVolume + atlasVolume + + Atlas volume image to be used for BRAINSFit registration to redefine the final ACPC-aligned transform by registering original input image to the Atlas image. The initial registration transform is created by passing BCD_ACPC_Landmarks and atlasLandmarks to BRAINSLandmarkInitializer. This flag should be used with atlasLandmarks and atlasLandmarkWeights flags. Note that using this flag causes that AC point in the final acpcLandmark file not be exactly placed at 0,0,0 coordinates. + + input + + + + + atlasLandmarks + + + atlasLandmarks + Atlas landmarks to be used for BRAINSFit registration initialization + + input + + + + atlasLandmarkWeights + + + atlasLandmarkWeights + Weights associated with atlas landmarks to be used for BRAINSFit registration initialization + + input + + + + diff --git a/tools/xmls/BRAINSConstellationDetectorGUI.xml b/tools/xmls/BRAINSConstellationDetectorGUI.xml new file mode 100644 index 0000000..4155d52 --- /dev/null +++ b/tools/xmls/BRAINSConstellationDetectorGUI.xml @@ -0,0 +1,44 @@ + + + Utilities.BRAINS + ConstellationDetectorGUI (BRAINS) + + This program provides the user with a GUI tool to view/manipulate landmarks for an input volume. + + + 5.2.0 + http://www.nitrc.org/projects/brainscdetector/ + + + inputVolume + i + inputVolume + + The filename of the input NIfTI volume to view/manipulate + input + + + + inputLandmarks + + l + inputLandmarks + + + The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (in a .fcsv format) with the landmarks in the original image space in it to be read in. + + input + + + outputLandmarks + + o + outputLandmarks + + + The filename for the new subject-specific landmark definition file in the same format produced by Slicer3 (in a .fcsv format) with the landmarks in the original image space in it to be written. + + input + + + diff --git a/tools/xmls/BRAINSConstellationLandmarksTransform.xml b/tools/xmls/BRAINSConstellationLandmarksTransform.xml new file mode 100644 index 0000000..7d15d60 --- /dev/null +++ b/tools/xmls/BRAINSConstellationLandmarksTransform.xml @@ -0,0 +1,48 @@ + + + Utilities.BRAINS + Landmarks Transformation + + This program converts the original landmark file to the target landmark file using the input transform. + + 5.2.0 + + + Ali Ghayoor + + + + + + Input/output parameters + + + inputLandmarksFile + i + inputLandmarksFile + + input + Input landmarks file (.fcsv) + + + + inputTransformFile + t + inputTransformFile + + input + input composite transform file (.h5,.hdf5) + + + + outputLandmarksFile + o + outputLandmarksFile + + output + Output landmarks file (.fcsv) + + + + + diff --git a/tools/xmls/BRAINSConstellationModeler.xml b/tools/xmls/BRAINSConstellationModeler.xml new file mode 100644 index 0000000..e5b725d --- /dev/null +++ b/tools/xmls/BRAINSConstellationModeler.xml @@ -0,0 +1,139 @@ + + + Utilities.BRAINS + Generate Landmarks Model (BRAINS) + Train up a model for BRAINSConstellationDetector + + + verbose + + v + verbose + false + + Show more verbose output + + + + inputTrainingList + i + inputTrainingList + + + Setup file, giving all parameters for training up a template model for each landmark. + + input + + + outputModel + m + outputModel + default.mdl + + The full filename of the output model file. + + output + + + saveOptimizedLandmarks + + l + saveOptimizedLandmarks + false + + Flag to make a new subject-specific landmark definition file in the same format produced by Slicer3 with the optimized landmark (the detected RP, AC, and PC) in it. Useful to tighten the variances in the ConstellationModeler. + + + + optimizedLandmarksFilenameExtender + j + optimizedLandmarksFilenameExtender + _opt.fcsv + + If the trainingList is (indexFullPathName) and contains landmark data filenames [path]/[filename].fcsv , make the optimized landmarks filenames out of [path]/[filename](thisExtender) and the optimized version of the input trainingList out of (indexFullPathName)(thisExtender) , when you rewrite all the landmarks according to the saveOptimizedLandmarks flag. + + output + + + resultsDir + + r + resultsDir + ./ + + The directory for the results to be written. + + output + + + mspQualityLevel + + mspQualityLevel + q + + Flag cotrols how agressive the MSP is estimated. 0=quick estimate (9 seconds), 1=normal estimate (11 seconds), 2=great estimate (22 seconds), 3=best estimate (58 seconds). + + 2 + + 0 + 3 + 1 + + + + rescaleIntensities + + rescaleIntensities + n + + Flag to turn on rescaling image intensities on input. + + 0 + + + trimRescaledIntensities + + trimRescaledIntensities + x + + Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean. + + 4.4172 + + + rescaleIntensitiesOutputRange + + rescaleIntensitiesOutputRange + y + + This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue. + + 40,4000 + + + backgroundFillValueString + BackgroundFillValue + z + Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number. + + 0 + + + writedebuggingImagesLevel + + writedebuggingImagesLevel + w + + This flag controls if debugging images are produced. By default value of 0 is no images. Anything greater than zero will be increasing level of debugging images. + + 0 + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSCreateLabelMapFromProbabilityMaps.xml b/tools/xmls/BRAINSCreateLabelMapFromProbabilityMaps.xml new file mode 100644 index 0000000..efc58ab --- /dev/null +++ b/tools/xmls/BRAINSCreateLabelMapFromProbabilityMaps.xml @@ -0,0 +1,76 @@ + + + + Segmentation.Specialized + Create Label Map From Probability Maps (BRAINS) + Given A list of Probability Maps, generate a LabelMap. + + + + Input parameters + + + inputProbabilityVolume + + inputProbabilityVolume + i + input + The list of proobabilityimages. + + + + priorLabelCodes + + priorLabelCodes + A list of PriorLabelCode values used for coding the output label images + + + + + foregroundPriors + + foregroundPriors + A list: For each Prior Label, 1 if foreground, 0 if background + + + + + nonAirRegionMask + + nonAirRegionMask + input + a mask representing the "NonAirRegion" -- Just force pixels in this region to zero + + + + inclusionThreshold + + inclusionThreshold + tolerance for inclusion + 0.0 + + + + + + + Output filename specifications + + + dirtyLabelVolume + + dirtyLabelVolume + output + the labels prior to cleaning + + + + cleanLabelVolume + + cleanLabelVolume + output + the foreground labels volume + + + + diff --git a/tools/xmls/BRAINSDWICleanup.xml b/tools/xmls/BRAINSDWICleanup.xml new file mode 100644 index 0000000..6427fe7 --- /dev/null +++ b/tools/xmls/BRAINSDWICleanup.xml @@ -0,0 +1,44 @@ + + + Diffusion.Utilities + BRAINSDWICleanup + + Remove bad gradients/volumes from DWI NRRD file. + + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + This tool was developed by Kent Williams. + + + + + + + + inputVolume + i + inputVolume + Required: input image is a 4D NRRD image. + + input + + + outputVolume + o + outputVolume + given a list of + + output + + + + badGradients + badGradients + b + + + + + + diff --git a/tools/xmls/BRAINSEyeDetector.xml b/tools/xmls/BRAINSEyeDetector.xml new file mode 100644 index 0000000..b843e2e --- /dev/null +++ b/tools/xmls/BRAINSEyeDetector.xml @@ -0,0 +1,37 @@ + + + Utilities.BRAINS + Eye Detector (BRAINS) + + + + 5.2.0 + http://www.nitrc.org/projects/brainscdetector/ + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + inputVolume + inputVolume + The input volume + input + + + outputVolume + outputVolume + The output volume + output + + + debugDir + debugDir + A place for debug information + /tmp + + + diff --git a/tools/xmls/BRAINSFit.xml b/tools/xmls/BRAINSFit.xml new file mode 100644 index 0000000..02e20df --- /dev/null +++ b/tools/xmls/BRAINSFit.xml @@ -0,0 +1,558 @@ + + + Registration + General Registration (BRAINS) + Register a three-dimensional volume to a reference volume (Mattes Mutual Information by default). Full documentation avalable here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSFit. Method described in BRAINSFit: Mutual Information Registrations of Whole-Brain 3D Images, Using the Insight Toolkit, Johnson H.J., Harris G., Williams K., The Insight Journal, 2007. http://hdl.handle.net/1926/1291 + http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSFit + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Hans J. Johnson (hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu), Ali Ghayoor + + 5.2.0 + + + + + fixedVolume + fixedVolume + + Input fixed image (the moving image will be transformed into this image space). + input + + + + movingVolume + movingVolume + + Input moving image (this image will be transformed into the fixed image space). + + input + + + + + + + samplingPercentage + samplingPercentage + + Fraction of voxels of the fixed image that will be used for registration. The number has to be larger than zero and less or equal to one. Higher values increase the computation time but may give more accurate results. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. The default is 0.002 (use approximately 0.2% of voxels, resulting in 100000 samples in a 512x512x192 volume) to provide a very fast registration in most cases. Typical values range from 0.01 (1%) for low detail images to 0.2 (20%) for high detail images. + 0.002 + + + splineGridSize + splineGridSize + + Number of BSpline grid subdivisions along each axis of the fixed image, centered on the image space. Values must be 3 or higher for the BSpline to be correctly computed. + 14,10,12 + + + + + + + linearTransform + linearTransform + + (optional) Output estimated transform - in case the computed transform is not BSpline. NOTE: You must set at least one output object (transform and/or output volume). + output + + + + + bsplineTransform + bsplineTransform + + (optional) Output estimated transform - in case the computed transform is BSpline. NOTE: You must set at least one output object (transform and/or output volume). + output + + + + + outputVolume + outputVolume + + (optional) Output image: the moving image warped to the fixed image space. NOTE: You must set at least one output object (transform and/or output volume). + output + + + + + + + Options for initializing transform parameters. + + initialTransform + initialTransform + + Transform to be applied to the moving image to initialize the registration. This can only be used if Initialize Transform Mode is Off. + input + + + initializeTransformMode + initializeTransformMode + + Determine how to initialize the transform center. useMomentsAlign assumes that the center of mass of the images represent similar structures. useCenterOfHeadAlign attempts to use the top of head and shape of neck to drive a center of mass estimate. useGeometryAlign on assumes that the center of the voxel lattice of the images represent similar structures. Off assumes that the physical space of the images are close. This flag is mutually exclusive with the Initialization transform. + Off + Off + useMomentsAlign + useCenterOfHeadAlign + useGeometryAlign + useCenterOfROIAlign + + + + + + Each of the registration phases will be used to initialize the next phase + + useRigid + useRigid + + Perform a rigid registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set. + false + + + useScaleVersor3D + useScaleVersor3D + + Perform a ScaleVersor3D registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set. + false + + + useScaleSkewVersor3D + useScaleSkewVersor3D + + Perform a ScaleSkewVersor3D registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set. + false + + + useAffine + useAffine + + Perform an Affine registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set. + false + + + useBSpline + useBSpline + + Perform a BSpline registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set. + false + + + useSyN + useSyN + + Perform a SyN registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set. + false + + + useComposite + useComposite + + Perform a Composite registration as part of the sequential registration steps. This family of options overrides the use of transformType if any of them are set. + false + + + + + + + maskProcessingMode + maskProcessingMode + Specifies a mask to only consider a certain image region for the registration. If ROIAUTO is chosen, then the mask is computed using Otsu thresholding and hole filling. If ROI is chosen then the mask has to be specified as in input. + + NOMASK + NOMASK + ROIAUTO + ROI + + + fixedBinaryVolume + fixedBinaryVolume + + Fixed Image binary mask volume, required if Masking Option is ROI. Image areas where the mask volume has zero value are ignored during the registration. + input + + + movingBinaryVolume + movingBinaryVolume + + Moving Image binary mask volume, required if Masking Option is ROI. Image areas where the mask volume has zero value are ignored during the registration. + input + + + outputFixedVolumeROI + outputFixedVolumeROI + + ROI that is automatically computed from the fixed image. Only available if Masking Option is ROIAUTO. Image areas where the mask volume has zero value are ignored during the registration. + output + + + outputMovingVolumeROI + outputMovingVolumeROI + + ROI that is automatically computed from the moving image. Only available if Masking Option is ROIAUTO. Image areas where the mask volume has zero value are ignored during the registration. + output + + + useROIBSpline + useROIBSpline + + If enabled then the bounding box of the input ROIs defines the BSpline grid support region. Otherwise the BSpline grid support region is the whole fixed image. + false + + + histogramMatch + e + histogramMatch + Apply histogram matching operation for the input images to make them more similar. This is suitable for images of the same modality that may have different brightness or contrast, but the same overall intensity profile. Do NOT use if registering images from different modalities. + + false + + + medianFilterSize + medianFilterSize + + Apply median filtering to reduce noise in the input volumes. The 3 values specify the radius for the optional MedianImageFilter preprocessing in all 3 directions (in voxels). + 0,0,0 + + + removeIntensityOutliers + removeIntensityOutliers + + Remove very high and very low intensity voxels from the input volumes. The parameter specifies the half percentage to decide outliers of image intensities. The default value is zero, which means no outlier removal. If the value of 0.005 is given, the 0.005% of both tails will be thrown away, so 0.01% of intensities in total would be ignored in the statistic calculation. + 0.0 + + + + + + + fixedVolume2 + fixedVolume2 + + Input fixed image that will be used for multimodal registration. (the moving image will be transformed into this image space). + input + + + + movingVolume2 + movingVolume2 + + Input moving image that will be used for multimodal registration(this image will be transformed into the fixed image space). + + input + + + outputVolumePixelType + outputVolumePixelType + + Data type for representing a voxel of the Output Volume. + float + float + short + ushort + int + uint + uchar + + + backgroundFillValue + backgroundFillValue + + This value will be used for filling those areas of the output image that have no corresponding voxels in the input moving image. + 0.0 + + + scaleOutputValues + scaleOutputValues + + If true, and the voxel values do not fit within the minimum and maximum values of the desired outputVolumePixelType, then linearly scale the min/max output image voxel values to fit within the min/max range of the outputVolumePixelType. + false + + + interpolationMode + interpolationMode + + Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, Hamming, Cosine, Welch, Lanczos, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation. + Linear + NearestNeighbor + Linear + ResampleInPlace + BSpline + WindowedSinc + Hamming + Cosine + Welch + Lanczos + Blackman + + + + + + + numberOfIterations + numberOfIterations + + The maximum number of iterations to try before stopping the optimization. When using a lower value (500-1000) then the registration is forced to terminate earlier but there is a higher risk of stopping before an optimal solution is reached. + 1500 + + + maximumStepLength + maximumStepLength + + Starting step length of the optimizer. In general, higher values allow for recovering larger initial misalignments but there is an increased chance that the registration will not converge. + 0.05 + + + minimumStepLength + minimumStepLength + + Each step in the optimization takes steps at least this big. When none are possible, registration is complete. Smaller values allows the optimizer to make smaller adjustments, but the registration time may increase. + 0.001 + + + relaxationFactor + relaxationFactor + + Specifies how quickly the optimization step length is decreased during registration. The value must be larger than 0 and smaller than 1. Larger values result in slower step size decrease, which allow for recovering larger initial misalignments but it increases the registration time and the chance that the registration will not converge. + 0.5 + + + translationScale + translationScale + + How much to scale up changes in position (in mm) compared to unit rotational changes (in radians) -- decrease this to allow for more rotation in the search pattern. + 1000.0 + + + reproportionScale + reproportionScale + + ScaleVersor3D 'Scale' compensation factor. Increase this to allow for more rescaling in a ScaleVersor3D or ScaleSkewVersor3D search pattern. 1.0 works well with a translationScale of 1000.0 + 1.0 + + + skewScale + skewScale + + ScaleSkewVersor3D Skew compensation factor. Increase this to allow for more skew in a ScaleSkewVersor3D search pattern. 1.0 works well with a translationScale of 1000.0 + 1.0 + + + maxBSplineDisplacement + maxBSplineDisplacement + + Maximum allowed displacements in image physical coordinates (mm) 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 + + + + + + + fixedVolumeTimeIndex + fixedVolumeTimeIndex + + The index in the time series for the 3D fixed image to fit. Only allowed if the fixed input volume is 4-dimensional. + 0 + + + movingVolumeTimeIndex + movingVolumeTimeIndex + + The index in the time series for the 3D moving image to fit. Only allowed if the moving input volume is 4-dimensional + 0 + + + + numberOfHistogramBins + numberOfHistogramBins + The number of histogram levels used for mutual information metric estimation. + + 50 + + + numberOfMatchPoints + numberOfMatchPoints + Number of histogram match points used for mutual information metric estimation. + + 10 + + + costMetric + costMetric + + The cost metric to be used during fitting. Defaults to MMI. Options are MMI (Mattes Mutual Information), MSE (Mean Square Error), NC (Normalized Correlation), MC (Match Cardinality for binary images) + MMI + MMI + MSE + NC + MIH + + + maskInferiorCutOffFromCenter + maskInferiorCutOffFromCenter + + If Initialize Transform Mode is set to useCenterOfHeadAlign or Masking Option is ROIAUTO then this value defines the how much is cut of from the inferior part of the image. The cut-off distance is specified in millimeters, relative to the image center. If the value is 1000 or larger then no cut-off performed. + 1000.0 + + + ROIAutoDilateSize + ROIAutoDilateSize + + This flag is only relevant when using ROIAUTO mode for initializing masks. It defines the final dilation size to capture a bit of background outside the tissue region. A setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. + 0.0 + + + ROIAutoClosingSize + ROIAutoClosingSize + + This flag is only relevant when using ROIAUTO mode for initializing masks. It defines the hole closing size in mm. It is rounded up to the nearest whole pixel size in each direction. The default is to use a closing size of 9mm. For mouse data this value may need to be reset to 0.9 or smaller. + 9.0 + + + numberOfSamples + numberOfSamples + + The number of voxels sampled for mutual information computation. Increase this for higher accuracy, at the cost of longer computation time.\nNOTE that it is suggested to use samplingPercentage instead of this option. However, if set to non-zero, numberOfSamples overwrites the samplingPercentage option. + 0 + + + strippedOutputTransform + strippedOutputTransform + + Rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE: This value is overridden if either bsplineTransform or linearTransform is set. + output + + + + + transformType + transformType + + Specifies a list of registration types to be used. The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, BSpline and SyN. Specifying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting. + + + + + outputTransform + outputTransform + + (optional) Filename to which save the (optional) estimated transform. NOTE: You must select either the outputTransform or the outputVolume option. + output + + + + + initializeRegistrationByCurrentGenericTransform + initializeRegistrationByCurrentGenericTransform + + If this flag is ON, the current generic composite transform, resulted from the linear registration stages, is set to initialize the follow nonlinear registration process. However, by the default behaviour, the moving image is first warped based on the existant transform before it is passed to the BSpline registration filter. It is done to speed up the BSpline registration by reducing the computations of composite transform Jacobian. + 0 + + + writeOutputTransformInFloat + writeOutputTransformInFloat + + By default, the output registration transforms (either the output composite transform or each transform component) are written to the disk in double precision. If this flag is ON, the output transforms will be written in single (float) precision. It is especially important if the output transform is a displacement field transform, or it is a composite transform that includes several displacement fields. + false + + + + + + + failureExitCode + failureExitCode + + If the fit fails, exit with this status code. (It can be used to force a successfult exit status of (0) if the registration fails due to reaching the maximum number of iterations. + -1 + + + writeTransformOnFailure + writeTransformOnFailure + + Flag to save the final transform even if the numberOfIterations are reached without convergence. (Intended for use when --failureExitCode 0 ) + 0 + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. (default is auto-detected) + -1 + + + debugLevel + + Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging. + debugLevel + 0 + + + costFunctionConvergenceFactor + costFunctionConvergenceFactor + From itkLBFGSBOptimizer.h: Set/Get the CostFunctionConvergenceFactor. Algorithm terminates when the reduction in cost function is less than (factor * epsmcj) where epsmch is the machine precision. Typical values for factor: 1e+12 for low accuracy; 1e+7 for moderate accuracy and 1e+1 for extremely high accuracy. 1e+9 seems to work well. + + 2e+13 + + + projectedGradientTolerance + projectedGradientTolerance + From itkLBFGSBOptimizer.h: Set/Get the ProjectedGradientTolerance. Algorithm terminates when the project gradient is below the tolerance. Default lbfgsb value is 1e-5, but 1e-4 seems to work well. + + 1e-5 + + + maximumNumberOfEvaluations + maximumNumberOfEvaluations + Maximum number of evaluations for line search in lbfgsb optimizer. + 900 + + + maximumNumberOfCorrections + maximumNumberOfCorrections + Maximum number of corrections in lbfgsb optimizer. + 25 + + + UseDebugImageViewer + G + gui + Display intermediate image volumes for debugging. NOTE: This is not part of the standard build sytem, and probably does nothing on your installation. + false + + + PromptAfterImageSend + p + promptUser + Prompt the user to hit enter each time an image is sent to the DebugImageViewer + false + + + metricSamplingStrategy + metricSamplingStrategy + + It defines the method that registration filter uses to sample the input fixed image. Only Random is supported for now. + Random + Random + + + logFileReport + logFileReport + + A file to write out final information report in CSV file: MetricName,MetricValue,FixedImageName,FixedMaskName,MovingImageName,MovingMaskName + output + + + printVersionInfo + v + false + + + + diff --git a/tools/xmls/BRAINSInitializedControlPoints.xml b/tools/xmls/BRAINSInitializedControlPoints.xml new file mode 100755 index 0000000..3051423 --- /dev/null +++ b/tools/xmls/BRAINSInitializedControlPoints.xml @@ -0,0 +1,71 @@ + + + Utilities.BRAINS + Initialized Control Points (BRAINS) + + Outputs bspline control points as landmarks + + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Mark Scully + +This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Additional support for Mark Scully and Hans Johnson at the University of Iowa. + + + + + Input/output parameters + + + inputVolume + --inputVolume + + input + Input Volume + + + + outputVolume + --outputVolume + + output + Output Volume + + + + splineGridSize + splineGridSize + + The number of subdivisions of the BSpline Grid to be centered on the image space. Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. + 14,10,12 + + + + permuteOrder + permuteOrder + + The permutation order for the images. The default is 0,1,2 (i.e. no permutation) + 0,1,2 + + + + outputLandmarksFile + --outputLandmarksFile + + output + Output filename + + + + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSLabelStats.xml b/tools/xmls/BRAINSLabelStats.xml new file mode 100644 index 0000000..f8d7b6a --- /dev/null +++ b/tools/xmls/BRAINSLabelStats.xml @@ -0,0 +1,115 @@ + + + Quantification + Label Statistics (BRAINS) + Compute image statistics within each label of a label map. + 5.2.0 + http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSClassify + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Vincent A. Magnotta + Funding for this work was provided by the Dana Foundation + + + + + + imageVolume + --imageVolume + + Image Volume + input + + + + + labelVolume + --labelVolume + + Label Volume + + input + + + + labelNameFile + --labelNameFile + + Label Name File + + input + + + + + + + + + outputPrefixColumnNames + --outputPrefixColumnNames + Prefix Column Name(s) + + + + + + outputPrefixColumnValues + --outputPrefixColumnValues + Prefix Column Value(s) + + + + + + labelFileType + --labelFileType + + Label File Type + unknown + unknown + fslxml + ants + csv + + + + + + + + numberOfHistogramBins + --numberOfHistogramBins + Number Of Histogram Bins + + 100000 + + + + minMaxType + --minMaxType + + Define minimim and maximum values based upon the image, label, or via command line + image + image + label + manual + + + + userDefineMinimum + --userDefineMinimum + User define minimum value + + 0.0 + + + + userDefineMaximum + --userDefineMaximum + User define maximum value + + 4095.0 + + + + diff --git a/tools/xmls/BRAINSLandmarkInitializer.xml b/tools/xmls/BRAINSLandmarkInitializer.xml new file mode 100644 index 0000000..57c283a --- /dev/null +++ b/tools/xmls/BRAINSLandmarkInitializer.xml @@ -0,0 +1,81 @@ + + + Utilities.BRAINS + BRAINSLandmarkInitializer + Create transformation file (*.h5) from a pair of landmarks (*fcsv) files. + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Eunyoung Regina Kim, Ali Ghayoor, and Hans J. Johnson + SINAPSE Lab + + + inputFixedLandmarkFilename + inputFixedLandmarkFilename + + input + input landmarks from fixed image *.fcsv + + + + + inputMovingLandmarkFilename + inputMovingLandmarkFilename + + input + input landmarks from moving image *.fcsv + + + + + inputWeightFilename + inputWeightFilename + + input + Input weight file name for landmarks. Higher weighted landmark will be considered more heavily. Weights are propotional, that is the magnitude of weights will be normalized by its minimum and maximum value. + + + + + outputTransformFilename + outputTransformFilename + + output + output transform file name (ex: ./moving2fixed.h5) that is appropriate for applying to the moving image to align with the fixed image. The _Inverse file is also written that is approporate for placing the moving Landmarks with the fixed image. + + + + + outputTransformType + outputTransformType + input + The target transformation type. + AffineTransform + AffineTransform + + VersorRigid3DTransform + BSplineTransform + + + + + inputReferenceImageFilename + + inputReferenceImageFilename + Set the reference image to define the parametric domain for the BSpline transform. + input + + + + bsplineNumberOfControlPoints + + bsplineNumberOfControlPoints + Set the number of control points to define the parametric domain for the BSpline transform. + input + 8 + + + + diff --git a/tools/xmls/BRAINSLinearModelerEPCA.xml b/tools/xmls/BRAINSLinearModelerEPCA.xml new file mode 100644 index 0000000..d657231 --- /dev/null +++ b/tools/xmls/BRAINSLinearModelerEPCA.xml @@ -0,0 +1,30 @@ + + + Utilities.BRAINS + Landmark Linear Modeler (BRAINS) + + Training linear model using EPCA. Implementation based on my MS thesis, "A METHOD FOR AUTOMATED LANDMARK CONSTELLATION DETECTION USING EVOLUTIONARY PRINCIPAL COMPONENTS AND STATISTICAL SHAPE MODELS" + + + + 5.2.0 + http://www.nitrc.org/projects/brainscdetector/ + + + inputTrainingList + + + inputTrainingList + Input Training Landmark List Filename + + input + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSLmkTransform.xml b/tools/xmls/BRAINSLmkTransform.xml new file mode 100644 index 0000000..bc7f2bb --- /dev/null +++ b/tools/xmls/BRAINSLmkTransform.xml @@ -0,0 +1,71 @@ + + + Utilities.BRAINS + Landmark Transform (BRAINS) + + This utility program estimates the affine transform to align the fixed landmarks to the moving landmarks, and then generate the resampled moving image to the same physical space as that of the reference image. + + + 5.2.0 + http://www.nitrc.org/projects/brainscdetector/ + + + inputMovingLandmarks + + + inputMovingLandmarks + Input Moving Landmark list file in fcsv + + input + + + inputFixedLandmarks + + + inputFixedLandmarks + Input Fixed Landmark list file in fcsv + + input + + + outputAffineTransform + + + outputAffineTransform + The filename for the estimated affine transform + + output + + + inputMovingVolume + inputMovingVolume + + The filename of input moving volume + input + + + + inputReferenceVolume + inputReferenceVolume + + The filename of the reference volume + input + + + + outputResampledVolume + outputResampledVolume + + The filename of the output resampled volume + output + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSMultiModeSegment.xml b/tools/xmls/BRAINSMultiModeSegment.xml new file mode 100644 index 0000000..20ea9e0 --- /dev/null +++ b/tools/xmls/BRAINSMultiModeSegment.xml @@ -0,0 +1,68 @@ + + + Utilities.BRAINS + Segment based on rectangular region of joint histogram (BRAINS) + This tool creates binary regions based on segmenting multiple image modalitities at once. + + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu + Hans Johnson(1,3,4); Gregory Harris(1), Vincent Magnotta(1,2,3); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering) + + + Input/output parameters + + inputVolumes + --inputVolumes + + The input image volumes for finding the largest region filled mask. + input + + + inputMaskVolume + --inputMaskVolume + + The ROI for region to compute histogram levels. + input + + + outputROIMaskVolume + --outputROIMaskVolume + + The ROI automatically found from the input image. + output + + + outputClippedVolumeROI + --outputClippedVolumeROI + + The inputVolume clipped to the region of the brain mask. + output + + + lowerThreshold + --lowerThreshold + + Lower thresholds on the valid histogram regions for each modality + output + + + upperThreshold + --upperThreshold + + Upper thresholds on the valid histogram regions for each modality + output + + + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSMultiSTAPLE.xml b/tools/xmls/BRAINSMultiSTAPLE.xml new file mode 100644 index 0000000..d4c2d52 --- /dev/null +++ b/tools/xmls/BRAINSMultiSTAPLE.xml @@ -0,0 +1,78 @@ + + + + Segmentation.Specialized + Create best representative label map) + given a list of label map images, create a representative/average label map. + + + + Input parameters + + + inputCompositeT1Volume + + inputCompositeT1Volume + input + Composite T1, all label maps transofrmed into the space for this image. + + + + inputLabelVolume + + inputLabelVolume + input + The list of proobabilityimages. + + + + inputTransform + + inputTransform + input + transforms to apply to label volumes + + + labelForUndecidedPixels + + labelForUndecidedPixels + Label for undecided pixels + -1 + + + resampledVolumePrefix + + resampledVolumePrefix + if given, write out resampled volumes with this prefix + + + + skipResampling + + skipResampling + Omit resampling images into reference space + false + + + + + Output filename specifications + + + outputMultiSTAPLE + + outputMultiSTAPLE + output + the MultiSTAPLE average of input label volumes + + + outputConfusionMatrix + + outputConfusionMatrix + output + Confusion Matrix + + + + + diff --git a/tools/xmls/BRAINSMush.xml b/tools/xmls/BRAINSMush.xml new file mode 100755 index 0000000..924436f --- /dev/null +++ b/tools/xmls/BRAINSMush.xml @@ -0,0 +1,187 @@ + + + Utilities.BRAINS + Brain Extraction from T1/T2 image (BRAINS) + + This program: 1) generates a weighted mixture image optimizing the mean and variance and 2) produces a mask of the brain volume + + 5.2.0 + http:://mri.radiology.uiowa.edu + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + + This tool is a modification by Steven Dunn of a program developed by Greg Harris and Ron Pierson. + + + This work was developed by the University of Iowa Departments of Radiology and Psychiatry. This software was supported in part of NIH/NINDS award NS050568. + + + + + + + First Image, Second Image and Mask Image + + + inputFirstVolume + inputFirstVolume + Input image (1) for mixture optimization + + input + + + + inputSecondVolume + inputSecondVolume + Input image (2) for mixture optimization + + input + + + + inputMaskVolume + inputMaskVolume + Input label image for mixture optimization + + input + no_mask_exists + + + + + + Outputs from both MUSH generation and brain volume mask creation + + + outputWeightsFile + outputWeightsFile + Output Weights File + + OptimalMixtureWeights.txt + output + + + + outputVolume + outputVolume + The MUSH image produced from the T1 and T2 weighted images + + output + MUSH_image.nii.gz + + + + outputMask + outputMask + The brain volume mask generated from the MUSH image + + output + output.nii.gz + + + + + + Seed point for brain region filling + + + seed + seed + Seed Point for Brain Region Filling + + input + 128,128,128 + + + + + + Target Statistic Parameters + + + desiredMean + desiredMean + Desired mean within the mask for weighted sum of both images. + + input + 10000.0 + + + + desiredVariance + desiredVariance + Desired variance within the mask for weighted sum of both images. + + input + 0.0 + + + + lowerThresholdFactorPre + lowerThresholdFactorPre + Lower threshold factor for finding an initial brain mask + + input + 1.485 + + + + upperThresholdFactorPre + upperThresholdFactorPre + Upper threshold factor for finding an initial brain mask + + input + 0.62 + + + + lowerThresholdFactor + lowerThresholdFactor + Lower threshold factor for defining the brain mask + + input + 1.2431 + + + + upperThresholdFactor + upperThresholdFactor + Upper threshold factor for defining the brain mask + + input + 0.71956 + + + + boundingBoxSize + boundingBoxSize + Size of the cubic bounding box mask used when no brain mask is present + + input + 90,60,75 + + + + boundingBoxStart + boundingBoxStart + XYZ point-coordinate for the start of the cubic bounding box mask used when no brain mask is present + + input + 83,113,80 + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + + diff --git a/tools/xmls/BRAINSPosteriorToContinuousClass.xml b/tools/xmls/BRAINSPosteriorToContinuousClass.xml new file mode 100644 index 0000000..5955c1f --- /dev/null +++ b/tools/xmls/BRAINSPosteriorToContinuousClass.xml @@ -0,0 +1,95 @@ + + + BRAINS.Classify + Tissue Classification + This program will generate an 8-bit continuous tissue classified image based on BRAINSABC posterior images. + 5.2.0 + http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSClassify + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Vincent A. Magnotta + Funding for this work was provided by NIH/NINDS award NS050568 + + + + + + inputWhiteVolume + --inputWhiteVolume + + White Matter Posterior Volume + input + + + + + inputBasalGmVolume + --inputBasalGmVolume + + Basal Grey Matter Posterior Volume + input + + + + + inputSurfaceGmVolume + --inputSurfaceGmVolume + + Surface Grey Matter Posterior Volume + input + + + + + inputCsfVolume + --inputCsfVolume + + CSF Posterior Volume + input + + + + + inputVbVolume + --inputVbVolume + + Venous Blood Posterior Volume + input + + + + + inputCrblGmVolume + --inputCrblGmVolume + + Cerebellum Grey Matter Posterior Volume + input + + + + + inputCrblWmVolume + --inputCrblWmVolume + + Cerebellum White Matter Posterior Volume + input + + + + + + + + + + + outputVolume + --outputVolume + + Output Continuous Tissue Classified Image + output + + + + + + diff --git a/tools/xmls/BRAINSROIAuto.xml b/tools/xmls/BRAINSROIAuto.xml new file mode 100644 index 0000000..a579fa1 --- /dev/null +++ b/tools/xmls/BRAINSROIAuto.xml @@ -0,0 +1,108 @@ + + + Segmentation.Specialized + Foreground masking (BRAINS) + This program is used to create a mask over the most prominant forground region in an image. This is accomplished via a combination of otsu thresholding and a closing operation. More documentation is available here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/ForegroundMasking. + + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Hans J. Johnson, hans-johnson -at- uiowa.edu, http://www.psychiatry.uiowa.edu + Hans Johnson(1,3,4); Kent Williams(1); Gregory Harris(1), Vincent Magnotta(1,2,3); Andriy Fedorov(5), fedorov -at- bwh.harvard.edu (Slicer integration); (1=University of Iowa Department of Psychiatry, 2=University of Iowa Department of Radiology, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering, 5=Surgical Planning Lab, Harvard) + + + Input/output parameters + + inputVolume + inputVolume + + The input image for finding the largest region filled mask. + input + + + outputROIMaskVolume + outputROIMaskVolume + + The ROI automatically found from the input image. + output + + + outputVolume + outputVolume + + The inputVolume with optional [maskOutput|cropOutput] to the region of the brain mask. + output + + + maskOutput + maskOutput + + The inputVolume multiplied by the ROI mask. + true + + + cropOutput + cropOutput + + The inputVolume cropped to the region of the ROI mask. + false + + + + + + + + otsuPercentileThreshold + otsuPercentileThreshold + + Parameter to the Otsu threshold algorithm. + 0.01 + + + + thresholdCorrectionFactor + thresholdCorrectionFactor + + A factor to scale the Otsu algorithm's result threshold, in case clipping mangles the image. + 1.0 + + + + closingSize + closingSize + + The Closing Size (in millimeters) for largest connected filled mask. This value is divided by image spacing and rounded to the next largest voxel number. + 9.0 + + + + ROIAutoDilateSize + ROIAutoDilateSize + + This flag is only relavent when using ROIAUTO mode for initializing masks. It defines the final dilation size to capture a bit of background outside the tissue region. At setting of 10mm has been shown to help regularize a BSpline registration type so that there is some background constraints to match the edges of the head better. + 0.0 + + + + outputVolumePixelType + outputVolumePixelType + + The output image Pixel Type is the scalar datatype for representation of the Output Volume. + short + float + short + ushort + int + uint + uchar + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSResample.xml b/tools/xmls/BRAINSResample.xml new file mode 100644 index 0000000..915d93d --- /dev/null +++ b/tools/xmls/BRAINSResample.xml @@ -0,0 +1,154 @@ + + + Registration + Resample Image (BRAINS) + + + This program collects together three common image processing tasks that all involve resampling an image volume: Resampling to a new resolution and spacing, applying a transformation (using an ITK transform IO mechanisms) and Warping (using a vector image deformation field). Full documentation available here: http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSResample. + + 5.2.0 + http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/BRAINSResample + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + This tool was developed by Vincent Magnotta, Greg Harris, and Hans Johnson. + The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. + + + + Parameters for specifying the image to warp and resulting image space + + + inputVolume + inputVolume + Image To Warp + + input + + + + referenceVolume + referenceVolume + Reference image used only to define the output space. If not specified, the warping is done in the same space as the image to warp. + + input + + + + + + Resulting deformed image parameters + + + outputVolume + outputVolume + Resulting deformed image + + output + + + + + pixelType + pixelType + + Specifies the pixel type for the input/output images. The "binary" pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk. + float + float + short + ushort + int + uint + uchar + binary + + + + + + + Parameters used to define home the image is warped + + + deformationVolume + deformationVolume + Displacement Field to be used to warp the image (ITKv3 or earlier) + + input + + + + + warpTransform + warpTransform + + Filename for the BRAINSFit transform (ITKv3 or earlier) or composite transform file (ITKv4) + input + + + + + interpolationMode + interpolationMode + + Type of interpolation to be used when applying transform to moving volume. Options are Linear, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc + Linear + NearestNeighbor + Linear + ResampleInPlace + BSpline + WindowedSinc + Hamming + Cosine + Welch + Lanczos + Blackman + + + + inverseTransform + inverseTransform + + True/False is to compute inverse of given transformation. Default is false + false + + + defaultValue + defaultValue + + Default voxel value + 0.0 + + + + + + + + + + gridSpacing + gridSpacing + + Add warped grid to output image to help show the deformation that occured with specified spacing. A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane). This is useful for makeing a 2D image of grid lines from the 3D space + + + + + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSResize.xml b/tools/xmls/BRAINSResize.xml new file mode 100644 index 0000000..49e62f6 --- /dev/null +++ b/tools/xmls/BRAINSResize.xml @@ -0,0 +1,68 @@ + + + Registration + Resize Image (BRAINS) + + +This program is useful for downsampling an image by a constant scale factor. + + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + This tool was developed by Hans Johnson. + The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health. + + + + Parameters for specifying the image to warp and resulting image space + + + inputVolume + inputVolume + Image To Scale + + input + + + + + + Resulting scaled image parameters + + + outputVolume + outputVolume + Resulting scaled image + + output + + + + pixelType + pixelType + + Specifies the pixel type for the input/output images. The "binary" pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk. + float + float + short + ushort + int + uint + uchar + binary + + + + + + Parameters used to define the scaling of the output image + + + scaleFactor + scaleFactor + + The scale factor for the image spacing. + 2.0 + + + diff --git a/tools/xmls/BRAINSSnapShotWriter.xml b/tools/xmls/BRAINSSnapShotWriter.xml new file mode 100644 index 0000000..b7c8a40 --- /dev/null +++ b/tools/xmls/BRAINSSnapShotWriter.xml @@ -0,0 +1,78 @@ + + + Utilities.BRAINS + BRAINSSnapShotWriter + Create 2D snapshot of input images. Mask images are color-coded + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Eunyoung Regina Kim + + + + + inputVolumes + inputVolumes + + input + Input image volume list to be extracted as 2D image. Multiple input is possible. At least one input is required. + + + + + inputBinaryVolumes + inputBinaryVolumes + + input + Input mask (binary) volume list to be extracted as 2D image. Multiple input is possible. + + + + + inputSliceToExtractInPhysicalPoint + inputSliceToExtractInPhysicalPoint + + input + 2D slice number of input images. For autoWorkUp output, which AC-PC aligned, 0,0,0 will be the center. + + + + + inputSliceToExtractInIndex + inputSliceToExtractInIndex + + input + 2D slice number of input images. For size of 256*256*256 image, 128 is usually used. + + + + + inputSliceToExtractInPercent + inputSliceToExtractInPercent + + input + 2D slice number of input images. Percentage input from 0%-100%. (ex. --inputSliceToExtractInPercent 50,50,50 + 50,50,50 + + + + inputPlaneDirection + inputPlaneDirection + + input + Plane to display. In general, 0=saggital, 1=coronal, and 2=axial plane. + 0,1,2 + + + + outputFilename + outputFilename + + output + 2D file name of input images. Required. + + + + + + diff --git a/tools/xmls/BRAINSStripRotation.xml b/tools/xmls/BRAINSStripRotation.xml new file mode 100644 index 0000000..dacc85b --- /dev/null +++ b/tools/xmls/BRAINSStripRotation.xml @@ -0,0 +1,35 @@ + + + Utilities + BRAINS Strip Rotation + Read an Image, write out same image with identity rotation matrix plus an ITK transform file + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Kent WIlliams + + + + inputVolume + inputVolume + Image To Warp + + input + + + outputVolume + outputVolume + Resulting deformed image + + output + + + transform + transform + + Filename for the transform file + output + + + + diff --git a/tools/xmls/BRAINSTalairach.xml b/tools/xmls/BRAINSTalairach.xml new file mode 100644 index 0000000..b3f8a3a --- /dev/null +++ b/tools/xmls/BRAINSTalairach.xml @@ -0,0 +1,129 @@ + + + + BRAINS.Segmentation + + + BRAINS Talairach + + + This program creates a VTK structured grid defining the Talairach coordinate system based on four points: AC, PC, IRP, and SLA. The resulting structred grid can be written as either a classic VTK file or the new VTK XML file format. Two representations of the resulting grid can be written. The first is a bounding box representation that also contains the location of the AC and PC points. The second representation is the full Talairach grid representation that includes the additional rows of boxes added to the inferior allowing full coverage of the cerebellum. + 5.2.0 + http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSTalairach + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + + Steven Dunn and Vincent Magnotta + + Funding for this work was provided by NIH/NINDS award NS050568 + + + + Input parameters to be used in generating the structured grid + + + AC + AC + Location of AC Point + + input + + + + ACisIndex + ACisIndex + AC Point is Index + + input + 0 + + + + PC + PC + Location of PC Point + + input + + + + PCisIndex + PCisIndex + PC Point is Index + + input + 0 + + + + SLA + SLA + Location of SLA Point + + input + + + + SLAisIndex + SLAisIndex + SLA Point is Index + + input + 0 + + + + IRP + IRP + Location of IRP Point + + input + + + + IRPisIndex + IRPisIndex + IRP Point is Index + + input + 0 + + + + inputLandmarksFile + inputLandmarksFile + input landmarks file: *.fcsv + + input + + + + inputVolume + inputVolume + Input image used to define physical space of images + + input + + + + + + + Output Parameters + + + outputBox + outputBox + Name of the resulting Talairach Bounding Box file + + output + + + + outputGrid + outputGrid + Name of the resulting Talairach Grid file + + output + + + diff --git a/tools/xmls/BRAINSTalairachMask.xml b/tools/xmls/BRAINSTalairachMask.xml new file mode 100644 index 0000000..392fefe --- /dev/null +++ b/tools/xmls/BRAINSTalairachMask.xml @@ -0,0 +1,82 @@ + + + + BRAINS.Segmentation + + + Talairach Mask + + + This program creates a binary image representing the specified Talairach region. The input is an example image to define the physical space for the resulting image, the Talairach grid representation in VTK format, and the file containing the Talairach box definitions to be generated. These can be combined in BRAINS to create a label map using the procedure Brains::WorkupUtils::CreateLabelMapFromBinaryImages. + 5.2.0 + http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSTalairachMask + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + + Steven Dunn and Vincent Magnotta + + Funding for this work was provided by NIH/NINDS award NS050568 + + + + Input parameters to be used in generating the Talairach mask + + + inputVolume + inputVolume + Input image used to define physical space of resulting mask + + input + + + + talairachParameters + talairachParameters + Name of the Talairach parameter file. + + input + + + + talairachBox + talairachBox + Name of the Talairach box file. + + input + + + + hemisphereMode + hemisphereMode + Mode for box creation: left, right, both + + both + left + right + both + + + + expand + expand + Expand exterior box to include surface CSF + + input + false + + + + + + + Output Parameters + + + outputVolume + outputVolume + Output filename for the resulting binary image + + output + + + + diff --git a/tools/xmls/BRAINSTransformConvert.xml b/tools/xmls/BRAINSTransformConvert.xml new file mode 100644 index 0000000..f6369f5 --- /dev/null +++ b/tools/xmls/BRAINSTransformConvert.xml @@ -0,0 +1,68 @@ + + + Utilities.BRAINS + BRAINS Transform Convert + Convert ITK transforms to higher order transforms + 5.2.0 + A utility to convert between transform file formats. + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Hans J. Johnson,Kent Williams, Ali Ghayoor + + + + + + Input/output parameters + + input + inputTransform + + + --inputTransform + + + input + referenceVolume + + --referenceVolume + + + + outputTransformType + --outputTransformType + The target transformation type. Must be conversion-compatible with the input transform type + Affine + Affine + VersorRigid + ScaleVersor + ScaleSkewVersor + DisplacementField + Same + + + + outputPrecisionType + --outputPrecisionType + Precision type of the output transform. It can be either single precision or double precision + double + double + float + + + + output + displacementVolume + + --displacementVolume + + + output + outputTransform + + + --outputTransform + + + + + diff --git a/tools/xmls/BRAINSTransformFromFiducials.xml b/tools/xmls/BRAINSTransformFromFiducials.xml new file mode 100644 index 0000000..1b20c51 --- /dev/null +++ b/tools/xmls/BRAINSTransformFromFiducials.xml @@ -0,0 +1,71 @@ + + + Registration.Specialized + Fiducial Registration (BRAINS) + Computes a rigid, similarity or affine transform from a matched list of fiducials + 5.2.0 + http://www.slicer.org/slicerWiki/index.php/Modules:TransformFromFiducials-Documentation-3.6 + + Casey B Goodlett + + This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. + + + + fixedLandmarks + Ordered list of landmarks in the fixed image + + fixedLandmarks + input + + + movingLandmarks + Ordered list of landmarks in the moving image + + movingLandmarks + input + + + saveTransform + + Save the transform that results from registration + saveTransform + output + + + transformType + Type of transform to produce + + transformType + Translation + Rigid + Similarity + Rigid + + + + + fixedLandmarksFile + An fcsv formatted file with a list of landmark points. + + fixedLandmarksFile + input + + + + movingLandmarksFile + An fcsv formatted file with a list of landmark points. + + movingLandmarksFile + input + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BRAINSTrimForegroundInDirection.xml b/tools/xmls/BRAINSTrimForegroundInDirection.xml new file mode 100644 index 0000000..78e317a --- /dev/null +++ b/tools/xmls/BRAINSTrimForegroundInDirection.xml @@ -0,0 +1,83 @@ + + + Utilities.BRAINS + Trim Foreground In Direction (BRAINS) + This program will trim off the neck and also air-filling noise from the inputImage. + 5.2.0 + http://www.nitrc.org/projects/art/ + + + inputVolume + i + inputVolume + + Input image to trim off the neck (and also air-filling noise.) + input + + + + outputVolume + o + outputVolume + + Output image with neck and air-filling noise trimmed isotropic image with AC at center of image. + output + + + + directionCode + + directionCode + x + + This flag chooses which dimension to compare. The sign lets you flip direction. + + 3 + + + otsuPercentileThreshold + + otsuPercentileThreshold + p + + This is a parameter to FindLargestForegroundFilledMask, which is employed to trim off air-filling noise. + + 0.01 + + + closingSize + + closingSize + c + + This is a parameter to FindLargestForegroundFilledMask + + 9 + + + headSizeLimit + + headSizeLimit + s + + Use this to vary from the command line our search for how much upper tissue is head for the center-of-mass calculation. Units are CCs, not cubic millimeters. + + 1000.0 + + + backgroundFillValueString + BackgroundFillValue + z + Fill the background of image with specified short int value. Enter number or use BIGNEG for a large negative number. + + 0 + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/BinaryMaskEditorBasedOnLandmarks.xml b/tools/xmls/BinaryMaskEditorBasedOnLandmarks.xml new file mode 100644 index 0000000..347789f --- /dev/null +++ b/tools/xmls/BinaryMaskEditorBasedOnLandmarks.xml @@ -0,0 +1,71 @@ + + + Segmentation.Specialized + BRAINS Binary Mask Editor Based On Landmarks(BRAINS) + + + + 5.2.0 + http://www.nitrc.org/projects/brainscdetector/ + + + inputBinaryVolume + inputBinaryVolume + + Input binary image in which to be edited + input + + + + outputBinaryVolume + outputBinaryVolume + + Output binary image in which to be edited + output + + + + inputLandmarksFilename + + inputLandmarksFilename + + The filename for the landmark definition file in the same format produced by Slicer3 (.fcsv). + input + + + + inputLandmarkNames + + inputLandmarkNames + + A target input landmark name to be edited. This should be listed in the inputLandmakrFilename Given. + input + + + + setCutDirectionForLandmark + + setCutDirectionForLandmark + + Setting the cutting out direction of the input binary image to the one of anterior, posterior, left, right, superior or posterior. (ENUMERATION: ANTERIOR, POSTERIOR, LEFT, RIGHT, SUPERIOR, POSTERIOR) + + + + setCutDirectionForObliquePlane + + setCutDirectionForObliquePlane + + If this is true, the mask will be thresholded out to the direction of inferior, posterior, and/or left. Default behavrior is that cutting out to the direction of superior, anterior and/or right. + input + + + + inputLandmarkNamesForObliquePlane + + inputLandmarkNamesForObliquePlane + + Three subset landmark names of inputLandmarksFilename for a oblique plane computation. The plane computed for binary volume editing. + input + + + diff --git a/tools/xmls/CLIROITest.xml b/tools/xmls/CLIROITest.xml new file mode 100644 index 0000000..a00afa7 --- /dev/null +++ b/tools/xmls/CLIROITest.xml @@ -0,0 +1,21 @@ + + + Testing + CLI ROI Test + 1 + 1.0 + + + ROI_One + + input + --ri + + + ROI_List + + input + --ro + + + diff --git a/tools/xmls/CastScalarVolume.xml b/tools/xmls/CastScalarVolume.xml new file mode 100644 index 0000000..846a532 --- /dev/null +++ b/tools/xmls/CastScalarVolume.xml @@ -0,0 +1,48 @@ + + + Filtering.Arithmetic + Cast Scalar Volume + + 0.1.0.$Revision: 2104 $(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Cast + + Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + + + + + + InputVolume + + input + 0 + + + + OutputVolume + + output + 1 + + + + + + + Type + + + -t + --type + Char + UnsignedChar + Short + UnsignedShort + Int + UnsignedInt + Float + Double + UnsignedChar + + + diff --git a/tools/xmls/CheckerBoardFilter.xml b/tools/xmls/CheckerBoardFilter.xml new file mode 100644 index 0000000..c7a43c5 --- /dev/null +++ b/tools/xmls/CheckerBoardFilter.xml @@ -0,0 +1,47 @@ + + + Filtering + CheckerBoard Filter + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/CheckerBoard + + Bill Lorensen (GE) + + + + + + checkerPattern + --checkerPattern + + + 2,2,2 + + + + + + + inputVolume1 + + input + 0 + + + + inputVolume2 + + input + 1 + + + + outputVolume + + output + 2 + + + + diff --git a/tools/xmls/ComputeReflectiveCorrelationMetric.xml b/tools/xmls/ComputeReflectiveCorrelationMetric.xml new file mode 100644 index 0000000..d272300 --- /dev/null +++ b/tools/xmls/ComputeReflectiveCorrelationMetric.xml @@ -0,0 +1,35 @@ + + + Testing + Compute RC metric values in exhausive search + + + 5.2.0 + + + Ali Ghayoor + + + + + + + inputVolume + inputVolume + + Input image. + input + + + + + outputCSVFile + outputCSVFile + + A file to write out final information report in CSV file: HA,BA,LR,MetricValue(cc) + output + + + + + diff --git a/tools/xmls/CreateDICOMSeries.xml b/tools/xmls/CreateDICOMSeries.xml new file mode 100644 index 0000000..ee4ad72 --- /dev/null +++ b/tools/xmls/CreateDICOMSeries.xml @@ -0,0 +1,266 @@ + + + Converters + Create a DICOM Series + + 0.1.0.$Revision$(alpha) + https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/CreateDICOMSeries + + Bill Lorensen (GE) + + + + + + patientName + --patientName + + + Anonymous + + + patientID + --patientID + + + 123456 + + + patientBirthDate + --patientBirthDate + + + 20060101 + + + patientSex + --patientSex + + + M + + + patientComments + --patientComments + + + None + + + + + + + studyID + --studyID + + + 123456 + + + studyDate + --studyDate + + + 20060101 + + + studyTime + --studyTime + + + + + + studyComments + --studyComments + + + None + + + studyDescription + --studyDescription + + + None + + + modality + --modality + + + CT + + + manufacturer + --manufacturer + + + GE Medical Systems + + + model + --model + + + None + + + + + + + seriesNumber + --seriesNumber + + + 123456 + + + seriesDescription + --seriesDescription + + + None + + + seriesDate + --seriesDate + + + + + + seriesTime + --seriesTime + + + + + + + + + + + rescaleIntercept + --rescaleIntercept + + 0.0000 + + + + rescaleSlope + --rescaleSlope + + 1.0000 + + + contentDate + --contentDate + + + + + + contentTime + --contentTime + + + + + + + + + + studyInstanceUID + --studyInstanceUID + + + + + + seriesInstanceUID + --seriesInstanceUID + + + + + + frameOfReferenceInstanceUID + --frameOfReferenceInstanceUID + + + + + + + + + + inputVolume + + input + 0 + + + + + + + + dicomDirectory + --dicomDirectory + + + output + ./ + + + dicomPrefix + --dicomPrefix + + + IMG + + + dicomNumberFormat + --dicomNumberFormat + + + %04d + + + reverseImages + --reverseImages + + + false + + + useCompression + --useCompression + + + false + + + + Type + + + --type + --t + Short + UnsignedChar + Char + UnsignedChar + Short + UnsignedShort + Int + UnsignedInt + + + diff --git a/tools/xmls/CurvatureAnisotropicDiffusion.xml b/tools/xmls/CurvatureAnisotropicDiffusion.xml new file mode 100644 index 0000000..ee806d3 --- /dev/null +++ b/tools/xmls/CurvatureAnisotropicDiffusion.xml @@ -0,0 +1,72 @@ + + + Filtering.Denoising + 2 + Curvature Anisotropic Diffusion + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/CurvatureAnisotropicDiffusion + + Bill Lorensen (GE) + + + + + + conductance + --conductance + + + + 1 + + 0 + 10 + .01 + + + + numberOfIterations + --iterations + + + 1 + + 1 + 30 + 1 + + + + timeStep + --timeStep + + + + 0.0625 + + .001 + .0625 + .001 + + + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/DWICompare.xml b/tools/xmls/DWICompare.xml new file mode 100755 index 0000000..a67be5f --- /dev/null +++ b/tools/xmls/DWICompare.xml @@ -0,0 +1,37 @@ + + + Converters + Nrrd DWI comparison + + 5.2.0 + http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/DWIConvert + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Mark Scully (UIowa) + + + + + + inputVolume1 + --inputVolume1 + + input + + + + inputVolume2 + --inputVolume2 + + input + + + + useIdentityMeasurementFrame + --useIdentityMeasurementFrame + + false + input + + + + diff --git a/tools/xmls/DWIConvert.xml b/tools/xmls/DWIConvert.xml new file mode 100755 index 0000000..b302b19 --- /dev/null +++ b/tools/xmls/DWIConvert.xml @@ -0,0 +1,184 @@ + + + Diffusion.Import and Export + Diffusion-weighted DICOM Import (DWIConvert) + + 5.2.0 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.5/Modules/DWIConverter + Apache License Version 2.0 + Hans Johnson (UIowa), Vince Magnotta (UIowa) Joy Matsui (UIowa), Kent Williams (UIowa), Mark Scully (Uiowa), Xiaodong Tao (GE) + + + + + + + conversionMode + --conversionMode + + DicomToNrrd + DicomToNrrd + DicomToFSL + NrrdToFSL + FSLToNrrd + + + inputVolume + --inputVolume + + input + + + + + outputVolume + -o + --outputVolume + + output + + + + + + + + + inputDicomDirectory + -i + --inputDicomDirectory + + input + + + + + + + + + + fslNIFTIFile + --fslNIFTIFile + + input + + + + inputBValues + --inputBValues + + input + + + + inputBVectors + --inputBVectors + + input + + + + + + + + + outputNiftiFile + --outputNiftiFile + + output + + + + outputBValues + --outputBValues + + output + + .bval)]]> + + + + outputBVectors + --outputBVectors + + output + + .bvec)]]> + + + + + + + + + writeProtocolGradientsFile + --writeProtocolGradientsFile + + + false + + + useIdentityMeaseurementFrame + --useIdentityMeaseurementFrame + + + false + + + useBMatrixGradientDirections + --useBMatrixGradientDirections + + + false + + + outputDirectory + --outputDirectory + + output + + . + + + smallGradientThreshold + --smallGradientThreshold + + + 0.2 + + + transpose + transposeInputBVectors + + true + + + + allowLossyConversion + allowLossyConversion + + false + + + + + + + gradientVectorFile + --gradientVectorFile + + output + + + + fMRIOutput + --fMRI + + DEPRECATED: No support or testing. Output a NRRD file, but without gradients + + + + diff --git a/tools/xmls/DWISimpleCompare.xml b/tools/xmls/DWISimpleCompare.xml new file mode 100644 index 0000000..69840c1 --- /dev/null +++ b/tools/xmls/DWISimpleCompare.xml @@ -0,0 +1,36 @@ + + + Converters + Nrrd DWI comparison + + 5.2.0 + http://www.slicer.org/slicerWiki/index.php/Documentation/4.1/Modules/DWIConvert + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Mark Scully (UIowa) + + + + + + inputVolume1 + --inputVolume1 + + input + + + + inputVolume2 + --inputVolume2 + + input + + + + CheckDWIData + --checkDWIData + + false + check for existence of DWI data, and if present, compare it + + + diff --git a/tools/xmls/DiffusionTensorTest.xml b/tools/xmls/DiffusionTensorTest.xml new file mode 100644 index 0000000..307d191 --- /dev/null +++ b/tools/xmls/DiffusionTensorTest.xml @@ -0,0 +1,28 @@ + + + Legacy.Work in Progress.Diffusion Tensor.Test + Simple IO Test + + 0.1.0.$Revision$(alpha) + + + Bill Lorensen (GE) + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/ESLR.xml b/tools/xmls/ESLR.xml new file mode 100644 index 0000000..605f94b --- /dev/null +++ b/tools/xmls/ESLR.xml @@ -0,0 +1,80 @@ + + + Segmentation.Specialized + Clean Contiguous Label Map (BRAINS) + From a range of label map values, extract the largest contiguous region of those labels + + + + + + inputVolume + inputVolume + Input Label Volume + + + input + + + outputVolume + outputVolume + Output Label Volume + + + output + + + low + low + The lower bound of the labels to be used. + + 1 + + + high + high + The higher bound of the labels to be used. + + 5 + + + closingSize + closingSize + The closing size for hole filling. + + 2 + + + openingSize + openingSize + The opening size for hole filling. + + 2 + + + safetySize + safetySize + The safetySize size for the clipping region. + + 1 + + + preserveOutside + preserveOutside + For values outside the specified range, preserve those values. + + false + + + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + + diff --git a/tools/xmls/ExecutionModelTour.xml b/tools/xmls/ExecutionModelTour.xml new file mode 100644 index 0000000..a8fb8bd --- /dev/null +++ b/tools/xmls/ExecutionModelTour.xml @@ -0,0 +1,360 @@ + + + Developer Tools + Execution Model Tour + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ExecutionModelTour + + Daniel Blezek (GE), Bill Lorensen (GE) + + + + + + integerVariable + -i + --integer + + + 30 + + + doubleVariable + -d + --double + + + 30 + + 0 + 1.e3 + 10 + + + + + + + + floatVector + f + + + 1.3,2,-14 + + + stringVector + string_vector + + + foo,bar,foobar + + + + + + + stringChoice + e + enumeration + + + Bill + Ron + Eric + Bill + Ross + Steve + Will + árvíztűrő tükörfúrógép + + + + + + + boolean1 + boolean1 + + + true + + + boolean2 + boolean2 + + + false + + + boolean3 + boolean3 + + + + + + + + + file1 + + + input + + + files + + + input + + + outputFile1 + + + output + + + directory1 + + + input + + + image1 + + + input + + + image2 + + + output + + + + + + + transformInput + + + input + + + transform1 + + + input + + + transformInputNonlinear + + + input + + + transformInputBspline + + + input + + + transformOutput + + + output + + + transform2 + + + output + + + transformOutputNonlinear + + + output + + + transformOutputBspline + + + output + + + + + + + seed + + --seed + + 0,0,0 + + + seedsFile + + + seedsFile + input + + + seedsOutFile + + + seedsOutFile + output + + + + + + + InputModel + + inputModel + input + + + + OutputModel + + outputModel + output + + + + ModelSceneFile + output + + modelSceneFile + + models.mrml + + + + + + + arg0 + input + 0 + + + + + arg1 + output + 1 + + + + + + + + regions + + region + + + + + + + inputFA + input + + inputFA + + + + outputFA + output + + outputFA + + + + + + + inputDT + input + + inputDT + +
+ + outputDT + output + + outputDT + +
+
+ + + + anintegerreturn + + output + 5 + + + + abooleanreturn + + output + false + + + + afloatreturn + + output + 7.0 + + + + adoublereturn + + output + 14.0 + + + + astringreturn + + output + Hello + + + + anintegervectorreturn + + output + 1,2,3 + + + + astringchoicereturn + output + + + Bill + Ron + Eric + Bill + Ross + Steve + Will + árvíztűrő tükörfúrógép + + +
diff --git a/tools/xmls/ExpertAutomatedRegistration.xml b/tools/xmls/ExpertAutomatedRegistration.xml new file mode 100644 index 0000000..76c0b26 --- /dev/null +++ b/tools/xmls/ExpertAutomatedRegistration.xml @@ -0,0 +1,263 @@ + + + Legacy.Registration + Expert Automated Registration + 7 + + 0.1.0.$Revision: 2104 $(alpha) + http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ExpertAutomatedRegistration + + Stephen R Aylward (Kitware), Casey B Goodlett (Kitware) + + + + + + fixedImage + + input + 0 + + + + movingImage + + input + 1 + + + + resampledImage + + output + resampledImage + + + + + + + + + loadTransform + + + loadTransform + input + + + + saveTransform + + + saveTransform + output + + + + + + initialization + + + initialization + None + Landmarks + ImageCenters + CentersOfMass + SecondMoments + CentersOfMass + + + registration + + + registration + None + Initial + Rigid + Affine + BSpline + PipelineRigid + PipelineAffine + PipelineBSpline + PipelineAffine + + + metric + + + metric + MattesMI + NormCorr + MeanSqrd + MattesMI + + + expectedOffset + + + expectedOffset + 10 + + + expectedRotation + + + expectedRotation + 0.1 + + + expectedScale + + + expectedScale + 0.05 + + + expectedSkew + + + expectedSkew + 0.01 + + + + + + + verbosityLevel + + + verbosityLevel + Silent + Standard + Verbose + Standard + + + sampleFromOverlap + + + sampleFromOverlap + false + + + fixedImageMask + + input + fixedImageMask + + + + randomNumberSeed + + + randomNumberSeed + 0 + + + numberOfThreads + + + numberOfThreads + 0 + + + minimizeMemory + + + minimizeMemory + false + + + interpolation + + + interpolation + NearestNeighbor + Linear + BSpline + Linear + + + + + + + fixedLandmarks + + + fixedLandmarks + + + + movingLandmarks + + + movingLandmarks + + + + + + + + rigidMaxIterations + + + rigidMaxIterations + 100 + + + rigidSamplingRatio + + + rigidSamplingRatio + 0.01 + + + + + + + affineMaxIterations + + + affineMaxIterations + 50 + + + affineSamplingRatio + + + affineSamplingRatio + 0.02 + + + + + + + bsplineMaxIterations + + + bsplineMaxIterations + 20 + + + bsplineSamplingRatio + + + bsplineSamplingRatio + 0.10 + + + controlPointSpacing + + + controlPointSpacing + 40 + + + diff --git a/tools/xmls/ExtractSkeleton.xml b/tools/xmls/ExtractSkeleton.xml new file mode 100755 index 0000000..0f97285 --- /dev/null +++ b/tools/xmls/ExtractSkeleton.xml @@ -0,0 +1,70 @@ + + + Filtering + Extract Skeleton + + 0.1.0.$Revision: 2104 $(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ExtractSkeleton + + Pierre Seroul (UNC), Martin Styner (UNC), Guido Gerig (UNC), Stephen Aylward (Kitware) + + + + + + InputImageFileName + + input + 1 + + + + OutputImageFileName + + output + 2 + + + + + + + + SkeletonType + type + + + 1D + 1D + 2D + + + DontPruneBranches + dontPrune + + + false + + + NumberOfPoints + numPoints + + + 100 + + + OutputPointsFileName + pointsFile + + + skeleton.txt + + + OutputFiducialsFileName + + + fiducialsFile + output + + + diff --git a/tools/xmls/FiducialRegistration.xml b/tools/xmls/FiducialRegistration.xml new file mode 100644 index 0000000..f721f4b --- /dev/null +++ b/tools/xmls/FiducialRegistration.xml @@ -0,0 +1,61 @@ + + + Registration.Specialized + Fiducial Registration + + 0.1.0.$Revision$ + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/TransformFromFiducials + + Casey B Goodlett (Kitware), Dominik Meier (SPL, BWH) + + + + + + fixedLandmarks + + + fixedLandmarks + input + + + movingLandmarks + + + movingLandmarks + input + + + saveTransform + + + saveTransform + output + + + + + transformType + + + transformType + Translation + Rigid + Similarity + Rigid + + + rms + + + output + 0 + + + outputMessage + + output + + + + diff --git a/tools/xmls/FindCenterOfBrain.xml b/tools/xmls/FindCenterOfBrain.xml new file mode 100644 index 0000000..fcdb35f --- /dev/null +++ b/tools/xmls/FindCenterOfBrain.xml @@ -0,0 +1,142 @@ + + + Utilities.BRAINS + Center Of Brain (BRAINS) + Finds the center point of a brain + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Hans J. Johnson, hans-johnson -at- uiowa.edu, http://wwww.psychiatry.uiowa.edu + Hans Johnson(1,3,4); Kent Williams(1); (1=University of Iowa Department of Psychiatry, 3=University of Iowa Department of Biomedical Engineering, 4=University of Iowa Department of Electrical and Computer Engineering + 5.2.0 + + + + InputVolume + --inputVolume + + The image in which to find the center. + input + + + + ImageMask + --imageMask + + + input + + + + ClippedImageMask + --clippedImageMask + + + output + + + + + + + + Maximize + --maximize + + + true + + + Axis + --axis + + + 2 + + + OtsuPercentileThreshold + --otsuPercentileThreshold + + + 0.001 + + + ClosingSize + --closingSize + + + 7 + + + HeadSizeLimit + --headSizeLimit + + + 1000 + + + + HeadSizeEstimate + --headSizeEstimate + + + 0 + + + BackgroundValue + --backgroundValue + + + 0 + + + + + + GenerateDebugImages + --generateDebugImages + + + false + + + DebugDistanceImage + --debugDistanceImage + + + output + + + + DebugGridImage + --debugGridImage + + + output + + + + DebugAfterGridComputationsForegroundImage + --debugAfterGridComputationsForegroundImage + + + output + + + + DebugClippedImageMask + --debugClippedImageMask + + + output + + + + DebugTrimmedImage + --debugTrimmedImage + + + output + + + + diff --git a/tools/xmls/GaussianBlurImageFilter.xml b/tools/xmls/GaussianBlurImageFilter.xml new file mode 100755 index 0000000..a17733b --- /dev/null +++ b/tools/xmls/GaussianBlurImageFilter.xml @@ -0,0 +1,38 @@ + + + Filtering.Denoising + 3 + Gaussian Blur Image Filter + + 0.1.0.$Revision: 1.1 $(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GaussianBlurImageFilter + + Julien Jomier (Kitware), Stephen Aylward (Kitware) + + + + sigma + sigma + s + + + 1.0 + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/GenerateAverageLmkFile.xml b/tools/xmls/GenerateAverageLmkFile.xml new file mode 100755 index 0000000..1bc1186 --- /dev/null +++ b/tools/xmls/GenerateAverageLmkFile.xml @@ -0,0 +1,46 @@ + + + Testing + Average Fiducials + + This program gets several fcsv file each one contains several landmarks with the same name but slightly different coordinates. For EACH landmark we compute the average coordination. + + 5.2.0 + + + Ali Ghayoor + + + + + + Input/output parameters + + + inputLandmarkFiles + inputLandmarkFiles + + input + Input landmark files names (.fcsv or .wts). + + + + inputLandmarkListFile + inputLandmarkListFile + + input + A single file for a list of filenames one per line. + + + + + outputLandmarkFile + outputLandmarkFile + + output + Ouput landmark file name that includes average values for landmarks (.fcsv or .wts) + ./outputAverageLandmark.fcsv + + + + diff --git a/tools/xmls/GenerateEdgeMapImage.xml b/tools/xmls/GenerateEdgeMapImage.xml new file mode 100644 index 0000000..bc2f66d --- /dev/null +++ b/tools/xmls/GenerateEdgeMapImage.xml @@ -0,0 +1,73 @@ + + + SuperResolution + GenerateEdgeMapImage + Inverse of Maximum Gradient Image + 5.2.0 + + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Ali Ghayoor + + + + inputMRVolumes + inputMRVolumes + + input + Input image files names + + + inputMask + inputMask + Input mask file name. If set, image histogram percentiles will be calculated within the mask + input + + + outputMaximumGradientImage + outputMaximumGradientImage + output gradient image file name + output + + + outputEdgeMap + outputEdgeMap + output edgemap file name + output + + + lowerPercentileMatching + lowerPercentileMatching + + Map lower quantile and below to minOutputRange. It should be a value between zero and one. + 0.5 + + + upperPercentileMatching + upperPercentileMatching + + Map upper quantile and above to maxOutputRange. It should be a value between zero and one. + 0.95 + + + minimumOutputRange + minimumOutputRange + + Map lower quantile and below to minimum output range. It should be an epsilon number greater than zero. Default is 1. + 1 + + + maximumOutputRange + maximumOutputRange + + Map upper quantile and above to maximum output range. Default is 255 that is the maximum range of unsigned char. + 255 + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/GenerateLabelMapFromProbabilityMap.xml b/tools/xmls/GenerateLabelMapFromProbabilityMap.xml new file mode 100644 index 0000000..f61c8dd --- /dev/null +++ b/tools/xmls/GenerateLabelMapFromProbabilityMap.xml @@ -0,0 +1,44 @@ + + + Utilities.BRAINS + Label Map from Probability Images + + Given a list of probability maps for labels, create a discrete label map where only the highest probability region is used for the labeling. + + 5.2.0 + + + University of Iowa Department of Psychiatry, http:://www.psychiatry.uiowa.edu + + + + + + + inputVolumes + inputVolumes + The Input probaiblity images to be computed for lable maps + input + + + + + outputLabelVolume + outputLabelVolume + The Input binary image for region of interest + output + + + + + + + + numberOfThreads + numberOfThreads + + Explicitly specify the maximum number of threads to use. + -1 + + + diff --git a/tools/xmls/GeneratePurePlugMask.xml b/tools/xmls/GeneratePurePlugMask.xml new file mode 100644 index 0000000..bc5f737 --- /dev/null +++ b/tools/xmls/GeneratePurePlugMask.xml @@ -0,0 +1,64 @@ + + + Classification + Pure Plugs Mask + + This program gets several modality image files and returns a binary mask that defines the pure plugs. + + 5.2.0 + + + Ali Ghayoor + + + + + + Input/output parameters + + + inputImageModalities + inputImageModalities + + input + Input image files names (.nii.gz or .nrrd) + + + + threshold + threshold + + input + threshold value to define class membership. + 0.2 + + + + numberOfSubSamples + numberOfSubSamples + + input + Number of continous index samples taken at each direction of lattice space for each plug volume. + 0,0,0 + + + + verbose + v + verbose + + false + Print out some debugging information. + + + + outputMaskFile + outputMaskFile + + output + Ouput binary mask that includes the pure plugs (.nrrd) + ./purePlugsBinaryMask.nrrd + + + + diff --git a/tools/xmls/GradientAnisotropicDiffusion.xml b/tools/xmls/GradientAnisotropicDiffusion.xml new file mode 100644 index 0000000..9eaad6c --- /dev/null +++ b/tools/xmls/GradientAnisotropicDiffusion.xml @@ -0,0 +1,81 @@ + + + Filtering.Denoising + 1 + Gradient Anisotropic Diffusion + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GradientAnisotropicDiffusion + + Bill Lorensen (GE) + + + + + + conductance + --conductance + + + 1 + + 0 + 10 + .01 + + + + numberOfIterations + --iterations + + + 5 + + 1 + 30 + 1 + + + + timeStep + --timeStep + + + 0.0625 + + .001 + .0625 + .001 + + + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + + + + + useImageSpacing + --useImageSpacing + ![CDATA[Take into account image spacing in the computation. It is advisable to turn this option on, especially when the pixel size is different in different dimensions. However, to produce results consistent with Slicer4.2 and earlier, this option should be turned off.]] + + true + + + diff --git a/tools/xmls/GrayscaleFillHoleImageFilter.xml b/tools/xmls/GrayscaleFillHoleImageFilter.xml new file mode 100644 index 0000000..b5e80bd --- /dev/null +++ b/tools/xmls/GrayscaleFillHoleImageFilter.xml @@ -0,0 +1,29 @@ + + + Filtering.Morphology + Grayscale Fill Hole Image Filter + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GrayscaleFillHoleImageFilter + + Bill Lorensen (GE) + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/GrayscaleGrindPeakImageFilter.xml b/tools/xmls/GrayscaleGrindPeakImageFilter.xml new file mode 100644 index 0000000..3f42fe6 --- /dev/null +++ b/tools/xmls/GrayscaleGrindPeakImageFilter.xml @@ -0,0 +1,29 @@ + + + Filtering.Morphology + Grayscale Grind Peak Image Filter + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GrayscaleGrindPeakImageFilter + + Bill Lorensen (GE) + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/GrayscaleModelMaker.xml b/tools/xmls/GrayscaleModelMaker.xml new file mode 100644 index 0000000..2482b41 --- /dev/null +++ b/tools/xmls/GrayscaleModelMaker.xml @@ -0,0 +1,97 @@ + + + Surface Models + Grayscale Model Maker + + 3.0 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/GrayscaleModelMaker + slicer3 + Nicole Aucoin (SPL, BWH), Bill Lorensen (GE) + + + + + + InputVolume + + input + 0 + + + + OutputGeometry + + output + 1 + + + + + + + + Threshold + -t + --threshold + + + 100.0 + + + Name + + -n + --name + + Model + + + Smooth + + --smooth + + 15 + + 0 + 50 + 1 + + + + Decimate + + --decimate + + 0.25 + + 0.0 + 1.0 + + + + SplitNormals + + --splitnormals + + true + + + PointNormals + + --pointnormals + + true + + + + + + Debug + + + -d + --debug + false + + + diff --git a/tools/xmls/HistogramMatching.xml b/tools/xmls/HistogramMatching.xml new file mode 100644 index 0000000..c888e4e --- /dev/null +++ b/tools/xmls/HistogramMatching.xml @@ -0,0 +1,61 @@ + + + Filtering + Histogram Matching + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/HistogramMatching + + Bill Lorensen (GE) + + + + + + numberOfHistogramLevels + --numberOfHistogramLevels + + + 128 + + + numberOfMatchPoints + --numberOfMatchPoints + + + 10 + + + thresholdAtMeanIntensity + --threshold + + + false + + + + + + + inputVolume + + input + 0 + + + + referenceVolume + + input + 1 + + + + outputVolume + + output + 2 + + + + diff --git a/tools/xmls/ImageLabelCombine.xml b/tools/xmls/ImageLabelCombine.xml new file mode 100644 index 0000000..e263825 --- /dev/null +++ b/tools/xmls/ImageLabelCombine.xml @@ -0,0 +1,48 @@ + + + Filtering + Image Label Combine + + 0.1.0 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ImageLabelCombine + + Alex Yarmarkovich (SPL, BWH) + + + + + + InputLabelMap_A + + input + 0 + + + + InputLabelMap_B + + input + 1 + + + + OutputLabelMap + + output + 2 + + + + + + + + FirstOverwrites + -f + --first_overwrites + + + true + + + diff --git a/tools/xmls/LabelMapSmoothing.xml b/tools/xmls/LabelMapSmoothing.xml new file mode 100644 index 0000000..396d0d1 --- /dev/null +++ b/tools/xmls/LabelMapSmoothing.xml @@ -0,0 +1,69 @@ + + + Surface Models + Label Map Smoothing + + 1.0 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/LabelMapSmoothing + + Dirk Padfield (GE), Josh Cates (Utah), Ross Whitaker (Utah) + + + + + + labelToSmooth + --labelToSmooth + + + -1 + + + + + + + numberOfIterations + --numberOfIterations + + + 50 + + + maxRMSError + --maxRMSError + + + 0.01 + + + + + + + gaussianSigma + --gaussianSigma + + + 0.2 + + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/LandmarksCompare.xml b/tools/xmls/LandmarksCompare.xml new file mode 100755 index 0000000..ea95885 --- /dev/null +++ b/tools/xmls/LandmarksCompare.xml @@ -0,0 +1,53 @@ + + + Testing + Compare Fiducials + + Compares two .fcsv or .wts text files and verifies that they are identicle. Used for testing landmarks files. + + 5.2.0 + + + Ali Ghayoor + + + + + + Input/output parameters + + + inputLandmarkFile1 + --inputLandmarkFile1 + + input + First input landmark file (.fcsv or .wts) + + + + inputLandmarkFile2 + --inputLandmarkFile2 + + input + Second input landmark file. This can be a vector of baseline file names (.fcsv or .wts) + + + + weights + --weights + + input + Weights on the tolerance to accept ( tolerance / weights ) + + + + tolerance + tolerance + + The maximum error (in mm) allowed in each direction of a landmark + 0.0001 + + + + + diff --git a/tools/xmls/MaskScalarVolume.xml b/tools/xmls/MaskScalarVolume.xml new file mode 100644 index 0000000..a44e67a --- /dev/null +++ b/tools/xmls/MaskScalarVolume.xml @@ -0,0 +1,56 @@ + + + Filtering.Arithmetic + Mask Scalar Volume + + 0.1.0.$Revision: 8595 $(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Mask + + Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + + + + + + InputVolume + + input + 0 + + + + MaskVolume + + input + 1 + + + + OutputVolume + + output + 2 + + + + + + + + Label + + -l + --label + 1 + + + + Replace + + -r + --replace + 0 + + + + diff --git a/tools/xmls/MedianImageFilter.xml b/tools/xmls/MedianImageFilter.xml new file mode 100644 index 0000000..3b061e0 --- /dev/null +++ b/tools/xmls/MedianImageFilter.xml @@ -0,0 +1,41 @@ + + + Filtering.Denoising + 4 + Median Image Filter + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/MedianImageFilter + + Bill Lorensen (GE) + + + + + + neighborhood + --neighborhood + + + 1,1,1 + + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/MergeModels.xml b/tools/xmls/MergeModels.xml new file mode 100644 index 0000000..c206c14 --- /dev/null +++ b/tools/xmls/MergeModels.xml @@ -0,0 +1,36 @@ + + + Surface Models + Merge Models + + $Revision$ + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/MergeModels + + Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH), Daniel Haehn (SPL, BWH, UPenn) + + + + + + Model1 + + input + 1 + + + + Model2 + + input + 2 + + + + ModelOutput + + output + 3 + + + + diff --git a/tools/xmls/ModelMaker.xml b/tools/xmls/ModelMaker.xml new file mode 100755 index 0000000..cf2046a --- /dev/null +++ b/tools/xmls/ModelMaker.xml @@ -0,0 +1,175 @@ + + + Surface Models + Model Maker + Models are imported into Slicer under a model hierarchy node in a MRML scene. The model colors are set by the color table associated with the input volume (these colours will only be visible if you load the model scene file).

IO:

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()

]]>
+ 4.4 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ModelMaker + slicer4 + Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH), Bill Lorensen (GE) + + + + + + InputVolume + + input + 0 + + + + ColorTable + input + color + + + + ModelSceneFile + output + + --modelSceneFile + + models.mrml + + + + + + + Name + + -n + --name + + Model + + + GenerateAll + + --generateAll + + true + + + + + + + Labels + -l + -labels + + + + + StartLabel + + -s + --start + + -1 + + + EndLabel + + -e + --end + + -1 + + + SkipUnNamed + + --skipUnNamed + + true + + + JointSmoothing + + + -j + --jointsmooth + false + + + Smooth + + --smooth + + 10 + + 0 + 100 + + + + FilterType + + + --filtertype + Sinc + Sinc + Laplacian + + + Decimate + + --decimate + + 0.25 + + 0.0 + 1.0 + 0.01 + + + + SplitNormals + + --splitnormals + + true + + + PointNormals + + --pointnormals + + true + + + Pad + + --pad + + true + + + + + + ModelHierarchyFile + input + + --modelHierarchyFile + + + + SaveIntermediateModels + + saveIntermediateModels + Python Interactor) using the following command slicer.modules.modelmaker.cliModuleLogic().DeleteTemporaryFilesOff().]]> + false + + + debug + + + -d + --debug + false + + +
diff --git a/tools/xmls/ModelToLabelMap.xml b/tools/xmls/ModelToLabelMap.xml new file mode 100644 index 0000000..dbde6bc --- /dev/null +++ b/tools/xmls/ModelToLabelMap.xml @@ -0,0 +1,53 @@ + + + Surface Models + Model To LabelMap + + $Revision: 8643 $ + http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ModelToLabelMap + + Andras Lasso (PerkLab), Csaba Pinter (PerkLab), Nicole Aucoin (SPL, BWH), Xiaodong Tao (GE) + + + + + + labelValue + + + l + labelValue + 255 + + 0 + 255 + 1 + + + + + + + + InputVolume + + input + 0 + + + + surface + + input + 1 + + + + OutputVolume + + output + 2 + + + + diff --git a/tools/xmls/MultiplyScalarVolumes.xml b/tools/xmls/MultiplyScalarVolumes.xml new file mode 100644 index 0000000..c667b62 --- /dev/null +++ b/tools/xmls/MultiplyScalarVolumes.xml @@ -0,0 +1,51 @@ + + + Filtering.Arithmetic + Multiply Scalar Volumes + + 0.1.0.$Revision: 8595 $(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Multiply + + Bill Lorensen (GE) + + + + + + inputVolume1 + + input + 0 + + + + inputVolume2 + + input + 1 + + + + outputVolume + + output + 2 + + + + + + + + order + + 1 + 0 + 1 + 2 + 3 + order + + + + diff --git a/tools/xmls/N4ITKBiasFieldCorrection.xml b/tools/xmls/N4ITKBiasFieldCorrection.xml new file mode 100644 index 0000000..ffdfb26 --- /dev/null +++ b/tools/xmls/N4ITKBiasFieldCorrection.xml @@ -0,0 +1,130 @@ + + + Filtering + N4ITK MRI Bias correction + 3 + + 9 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/N4ITKBiasFieldCorrection + + Nick Tustison (UPenn), Andrey Fedorov (SPL, BWH), Ron Kikinis (SPL, BWH) + + + + + + inputImageName + + input + 0 + + + + maskimage + maskImageName + + input + + + + outputImageName + + output + 1 + + + + outputbiasfield + outputBiasFieldName + + output + + + + + + + initialMeshResolution + meshresolution + + + 1,1,1 + + + splineDistance + splinedistance + + + 0 + + + + bfFWHM + bffwhm + + + 0 + + + + + + + + + numberOfIterations + iterations + + + 50,40,30 + + + convergenceThreshold + convergencethreshold + + + 0.0001 + + + + bsplineOrder + bsplineorder + + + 3 + + + + shrinkFactor + shrinkfactor + + + 4 + + + + weightimage + weightImageName + + input + + + + + wienerFilterNoise + wienerfilternoise + + + 0 + + + + nHistogramBins + nhistogrambins + + + 0 + + + + diff --git a/tools/xmls/OrientScalarVolume.xml b/tools/xmls/OrientScalarVolume.xml new file mode 100644 index 0000000..d6db2ab --- /dev/null +++ b/tools/xmls/OrientScalarVolume.xml @@ -0,0 +1,92 @@ + + + Converters + Orient Scalar Volume + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/OrientImage + + Bill Lorensen (GE) + + + + + + inputVolume1 + + input + 0 + + + + outputVolume + + output + 1 + + + + + + + + orientation + o + orientation + + LPS + + Axial + Coronal + Sagittal + RIP + LIP + RSP + LSP + RIA + LIA + RSA + LSA + IRP + ILP + SRP + SLP + IRA + ILA + SRA + SLA + RPI + LPI + RAI + LAI + RPS + LPS + RAS + LAS + PRI + PLI + ARI + ALI + PRS + PLS + ARS + ALS + IPR + SPR + IAR + SAR + IPL + SPL + IAL + SAL + PIR + PSR + AIR + ASR + PIL + PSL + AIL + ASL + + + diff --git a/tools/xmls/PETStandardUptakeValueComputation.xml b/tools/xmls/PETStandardUptakeValueComputation.xml new file mode 100644 index 0000000..59bb6e9 --- /dev/null +++ b/tools/xmls/PETStandardUptakeValueComputation.xml @@ -0,0 +1,87 @@ + + + Quantification + PET Standard Uptake Value Computation + + 0.1.0.$Revision: 8595 $(alpha) + http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ComputeSUVBodyWeight + + Wendy Plesniak (SPL, BWH), Nicole Aucoin (SPL, BWH), Ron Kikinis (SPL, BWH) + + + + + + PETDICOMPath + + input + -p + --petDICOMPath + + + + PETVolume + + input + -v + --petVolume + + + + VOIVolume + + input + -l + --labelMap + + + + ColorTable + input + --color + + + + + + + + OutputCSV + + + -o + --csvFile + output +
+ + OutputLabel + + output + + + + OutputLabelValue + + output + + + + SUVMax + + output + + + + SUVMean + + output + + + + SUVMin + + output + + +
+
diff --git a/tools/xmls/PerformMetricTest.xml b/tools/xmls/PerformMetricTest.xml new file mode 100644 index 0000000..1064254 --- /dev/null +++ b/tools/xmls/PerformMetricTest.xml @@ -0,0 +1,75 @@ + + + Registration + Metric Test + + Compare Mattes/MSQ metric value for two input images and a possible input BSpline transform. + + 5.2.0 + A utility to compare metric value between two input images. + https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt + Ali Ghayoor + + + + + + Input parameters + + + input + inputBSplineTransform + + + Input transform that is use to warp moving image before metric comparison. + + inputBSplineTransform + + + + input + inputFixedImage + + inputFixedImage + + + + input + inputMovingImage + + inputMovingImage + + + + + + Metric type and input parameters. + + + metricType + metricType + + Comparison metric type + MMI + MMI + MSE + + + + numberOfSamples + numberOfSamples + + The number of voxels sampled for metric evaluation. + 0 + + + + numberOfHistogramBins + numberOfHistogramBins + + The number of historgram bins when MMI (Mattes) is metric type. + 50 + + + + diff --git a/tools/xmls/ProbeVolumeWithModel.xml b/tools/xmls/ProbeVolumeWithModel.xml new file mode 100644 index 0000000..f58d7d3 --- /dev/null +++ b/tools/xmls/ProbeVolumeWithModel.xml @@ -0,0 +1,36 @@ + + + Surface Models + Probe Volume With Model + + 0.1.0.$Revision: 1892 $(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ProbeVolumeWithModel + + Lauren O'Donnell (SPL, BWH) + + + + + + InputVolume + + input + 0 + + + + InputModel + + input + 1 + + + + OutputModel + + output + 2 + + + + diff --git a/tools/xmls/ResampleDTIVolume.xml b/tools/xmls/ResampleDTIVolume.xml new file mode 100644 index 0000000..cac399b --- /dev/null +++ b/tools/xmls/ResampleDTIVolume.xml @@ -0,0 +1,283 @@ + + + Diffusion.Utilities + Resample DTI Volume + + 1.0.2 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ResampleDTI + + Francois Budin (UNC) + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + referenceVolume + + input + -R + --Reference + + + + + + + + + transformationFile + + -f + --transformationFile + + input + + + deffield + + input + -H + --defField + + + + + typeOfField + --hfieldtype + + + displacement + h-Field + h-Field + + + + + + interpolationType + -i + --interpolation + + + linear + nn + ws + bs + linear + + + noMeasurementFrame + --noMeasurementFrame + + + false + + + correction + --correction + + + zero + none + abs + nearest + zero + + + + + + ppd + --transform_tensor_method + -T + + + PPD + FS + PPD + + + + + + + transformsOrder + --transform_order + + + input-to-output + output-to-input + output-to-input + + + notbulk + --notbulk + + + false + + + space + --spaceChange + + + false + + + + + + rotationPoint + -r + --rotation_point + + + 0,0,0 + + + centeredTransform + -c + --centered_transform + + + false + + + imageCenter + --image_center + + + input + output + input + + + inverseITKTransformation + -b + --Inverse_ITK_Transformation + + + false + + + + + + + outputImageSpacing + -s + --spacing + + + 0,0,0 + + + outputImageSize + -z + --size + + + 0,0,0 + + + outputImageOrigin + -O + --origin + + + + + + directionMatrix + -d + --direction_matrix + + + 0,0,0,0,0,0,0,0,0 + + + + + + + numberOfThread + -n + --number_of_thread + + + 0 + + + defaultPixelValue + -p + --default_pixel_value + + + 1e-10 + + + + + + + windowFunction + -W + --window_function + + + h + c + w + l + b + c + + + + + + + splineOrder + -o + --spline_order + + + 3 + + + + + + transformMatrix + -m + --transform_matrix + + + 1,0,0,0,1,0,0,0,1,0,0,0 + + + transformType + -t + --transform + + + rt + a + a + + + diff --git a/tools/xmls/ResampleScalarVectorDWIVolume.xml b/tools/xmls/ResampleScalarVectorDWIVolume.xml new file mode 100644 index 0000000..e748696 --- /dev/null +++ b/tools/xmls/ResampleScalarVectorDWIVolume.xml @@ -0,0 +1,253 @@ + + + Filtering + Diffusion.Utilities + Resample Scalar/Vector/DWI Volume + + 0.1 + http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ResampleScalarVectorDWIVolume + + Francois Budin (UNC) + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + referenceVolume + + input + -R + --Reference + + + + + + + + + transformationFile + + -f + --transformationFile + + input + + + deffield + + input + -H + --defField + + + + + typeOfField + --hfieldtype + + + displacement + h-Field + h-Field + + + + + + interpolationType + -i + --interpolation + + + linear + nn + ws + bs + linear + + + + + + + transformsOrder + --transform_order + + + input-to-output + output-to-input + output-to-input + + + notbulk + --notbulk + + + false + + + space + --spaceChange + + + false + + + + + + rotationPoint + -r + --rotation_point + + + 0,0,0 + + + centeredTransform + -c + --centered_transform + + + false + + + imageCenter + --image_center + + + input + output + input + + + inverseITKTransformation + -b + --Inverse_ITK_Transformation + + + false + + + + + + + outputImageSpacing + -s + --spacing + + + 0,0,0 + + + outputImageSize + -z + --size + + + 0,0,0 + + + outputImageOrigin + -O + --origin + + + + + + directionMatrix + -d + --direction_matrix + + + 0,0,0,0,0,0,0,0,0 + + + + + + + numberOfThread + -n + --number_of_thread + + + 0 + + + defaultPixelValue + -p + --default_pixel_value + + + 0 + + + + + + + windowFunction + -W + --window_function + + + h + c + w + l + b + c + + + + + + + splineOrder + -o + --spline_order + + + 3 + + + + + + transformMatrix + -m + --transform_matrix + + + 1,0,0,0,1,0,0,0,1,0,0,0 + + + transformType + -t + --transform + + + rt + a + a + + + diff --git a/tools/xmls/ResampleScalarVolume.xml b/tools/xmls/ResampleScalarVolume.xml new file mode 100644 index 0000000..ff52035 --- /dev/null +++ b/tools/xmls/ResampleScalarVolume.xml @@ -0,0 +1,57 @@ + + + Legacy.Filtering + Resample Scalar Volume + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ResampleVolume + + Bill Lorensen (GE) + + + + + + outputPixelSpacing + -s + --spacing + + + 0,0,0 + + + interpolationType + -i + --interpolation + + + linear + linear + nearestNeighbor + bspline + hamming + cosine + welch + lanczos + blackman + + + + + + + InputVolume + 0 + + + input + + + OutputVolume + 1 + + + output + + + diff --git a/tools/xmls/RobustStatisticsSegmenter.xml b/tools/xmls/RobustStatisticsSegmenter.xml new file mode 100644 index 0000000..f90c728 --- /dev/null +++ b/tools/xmls/RobustStatisticsSegmenter.xml @@ -0,0 +1,106 @@ + + + Segmentation.Specialized + Robust Statistics Segmenter + + 1.0 + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/RobustStatisticsSegmenter + + Yi Gao (gatech), Allen Tannenbaum (gatech), Ron Kikinis (SPL, BWH) + + + + + + expectedVolume + expectedVolume + v + + + 50 + + 0.0 + 1000000 + 100 + + + + + + + + intensityHomogeneity + intensityHomogeneity + + + 0.6 + + 0.0 + 1.0 + 0.1 + + + + curvatureWeight + curvatureWeight + c + + + 0.5 + + 0.0 + 1.0 + 0.1 + + + + labelValue + labelValue + + + 1 + + 1 + 1000 + 1 + + + + maxRunningTime + maxRunningTime + + + 10 + + 0 + 60 + 1 + + + + + + + + originalImageFileName + + input + 0 + + + + labelImageFileName + + input + 1 + + + + segmentedImageFileName + + output + 2 + + + + diff --git a/tools/xmls/SimpleRegionGrowingSegmentation.xml b/tools/xmls/SimpleRegionGrowingSegmentation.xml new file mode 100644 index 0000000..6c5f207 --- /dev/null +++ b/tools/xmls/SimpleRegionGrowingSegmentation.xml @@ -0,0 +1,104 @@ + + + Segmentation + Simple Region Growing Segmentation + + 0.1.0.$Revision$(alpha) + http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/SimpleRegionGrowingSegmentation + + Jim Miller (GE) + + + + + + smoothingIterations + + --smoothingIterations + + 5 + + + timestep + + --timestep + + 0.0625 + + 0.001 + 1 + 0.0001 + + + + + + + + iterations + --iterations + + + 5 + + 0 + 100 + + + + multiplier + --multiplier + + + 2.5 + + 0 + 10 + 0.01 + + + + neighborhood + --neighborhood + + + 1 + + + labelvalue + --labelvalue + + + 2 + + 1 + 255 + + + + seed + + --seed + + 0,0,0 + + + + + + + inputVolume + + input + 0 + + + + outputVolume + + output + 1 + + + + diff --git a/tools/xmls/SubtractScalarVolumes.xml b/tools/xmls/SubtractScalarVolumes.xml new file mode 100644 index 0000000..4d83696 --- /dev/null +++ b/tools/xmls/SubtractScalarVolumes.xml @@ -0,0 +1,51 @@ + + + Filtering.Arithmetic + Subtract Scalar Volumes + + 0.1.0.$Revision$(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Subtract + + Bill Lorensen (GE) + + + + + + inputVolume1 + + input + 0 + + + + inputVolume2 + + input + 1 + + + + outputVolume + + output + 2 + + + + + + + + order + + 1 + 0 + 1 + 2 + 3 + order + + + + diff --git a/tools/xmls/TestGridTransformRegistration.xml b/tools/xmls/TestGridTransformRegistration.xml new file mode 100644 index 0000000..f3765bc --- /dev/null +++ b/tools/xmls/TestGridTransformRegistration.xml @@ -0,0 +1,56 @@ + + + Legacy.Registration + Test GridTransform registration + 9 + + 0.1.0.$Revision: 6760 $(alpha) + http://wiki.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/TestGridTransformRegistration + + Yinglin Lee (SPL, BWH) + + + + + + gridSize + g + gridSize + + + 5 + + 3 + 20 + 1 + + + + + + + + OutputTransform + outputtransform + + + output + + + + + FixedImageFileName + + input + 0 + + + + MovingImageFileName + + input + 1 + + + + diff --git a/tools/xmls/ThresholdScalarVolume.xml b/tools/xmls/ThresholdScalarVolume.xml new file mode 100644 index 0000000..00d55af --- /dev/null +++ b/tools/xmls/ThresholdScalarVolume.xml @@ -0,0 +1,82 @@ + + + Filtering + Threshold Scalar Volume + Threshold an image.

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 + + + +