Merge branch 'master' into mbm-redesign
Merge branch 'master' into mbm-redesign
First pass at NLIN module and related changes.
This code is still being tested.
1. NonlinearRegistration application that can be run on the command line + standard MBM 3 generation ANTS registration
2. Misc changes:
2a. moved addMBMGroup to MBM.py
2b. added comments and additional directory creation in MBM.py, fixed file handler initialization to include mask dir
2c. added mincAverage atom
2d. Added pipeline_dir to general registration option group.
Second NLIN check-in. Class still being tested.
Main changes:
1. Addition of minctracc module with defaults that match current MBM defaults.
2. Masks are now properly set when each nlinFH is instantiated.
3. Multiple changes to mincatoms, including:
3a. mincANTS now correctly uses target_mask instead of source_mask
3b. default minctracc similarity parameter is now 0.8 (matches command line default)
3c. -use_simplex, -debug and -max_def_magnitude added to default nlin minctracc command.
3d. -identity is now default for nlin registration if there is no previous transform (previously this was only true for lsq12)
3e. Fixed errors with mincAverage
4. Cleaned up a couple of redundant lines in RegistrationFHBase

This check-in also includes some temporary changes, which will be removed after testing is complete:
1. Hardcoded ANTS blur of 0.056
2. Harded coded blurs and steps for minctracc
3. -sinc is used for resample--we may or may not want to keep this.
4. -tol and -xcorr added to nlin minctracc atom, even though they only make sense for linear reg. I did this to be consistent with current build model for testing. Will remove when complete.
Removed harded coded params used for testing.
1. Removed hard-coded blurs and steps in minctracc module.
2. Removed hard-coded self.ANTSBlur in mincANTS module.
3. Removed -tol and -xcorr for nlin calls of minctracc atom.
Updates to stats calculations:
***This code still needs testing. ***
1. CalcStats now has option argument of an array of file handlers, which are used to set up average_inv_pure_displacement calculation.
2. Calculation of average and subsequent recentering of displacement now included.
3. linAndNlinDisplacement function written for base class.
4. Updated calcFullDisplacement in both CalcStats and CalcChain stats to reflect updates to mincDisplacement atom.
5. Updated mincDisplacement atom for clarity. Now requires source/starting space, transform, and file handler for location of output.
6. Addition of various functions to avoid duplicate code and assist in items 1 and 2 above.

Minor related changes:
1. We can now do a stats calculation from the NLIN module.
2. Creation of a new mincAverageDisp atom, for averaging displacements, which inherits from mincAverage.
3. Added calc_stats (default=TRUE) option in addGenRegOptionGroup

First check-in of several as I continue to test. Addresses Issue #55.
Misc bug fixes from last check-in.
Updated registration chain to use nlinDisp (full stats calc) with linear part removed.
Ability to update ANTS parameters for non-linear registration via an input csv. First pass at Issue #59.
Must use a semi-colon delimited csv as input with parameters specified as individual rows.
Additional small change: Added sinc resampling in to registration chain.
Example non-linear protocol that I forgot to include in the last commit. Issue #59.
* moved the nonlinear registration options to their own funtion (addNlinRegOptionGroup)
* made the NonlinearRegistration class use the new options function
* added documentation to LSQ12 class
* LSQ12: moved all options to the init function (and away from buildPipeline)
removed debug print statement in xfmconcat function
* added the possibility not to execute the command. This would allow you to create the graph, but not actually run anything. Right now quite a number of files and directories are created that are not necessary, this should probably be fixed in the future
* gave the main set of parameters its own group/name
Added ability to update minctracc parameters for non-linear registration. Issue #59.
Format/parsing similar to previous check in 15941835d92357d for mincANTS.

Minor changes:
1. Removed unused imports from NLIN.py
2. Added optimization parameter for minctracc atom (-use_simplex as default)
3. Added -tol 0.0001 as default for all minctracc calls.
Merge branch 'master' into mbm-redesign

Resolved merge conflicts in:
	pydpiper_apps/minc_tools/minc_atoms.py
	setup.py

Changes from Matthijs: LSQ6 Module, working rotational minctracc, other misc bug fixes and improvements.
Merge branch 'mbm-redesign'
* set the creation of a graph off by default
* Major redesign in terms of the LSQ6 class. Now there is a base class in order to avoid to many duplications of code. Also, many of the LSQ6 classes deal with similar things, e.g., checking the initial model, resampling the input files and creating an average. The main part where they differ is in how they establish the transformation between the target and the source.
* added the option to use the -identity flag for minctracc when running an lsq6 registration