parameters: (
          self,
          atlasDir,
          outDir,
          inputImageFileNames,
          inputSegFileName,
          meshStiffness=0.05,
          optimizerType='L-BFGS',
          bbregisterMode=None,
          resolution=0.5,
          useTwoComponents=False,
          tempDir=None,
          fileSuffix='',
          debug=False,
          )
docstring: MeshModel is a generic base class to facilitate GEMS mesh deformation for given ROIs.
          To implement a mesh model for a particular set of structures, this class must be subclassed
          and the following functions MUST be implemented:
  
          self.preprocess_images()         : Precompute the mask, segmentation, and image volumes
          self.get_cheating_label_groups() : Return the reduced labels group used to fit the mesh to the initial segmentation
          self.get_cheating_gaussians()    : Return the Gaussian means and variances used to fit the mesh to the initial segmentation
          self.get_label_groups()          : Return the reduced labels group used to fit the mesh to the image
          self.get_gaussian_hyps()         : Return the hyperparameters used to estimate the Gaussian parameters during image-fitting
          self.postprocess_segmentation()  : Update and write the label volumes and discrete segmentation(s)
  
          Further information is documented in each function definition.
  
          This is a framework that was meant to facilitate an (almost prefect) port of the subfield matlab code.
docstring_summary: MeshModel is a generic base class to facilitate GEMS mesh deformation for given ROIs.
          To implement a mesh model for a particular set of structures, this class must be subclassed
          and the following functions MUST be implemented:
docstring_tokens: MeshModel is a generic base class to facilitate GEMS mesh deformation for given ROIs . To implement a mesh model for a particular set of structures this class must be subclassed and the following functions MUST be implemented :
function: def __init__(
          self,
          atlasDir,
          outDir,
          inputImageFileNames,
          inputSegFileName,
          meshStiffness=0.05,
          optimizerType='L-BFGS',
          bbregisterMode=None,
          resolution=0.5,
          useTwoComponents=False,
          tempDir=None,
          fileSuffix='',
          debug=False,
          ):
          """
          MeshModel is a generic base class to facilitate GEMS mesh deformation for given ROIs.
          To implement a mesh model for a particular set of structures, this class must be subclassed
          and the following functions MUST be implemented:
  
          self.preprocess_images()         : Precompute the mask, segmentation, and image volumes
          self.get_cheating_label_groups() : Return the reduced labels group used to fit the mesh to the initial segmentation
          self.get_cheating_gaussians()    : Return the Gaussian means and variances used to fit the mesh to the initial segmentation
          self.get_label_groups()          : Return the reduced labels group used to fit the mesh to the image
          self.get_gaussian_hyps()         : Return the hyperparameters used to estimate the Gaussian parameters during image-fitting
          self.postprocess_segmentation()  : Update and write the label volumes and discrete segmentation(s)
  
          Further information is documented in each function definition.
  
          This is a framework that was meant to facilitate an (almost prefect) port of the subfield matlab code.
          """
  
          # Set some paths
          self.outDir = outDir
          self.atlasDir = atlasDir
          self.atlasMeshFileName = os.path.join(atlasDir, 'AtlasMesh.gz')
          self.atlasDumpFileName = os.path.join(atlasDir, 'AtlasDump.mgz')
          self.compressionLookupTableFileName = os.path.join(atlasDir, 'compressionLookupTable.txt')
          self.inputImageFileNames = inputImageFileNames
          self.inputSegFileName = inputSegFileName
  
          # Some settings
          self.meshStiffness = meshStiffness
          self.optimizerType = optimizerType
          self.bbregisterMode = bbregisterMode
          self.resolution = resolution
          self.useTwoComponents = useTwoComponents
          self.tempDir = tempDir
          self.fileSuffix = fileSuffix
          self.debug = debug
  
          # Some optimization defaults that should be overwritten by each subclass
          self.cheatingMeshSmoothingSigmas = [3.0, 2.0]
          self.cheatingMaxIterations = [300, 150]
  
          self.meshSmoothingSigmas = [1.5, 0.75, 0]
          self.imageSmoothingSigmas = [0, 0, 0]
          self.maxIterations = [7, 5, 3]
  
          self.longMeshSmoothingSigmas = [[1.5, 0.75], [0.75, 0]]
          self.longImageSmoothingSigmas = [[0, 0], [0, 0]]
          self.longMaxIterations = [[6, 3], [2, 1]]
  
          # Here are some options that control how to much to dilate masks throughout different
          # stages. Might be necessary to tune depending on the geometry of the ROI (like brainstem).
          self.atlasTargetSmoothing = 'forward'
          self.cheatingAlphaMaskStrel = 3
          self.alphaMaskStrel = 5
function_tokens: def __init__ ( self , atlasDir , outDir , inputImageFileNames , inputSegFileName , meshStiffness = 0.05 , optimizerType = 'L-BFGS' , bbregisterMode = None , resolution = 0.5 , useTwoComponents = False , tempDir = None , fileSuffix = '' , debug = False , ) : # Set some paths self . outDir = outDir self . atlasDir = atlasDir self . atlasMeshFileName = os . path . join ( atlasDir , 'AtlasMesh.gz' ) self . atlasDumpFileName = os . path . join ( atlasDir , 'AtlasDump.mgz' ) self . compressionLookupTableFileName = os . path . join ( atlasDir , 'compressionLookupTable.txt' ) self . inputImageFileNames = inputImageFileNames self . inputSegFileName = inputSegFileName # Some settings self . meshStiffness = meshStiffness self . optimizerType = optimizerType self . bbregisterMode = bbregisterMode self . resolution = resolution self . useTwoComponents = useTwoComponents self . tempDir = tempDir self . fileSuffix = fileSuffix self . debug = debug # Some optimization defaults that should be overwritten by each subclass self . cheatingMeshSmoothingSigmas = [ 3.0 , 2.0 ] self . cheatingMaxIterations = [ 300 , 150 ] self . meshSmoothingSigmas = [ 1.5 , 0.75 , 0 ] self . imageSmoothingSigmas = [ 0 , 0 , 0 ] self . maxIterations = [ 7 , 5 , 3 ] self . longMeshSmoothingSigmas = [ [ 1.5 , 0.75 ] , [ 0.75 , 0 ] ] self . longImageSmoothingSigmas = [ [ 0 , 0 ] , [ 0 , 0 ] ] self . longMaxIterations = [ [ 6 , 3 ] , [ 2 , 1 ] ] # Here are some options that control how to much to dilate masks throughout different # stages. Might be necessary to tune depending on the geometry of the ROI (like brainstem). self . atlasTargetSmoothing = 'forward' self . cheatingAlphaMaskStrel = 3 self . alphaMaskStrel = 5