/**
\page org_mitk_views_streamlinetracking Streamline Tractography

This view enables streamline tractography on various input data. The corresponding command line application is named "MitkStreamlineTractography".

Available sections:
- \ref StrTrackUserManualInputData
- \ref StrTrackUserManualSeeding
- \ref StrTrackUserManualConstraints
- \ref StrTrackUserManualParameters
- \ref StrTrackUserManualNeighbourhoodSampling
- \ref StrTrackUserManualDataHandling
- \ref StrTrackUserManualPostprocessing
- \ref StrTrackUserManualReferences

\section StrTrackUserManualInputData Input Data

Select the data you want to track on in the datamanager. Supported file types are:
- One or multiple DTI images selected in the datamanager.
- One ODF image, e.g. obtained using MITK Q-ball reconstruction or MRtrix CSD (tractography similar to [6]).
- One peak image (4D float image).
- One raw diffusion-weighted image for machine learning based tractography [1].
-- Tractography Forest: Needed for machine learning based tractography [1].

\section StrTrackUserManualSeeding Seeding

Specify how, where and how many tractography seed points are placed. This can be either done statically using a seed image or in an interactive fashion. Interactive tractography enables the dynamic placement of spherical seed regions simply by clicking into the image (similar to [5]).

Image based seeding:
- Seed Image: ROI image used to define the seed voxels. If no seed mask is specified, the whole image volume is seeded.
- Seeds per voxel: If set to 1, the seed is defined as the voxel center. If > 1 the seeds are distributet randomly inside the voxel.

Interactive seeding:
- Update on Parameter Change: When "Update on Parameter Change" is checked, each parameter change causes an instant retracking with the new parameters. This enables an intuitive exploration of the effects that the other tractography parameters have on the resulting tractogram.
- Radius: Radius of the manually placed spherical seed region.
- Num.Seeds: Number of seeds placed randomly inside the spherical seed region.

Parameters for both seeding modes:
- Trials Per Seed: Try each seed N times until a valid streamline is obtained (only for probabilistic tractography).
- Max. Num. Fibers: Tractography is stopped after the desired number of fibers is reached, even before all seed points are processed.

\section StrTrackUserManualConstraints ROI Constraints

Specify various ROI and mask images to constrain the tractography process.

- Mask Image: ROI image used to constrain the generated streamlines, typically a brain mask. Streamlines that leave the regions defined in this image will stop immediately.
- Stop ROI Image: ROI image used to define stopping regions. Streamlines that enter the regions defined in this image will stop immediately.
- Exclusion ROI Image: Fibers that enter a region defined in this image will be discarded.
- Endpoint Constraints: Determines which fibers are accepted based on their endpoint location. Options are:
  - No constraints on endpoint locations (command line option NONE)
  - Both EPs are required to be located in the target image (command line option EPS_IN_TARGET)
  - Both EPs are required to be located in the target image and the image values at the respective position needs to be distinct (command line option EPS_IN_TARGET_LABELDIFF)
  - One EP is required to be located in the seed image and one in the target image (command line option EPS_IN_SEED_AND_TARGET)
  - At least one EP is required to be located in the target image (command line option MIN_ONE_EP_IN_TARGET)
  - Exactly one EP is required to be located in the target image (command line option ONE_EP_IN_TARGET)
  - No EP is allowed to be located in the target image (command line option NO_EP_IN_TARGET)
- Target Image: ROI image needed for endpoint constraints.

\section StrTrackUserManualParameters Tractography Parameters

- Mode: Toggle between deterministic and probabilistic tractography. Peak tracking only supports deterministic mode. The probabilistic method simply samples the output direction from the discrete probability ditribution provided by the discretized ODF.
- Sharpen ODFs: If you are using dODF images as input, it is advisable to sharpen the ODFs (min-max normalize and raise to the power of 4). This is not necessary (and not recommended) for CSD fODFs, since they are naturally much sharper.
- Cutoff: If the streamline reaches a position with an FA value or peak magnitude lower than the speciefied threshold, tracking is terminated. Typical values are 0.2 for FA/GFA and 0.1 for CSD peaks.
- FA/GFA image used to determine streamline termination. If no image is specified, the FA/GFA image is automatically calculated from the input image. If multiple tensor images are used as input, it is recommended to provide such an image since the FA maps calculated from the individual input tensor images can not provide a suitable termination criterion.
- ODF Cutoff: Additional threshold on the ODF magnitude. This is useful in case of CSD fODF tractography. For fODFs a good default value is 0.1, for normalized dODFs, e.g. Q-ball ODFs, this threshold should be very low (0.00025) or 0.
- Step Size: The algorithm proceeds along the streamline with a fixed stepsize. Default is 0.5*minSpacing.
- Min. Tract Length: Shorter fibers are discarded.
- Angular threshold: Maximum angle between two successive steps (in degree). Default is 90° * step_size. For probabilistic tractography, candidate directions exceeding this threshold have probability 0, i.e. the respective ODF value is set to zero. The probabilities of the valid directions are normalized to sum to 1.
- Loop Check: Stop streamline if the threshold on the angular stdev over the last 4 voxel lengths is exceeded. -1 = no loop check.
- f and g values to balance between FACT [2] and TEND [3,4] tracking (only for tensor based tractography). For further information please refer to [2,3]

\section StrTrackUserManualTractographyPrior Tractography Prior
It is possible to use a peak image as prior for tractography on arbitrary other input images. The local progression direction is determined as the weighted average between the direction obtained from the prior and the input data.
- Weight: Weighting factor between prior and input data directions. A weight of zero means that no prior iformation is used. With a weight of one, tractography is performed directly on the prior directions itself.
- Restrict to Prior: The prior image is used as tractography mask. Voxels without prior peaks are excluded.
- New Directions from Prior: By default, the prior is used even if there is no valid direction found in the data. If unchecked, the prior cannot create directions where there are none in the data.

\section StrTrackUserManualDataHandling Data Handling
- Flip directions: Internally flips progression directions. This might be necessary depending on the input data.
- Interpolate Tractography Data: Trilinearly interpolate the input image used for tractography.
- Interpolate ROI Images: Trilinearly interpolate the ROI images used to constrain the tractography.

\section StrTrackUserManualNeighbourhoodSampling Neighbourhood Sampling (for details see [1])
- Neighborhood Samples: Number of neighborhood samples that are used to determine the next fiber progression direction.
- Sampling Distance: Distance of the sampling positions from the current streamline position (in voxels).
- Use Only Frontal Samples: Only neighborhood samples in front of the current streamline position are considered.
- Use Stop-Votes: If checked, the majority of sampling points has to place a stop-vote for the streamline to terminate. If not checked, all sampling positions have to vote for a streamline termination.

\section StrTrackUserManualPostprocessing Output and Postprocessing
- Compress Fibers: Whole brain tractograms obtained with a small step size can contain billions of points. The tractograms can be compressed by removing points that do not really contribute to the fiber shape, such as many points on a straight line. An error threshold (in mm) can be defined to specify which points should be removed and which not.
- Output Probability Map: No streamline are generated. Instead, the tractography outputs a visitation-count map that indicates the probability of a fiber to reach a voxel from the selected seed region. For this measure to be sensible, the number of seeds per voxel needs to be rather large.

\section StrTrackUserManualReferences References

[1] Neher, Peter F., Marc-Alexandre Côté, Jean-Christophe Houde, Maxime Descoteaux, and Klaus H. Maier-Hein. “Fiber Tractography Using Machine Learning.” NeuroImage. Accessed July 19, 2017. doi:10.1016/j.neuroimage.2017.07.028.\n
[2] Mori, Susumu, Walter E. Kaufmann, Godfrey D. Pearlson, Barbara J. Crain, Bram Stieltjes, Meiyappan Solaiyappan, and Peter C. M. Van Zijl. “In Vivo Visualization of Human Neural Pathways by Magnetic Resonance Imaging.” Annals of Neurology 47 (2000): 412–414.\n
[3] Weinstein, David, Gordon Kindlmann, and Eric Lundberg. “Tensorlines: Advection-Diffusion Based Propagation through Diffusion Tensor Fields.” In Proceedings of the Conference on Visualization’99: Celebrating Ten Years, 249–253, n.d.\n
[4] Lazar, Mariana, David M. Weinstein, Jay S. Tsuruda, Khader M. Hasan, Konstantinos Arfanakis, M. Elizabeth Meyerand, Benham Badie, et al. “White Matter Tractography Using Diffusion Tensor Deflection.” Human Brain Mapping 18, no. 4 (2003): 306–321.\n
[5] Chamberland, M., K. Whittingstall, D. Fortin, D. Mathieu, and M. Descoteaux. “Real-Time Multi-Peak Tractography for Instantaneous Connectivity Display.” Front Neuroinform 8 (2014): 59. doi:10.3389/fninf.2014.00059.\n
[6] Tournier, J-Donald, Fernando Calamante, and Alan Connelly. “MRtrix: Diffusion Tractography in Crossing Fiber Regions.” International Journal of Imaging Systems and Technology 22, no. 1 (March 2012): 53–66. doi:10.1002/ima.22005.

*/
