RegMaxSPars.py 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Ajayrama Kumaraswamy, 2017, LMU Munich
  2. """
  3. The input parameters of different Algorithms
  4. """
  5. # **********************************************************************************************************************
  6. """
  7. Parameters of Reg-MaxS.
  8. refSWC: string. The reference SWC file, to which testFile is registered.
  9. Must be a valid SWC file on the file system.
  10. testSWC: string. The test SWC file which is registered to refSWC.
  11. Must be a valid SWC file on the file system.
  12. resFile: string. This file will be created and the resulting SWC will be written into it.
  13. It needs to be valid file reference.
  14. gridSizes: list of floats. These are the voxel sizes over which Reg-MaxS is run.
  15. Values must be in micrometers.
  16. transBounds: three member list, each element is a two member list. These members must be floats.
  17. They are bounds used for estimating translation parameters along XYZ axes.
  18. Values must be in micrometers.
  19. transMinRes: float. After searching at the three voxel sizes in gridSizes, a further search is carried
  20. out at this resolution for translation parameters. Values must be in micrometers.
  21. rotBounds: three member list, each element is a two member list. These members must be floats.
  22. They are bounds used for estimating rotation parameters about XYZ axes.
  23. Values must be in radians.
  24. rotMinRes: float. After refining rotation parameters at the three voxel sizes in gridSizes, a further
  25. refinement is carried out at this resolution. Values must be in radians.
  26. scaleBounds: three member list, each element is a two member list. These members must be floats.
  27. They are bounds used for estimating scaling parameters along XYZ axes.
  28. minScaleStepSize: float. After refining scaling parameters at the three voxel sizes in gridSizes, a further
  29. refinement is carried out at this resolution.
  30. nCPU: int. Reg-MaxS internally uses multiple processes for exhaustive searches.
  31. This specifies the number of processes to use. It can be a maximum of number of
  32. processors on the machine being used. Larger this number, faster the execution.
  33. inPartsDir: string. A file system directory, the swc files in which are transformed exactly the same as
  34. testSWC and written into outPartsDir.
  35. outPartsDir: string. A file system directory into which the transformed swc files of inPartsDir are written.
  36. It will be created if it does not exist.
  37. retainTempFiles: boolean. Reg-MaxS generates some temporary files in the directory where resFile is supposed to
  38. be created. If retainTempFiles is True, these are not deleted. Else, they are.
  39. """
  40. RegMaxSParNames = ['refSWC', 'testSWC', 'resFile',
  41. 'gridSizes',
  42. 'transBounds', 'transMinRes',
  43. 'rotBounds', 'rotMinRes',
  44. 'scaleBounds', 'minScaleStepSize',
  45. 'nCPU', 'inPartsDir', 'outPartsDir', 'retainTempFiles']
  46. # **********************************************************************************************************************
  47. """
  48. Parameters of Reg-MaxS-N. Some parameters are same as of Reg-MaxS above and hence are omitted here.
  49. swcList: list of strings. Each member must refer to a valid SWC file on the file system.
  50. initRefSWC: string. The initial reference to use for Reg-MaxS-N, i.e., the reference of the first iteration.
  51. Must be a valid SWC file on the file system.
  52. resDir: string. The directory into which the results of Reg-MaxS-N are written. Will be created anew
  53. or replaced if it exists.
  54. finallyNormalizeWRT: string. Must be one of the SWCs of swcList. The whole set of SWCs after registration
  55. is transformed affinely together so that this SWC is restored to it's final form.
  56. maxIter: int. The number of iterations for which Reg-MaxS-N runs before stopping and returning the
  57. result.
  58. usePartsDir: boolean. If True, Reg-MaxS-N check if for every SWC in swcList, a folder exists with the
  59. same name and path without the '.swc' extention. If such folders exist, the SWCs in them are
  60. transformed exactly the same as their corresponding SWCs and written into folders with the same
  61. name in resDir.
  62. """
  63. RegMaxSNParNames = [
  64. 'swcList', 'initRefSWC', 'resDir', 'finallyNormalizeWRT', 'maxIter',
  65. 'gridSizes',
  66. 'transBounds', 'transMinRes',
  67. 'rotBounds', 'rotMinRes',
  68. 'scaleBounds', 'minScaleStepSize',
  69. 'nCPU', 'usePartsDir'
  70. ]
  71. # **********************************************************************************************************************
  72. """
  73. Parameters of the registration PCA-based algorithm. Some parameters have the same meaning as in Reg-MaxS above and
  74. hence have been omitted here.
  75. gridSizes: list of floats. These are the voxel sizes over which Reg-MaxS is run.
  76. Values must be in micrometers. These values are not used in the actual algorithm. The last
  77. element of this list is used to calculate a measure of dissimilarity between the reference SWC
  78. and the result SWC produced by the 'pcaBased' algorithm.
  79. usePartsDir: boolean. If True, Reg-MaxS-N check if for every SWC in swcList, a folder exists with the
  80. same name and path without the '.swc' extention. If such folders exist, the SWCs in them are
  81. transformed exactly the same as their corresponding SWCs and written into folders with the same
  82. name in resDir.
  83. """
  84. pcaBasedParNames = [
  85. 'refSWC', 'testSWC', 'resFile',
  86. 'gridSizes', 'usePartsDir'
  87. ]
  88. # **********************************************************************************************************************
  89. DensitySaveParNames = ['refSWC', 'resFile']