Updates to registration_chain stats calculations:
1. Removed stats calculation of first time point going to all others.
2. We now calculate stats from average to each other time point instead of to average.
3. Related changes include:
	a. statsAndResample now can calculate regular or chain stats, depending on circumstance.
        b. renamed relevant function to avgToNonAdjacentTimePoint to reflect 2 above.

Also fixed minor bug in calcStats and removed unused import in NLIN.py
Merge branch 'master' of github.com:mfriedel/pydpiper into develop-lsq6
* added functional classes to perform non-uniformity correction and intensity normalization
* made the LSQ6 function getLSQ6Module more standalone: in the previous version there were some references to self.* variables, which would not be around if called from another module
* added the "sinc" option to mincresample calls for anatomical files
* added some additional information for the newGroup function
Merge branch 'develop-lsq6' into mbm-redesign
* merged the changes in the develop-lsq6 branch, and adjusted the call to the lsq6 module accordingly
* added NUC and INORM to the pipeline (note: still missing is an additional resampling step of the nuc-inorm file from native to lsq12 before starting the non linear stage)
Merge branch 'mbm-redesign' of github.com:mfriedel/pydpiper into mbm-redesign
* fixed a bug: after running the intensity normalization, the last base volume was not set appropriately. Fixed here
Merge branch 'develop-lsq6' into mbm-redesign
* another fix: adding the last base volume should not be done in the runNormalization function, but after the potential resample step. So at the very end in setINORMasLastBaseVolume
Merge branch 'develop-lsq6' into mbm-redesign
* trying to incorporate an automatic mask resampling strategy. The idea is that when you resample a file that is associated with a file handler, you want to resample the mask as well. So instead of calling the mincresample minc atom, you can now call the mincresampleFileAndMask minc atom. This module will do the same as mincresample, but will also check the presence of a mask associated with the file handler. If that mask exists, the mask will be resampled using the same transform as the main file. One thing to keep in mind is that (at the moment) none of these files are set as last base volume by default. You still need to take care of this yourself. For improved user friendliness (and fewer chances of mistakes/omissions) we should look into a way to set all this automatically.

* change in the main mincresample minc atom: the argArray argument can be used to add options to mincresample that would be difficult to handle in any other way. It simply holds a list of arguments to be used for the final command. Up till now, the actual comnmand line command (mincresample) was added to this argArray if it was provided to the atom. However, this altered the input argument. In the new function mincresampleFileAndMask, this argArray is possibly used twice (to resample the main file and potentially the mask), and the argArray might have to be used twice. Having this array change within the mincresample atom caused some issues. Now this parameter is left unaltered by the mincresample minc atom.
Moved duplicate code for directory setup and pipeline naming to a function.
Cleaned up misc unused import statements.
Added maskDir in LSQ6 initializeInputFiles call.
Misc. small changes and bug fixes:
* Moved input file checking from LSQ6 to initializeInputFiles, so now it is called everywhere.
* Added error checking in NLIN.py run() so that a user-friendly error is now thrown if a target is not specified.
* Changed the default --calc-stats value from True to False, since previously it was always being calculated.
Updated NLIN.py so that an average is created from the input files if one is not already specified.
Created function (initNLINModule) to create and return the appropriate non-linear module based on a minctracc or mincANTS command line registration option.
* the file handler now keeps track of the last resampled file and resampled mask. The idea is that setLastBasevol can now be set without any arguments. It can simply use the last resampled file and potentially the last resampled mask.
Alrighty then....... this is one of those commits that is 3 christmas trees longer than it should be. Started out with fixing a filehandler issue, before realizing that one of the main issues to solve is that for mouse brains the parameters for the LSQ6 and LSQ12 stage should not be based on the file resolution, but on the the size of the subject matter (i.e., brain size). These should thus be all the same for any kind of mouse brain data. Changes in this commit include but are not necessarily limited to:
* option to set default parameters for mouse brains in LSQ6 (regardless of file resolution)
* option to set default parameters for mouse brains in LSQ12 (regardless of file resolution)
* a last resampled volume is recorded within a file handler, any call to mincresample or mincresampleMask is stored in a temporary variable
* setLastBasevol run without any parameters will set the last volume to the last resampled volume
* in order to set the last base volume to the original file, you now have to specify: setToOriginalInput=True
* fixed setting the target for the LSQ12 stage in MBM when using an initial model (should be the standard space file)
* left a comment somewhere saying: "# TODO: finish the following if clause... hahaha", which indeed needs to be fixed
Several small fixes to log files:
1. In lsq6, setLogFile added for nu_estimate, nu_evaluate, and inormalize. Previously, files were placed in main pipeline directory.
2. Fixed error in stats_tools for creation of logFile in final_linear xfmConcat. logFile was set as an instance of LogFile rather than a string.

Other small fixes:
1. Removed a comment in rotational_mictracc atom: getBlur already checks for specified fwhm, throws an error if it doesn't exist!
2. Removed unused self.output from xfmConcat.
Misc changes and code clean-up:
1. Renamed --target option in LSQ6 module to --lsq6-target for clarity.
2. Added --lsq12-likefile option for resampling and updated both MBM and LSQ12 files accordingly.
3. Added a new nlin group to input file handlers prior to starting NLIN registration. This is consistent with additions of previous groups and makes output xfm names clearer.