Batch Processing: Transformation

mp-transformation.py can be run from the command line after setting parameters in mp-transformation-config.json. When you run the script, you only need to provide the path to the config file as an argument

$ python mp-transformation.py "C:\\path\\to\\mp-transformation-config.json"

In addition to the parameters described in Parameter Reference, mp-transformation-config.json requires a set of additional parameters:

rootdir

Required: String specifying the complete path to a directory where an output folder should be created

expname

Required: String specifying the experiment name that will be incorporated into output files

c1-dir

Required: String specifying the path to the directory containing the _Probabilities.files for the structural channel

c1-key

Required: String that will serve as a key for the structural channel and will name the output files

c2-dir

Optional: Same as c1-dir, but for an additional channel

c2-key

Optional: Same as c1-key, but for an additional channel

c3-dir

Optional: Same as c1-dir, but for an additional channel

c3-key

Optional: Same as c1-key, but for an additional channel

c4-dir

Optional: Same as c1-dir, but for an additional channel

c4-key

Optional: Same as c1-key, but for an additional channel

twoD

A boolean value that specifies, which PCA transformation functions will be used.

True: brain.calculate_pca_median_2d() and brain.pca_transform_2d() will be used to hold one axis constant, while the other two are realigned with PCA

False: brain.calculate_pca_median() and brain.pca_transform_3d() will be used to transform and realign samples in all three dimensions

API

deltascope.mpTransformation.check_nums(P)

Check that the numbers of files selected by the same list index match Raises an error if file numbers are mismatched

:param paramClass P: Object containing all variables from config file

class deltascope.mpTransformation.paramsClass(path)

A class to read and validate parameters for multiprocessing transformation. Validated parameters can be read as attributes of the object

add_outdir(path)

Add out directory as an attribute of the class

Parameters:path (str) – Complete path to the output directory
check_config(D, path)

Check that each parameter in the config file is correct and raise an error if it isn’t

Parameters:
  • D (dict) – Dictionary containing parameters from the config file
  • path (str) – Complete filepath to the config file
deltascope.mpTransformation.process(num, P=None)

Run through the processing steps for a single sample through saving psi files

Parameters:num (int) – Index of the file that is currently being processed

:param paramClass P: Object containing all variables from config file