{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "required": [
        "config",
        "inputs"
    ],
    "type": "object",
    "properties": {
        "inputs": {
            "required": [
                "dtiInit_Archive"
            ],
            "type": "object",
            "properties": {
                "dtiInit_Archive": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "enum": [
                                "archive"
                            ]
                        }
                    }
                }
            }
        },
        "config": {
            "required": [
                "cleanIter",
                "imresample",
                "track_algorithm",
                "computeCSD",
                "fiberWeighting",
                "qmr_meatadata_age",
                "track_minLengthThreshMm",
                "qmr_metadata_sex",
                "savefigs",
                "track_faThresh",
                "maxDist",
                "track_whichAlgorithm",
                "clip2rois",
                "track_offsetJitter",
                "track_nfibers",
                "cutoffUpper",
                "cleanClippedFibers",
                "numberOfNodes",
                "cleanFibers",
                "qmr_runcontrolcomp",
                "track_faMaskThresh",
                "track_wPuncture",
                "maxLen",
                "computenorms",
                "track_angleThresh",
                "track_seedVoxelOffset_1",
                "normalization",
                "qmr_metadata_bvalue",
                "cutoffLower",
                "track_stepSizeMm",
                "track_whichInterp",
                "track_maxLengthThreshMm",
                "qmr_metadata_age_comp",
                "qmr_metadata_ndirs",
                "track_seedVoxelOffset_2"
            ],
            "type": "object",
            "properties": {
                "cleanIter": {
                    "default": 5,
                    "type": "integer",
                    "description": "Maximum number of iterations of the cleaning algorithm."
                },
                "imresample": {
                    "default": 0,
                    "type": "integer",
                    "description": "For aditional images that are passed into afq you can set a resolution to resample those images to before computing tract profiles (e.g., [2 2 2])"
                },
                "track_algorithm": {
                    "default": "mrdiffusion",
                    "type": "string",
                    "description": "Do fiber tracking with mrdiffusion by default. The other option is 'mrtrix' if it is installed and the data is HARDI."
                },
                "computeCSD": {
                    "default": 0,
                    "type": "integer",
                    "description": "Whether or not to compute constrained spherical deconvolution using mrtrix. 0 means don't use mrtrix. 1 means use mrtrix with the default lmax (4). Otherwise you can set the lmax by with a scaler."
                },
                "fiberWeighting": {
                    "default": 1,
                    "type": "integer",
                    "description": "Set the amount of weighting that will be applied when calculating tract profiles. 0 means that each fiber contributes equally. 1 means that we apply gaussian weighting where each fibers contribution to the measurement at a node is weighted by its gaussian distance from the tract core. Values greater than 1 mean that the core of the tract is weighted more heavily and fibers futher from the core are weighted less heavily (faster fall off than a gaussian). See AFQ_ComputeTractProperties."
                },
                "qmr_meatadata_age": {
                    "default": 0,
                    "type": "integer",
                    "description": "Age of subject in years."
                },
                "track_minLengthThreshMm": {
                    "default": 50,
                    "type": "integer",
                    "description": "Discard Fibers shorter than this threshold in mm."
                },
                "track_angleThresh": {
                    "default": 30,
                    "type": "integer",
                    "description": "Stopping criteria angle between steps >30 degrees."
                },
                "qmr_metadata_sex": {
                    "default": "unknown",
                    "type": "string",
                    "description": "Sex of subject. ('male', 'female', 'unknown')"
                },
                "qmr_runcontrolcomp": {
                    "default": 1,
                    "type": "integer",
                    "description": "Compare subject to control dataset. For a description of the control dataset, see 'Lifespan maturation and degeneration of human brain white matter' J.D. Yeatman, B.A. Wandell and A. Mezer (2014) NATURE COMMUNICATIONS | 5:4932 | DOI: 10.1038/ncomms5932."
                },
                "track_faThresh": {
                    "default": 0.2,
                    "type": "number",
                    "description": "Stopping criteria FA<0.2"
                },
                "maxDist": {
                    "default": 5,
                    "type": "integer",
                    "description": "Remove fibers that are more than 'maxDist' standard deviations from the core of the tract. (Default = 5 standard deviations). cleanFibers must be set to 1."
                },
                "clip2rois": {
                    "default": 1,
                    "type": "integer",
                    "description": "Should we analyze the whole length of the fiber group or just the central portion spanning between 2 ROIs. (1=YES, 0=NO)"
                },
                "track_offsetJitter": {
                    "default": 0,
                    "type": "number",
                    "description": "Offset Jitter is the standard deviation of a a random jitter applied to the seeds (in voxel units). E.g., offsetJitter=0.1 will jitter each seedVoxelOffset by a random amount with mean 0 and sigma 0.1. This adds some randomness to each seed point. Each seed point is move randomly by randn*.1mm"
                },
                "track_nfibers": {
                    "default": 500000,
                    "type": "integer",
                    "description": "Number of fibers to track. This parameter is only relevant for mrTrix."
                },
                "savefigs": {
                    "default": 0,
                    "type": "integer",
                    "description": "Save figures of fiber groups. (1=yes, 0=no)"
                },
                "cleanClippedFibers": {
                    "default": 0,
                    "type": "integer",
                    "description": "If cleanFibers == 1, then this will indicate whether to perform the cleaning on just the clipped portion of the tract or on the full tract. This may be helpful for tracts like the ILF that are extremely messy with looping fibers etc."
                },
                "numberOfNodes": {
                    "default": 100,
                    "type": "integer",
                    "description": "The number of nodes to represent each fiber."
                },
                "qmr_metadata_bvalue": {
                    "default": 1000,
                    "type": "integer",
                    "description": "B-Value for control data (1000, 2000)."
                },
                "cutoffUpper": {
                    "default": 90,
                    "type": "integer",
                    "description": "The upper percentile cutoff to be used to determine what is 'abnormal' The default is cutoff = [10 90] meaning that subjects who fall below the 10th percentile or above the 90th percentile will be considered 'abnormal' and their data will be plotted with respect to the control population."
                },
                "track_faMaskThresh": {
                    "default": 0.3,
                    "type": "number",
                    "description": "FA mask threshold from which to initialize tracking."
                },
                "track_wPuncture": {
                    "default": 0.2,
                    "type": "number",
                    "description": "This coefficient can take on values from 0 to 1, and affects how much the propagation should be encouraged to “puncture” through planar tensors oriented normal to its path, versus turning into the plane."
                },
                "maxLen": {
                    "default": 4,
                    "type": "integer",
                    "description": "Remove fibers that are more than 'maxLen' standard deviations from the mean fiber length. (Default = 4 standard deviations). cleanFibers must be set to 1."
                },
                "computenorms": {
                    "default": 1,
                    "type": "integer",
                    "description": "Whether or not to comput control group norms."
                },
                "track_whichAlgorithm": {
                    "default": 1,
                    "type": "integer",
                    "description": "Algorithm type for tractography (0=STT Euler, 1=STT RK4, 2=TEND Euler, 3=TEND RK4). Default is STT. See: Basser PJ, Pajevic S, Pierpaoli C, Duda J, Aldroubi A. 2000. In vivo fiber tractography using DT-MRI data. Magnetic Resonance in Medicine 44(4):625-32."
                },
                "track_seedVoxelOffset_1": {
                    "default": 0.25,
                    "type": "number",
                    "description": "seedVoxelOffsets is the relative position of the seed(s) within each seed voxel. E.g., seedVoxelOffsets = [0.5] will put one seed at the center of each voxel, while [0.25 0.75] will place 8 seeds in each voxel. Note that every seed voxel gets at least one seed."
                },
                "track_maxLengthThreshMm": {
                    "default": 250,
                    "type": "integer",
                    "description": "Discard Fibers longer than this threshold in mm."
                },
                "normalization": {
                    "default": "spm",
                    "type": "string",
                    "description": "Which software package to use for normalization. ('spm', 'ants')"
                },
                "cutoffLower": {
                    "default": 10,
                    "type": "integer",
                    "description": "The lower percentile cutoff to be used to determine what is 'abnormal' The default is cutoff = [10 90] meaning that subjects who fall below the 10th percentile or above the 90th percentile will be considered 'abnormal' and their data will be plotted with respect to the control population."
                },
                "track_stepSizeMm": {
                    "default": 1,
                    "type": "integer",
                    "description": "Distance between steps in the tractography algoithm."
                },
                "track_whichInterp": {
                    "default": 1,
                    "type": "integer",
                    "description": "Interpolation Type (0=NN, 1=linear): After each step we interpolate the tensor at that point. Trilinear interpolation works well."
                },
                "cleanFibers": {
                    "default": 1,
                    "type": "integer",
                    "description": "cleanFibers == 1 (default) means that once all the fiber groups have been segmented they will be cleaned such that any fiber that (1) is more than params.maxLen standard deviations above the mean fiber length will be removed and (2) any fiber that is more than params.maxDist standard deviations from the core of the tract will be removed. this means that fibers groups will be forced to be a compact bundle. (1 = YES, 0 = NO)"
                },
                "qmr_metadata_age_comp": {
                    "default": 0,
                    "type": "integer",
                    "description": "Restrict comparison to 'age matched' based on the age of the subject."
                },
                "qmr_metadata_ndirs": {
                    "default": 30,
                    "type": "integer",
                    "description": "Number of directions for control data (30, 96)."
                },
                "track_seedVoxelOffset_2": {
                    "default": 0.75,
                    "type": "number",
                    "description": "seedVoxelOffsets is the relative position of the seed(s) within each seed voxel. E.g., seedVoxelOffsets = [0.5] will put one seed at the center of each voxel, while [0.25 0.75] will place 8 seeds in each voxel. Note that every seed voxel gets at least one seed."
                }
            }
        }
    },
    "title": "Invocation manifest for AFQ: Automated Fiber Quantification"
}