class_docstr: CAT12: Segmentation
  
  This toolbox is an extension to the default segmentation in SPM12, but uses a completely different segmentation
  approach.
  The segmentation approach is based on an Adaptive Maximum A Posterior (MAP) technique without the need for a priori
  information about tissue probabilities. That is, the Tissue Probability Maps (TPM) are not used constantly in the
  sense of the classical Unified Segmentation approach (Ashburner et. al. 2005), but just for spatial normalization.
  The following AMAP estimation is adaptive in the sense that local variations of the parameters (i.e., means and
  variance) are modeled as slowly varying spatial functions (Rajapakse et al. 1997). This not only accounts for
  intensity inhomogeneities but also for other local variations of intensity.
  Additionally, the segmentation approach uses a Partial Volume Estimation (PVE) with a simplified mixed model of at
  most two tissue types (Tohka et al. 2004). We start with an initial segmentation into three pure classes: gray
  matter (GM), white matter (WM), and cerebrospinal fluid (CSF) based on the above described AMAP estimation. The
  initial segmentation is followed by a PVE of two additional mixed classes: GM-WM and GM-CSF. This results in an
  estimation of the amount (or fraction) of each pure tissue type present in every voxel (as single voxels - given by
  Another important extension to the SPM12 segmentation is the integration of the Dartel or Geodesic Shooting
  registration into the toolbox by an already existing Dartel/Shooting template in MNI space. This template was
  derived from 555 healthy control subjects of the IXI-database (http://www.brain-development.org) and provides the
  several Dartel or Shooting iterations. Thus, for the majority of studies the creation of sample-specific templates
  is not necessary anymore and is mainly recommended for children data.'};
  
  http://www.neuro.uni-jena.de/cat12/CAT12-Manual.pdf#page=15
  
  Examples
  --------
  >>> path_mr = 'structural.nii'
  >>> cat = CAT12Segment(in_files=path_mr)
  >>> cat.run() # doctest: +SKIP
class_docstr_tok: ["CAT12",":","Segmentation","This","toolbox","is","an","extension","to","the","default","segmentation","in","SPM12",",","but","uses","a","completely","different","segmentation","approach",".","The","segmentation","approach","is","based","on","an","Adaptive","Maximum","A","Posterior","(","MAP",")","technique","without","the","need","for","a","priori","information","about","tissue","probabilities",".","That","is",",","the","Tissue","Probability","Maps","(","TPM",")","are","not","used","constantly","in","the","sense","of","the","classical","Unified","Segmentation","approach","(","Ashburner","et",".","al",".","2005",")",",","but","just","for","spatial","normalization",".","The","following","AMAP","estimation","is","adaptive","in","the","sense","that","local","variations","of","the","parameters","(","i.e.",",","means","and","variance",")","are","modeled","as","slowly","varying","spatial","functions","(","Rajapakse","et","al",".","1997",")",".","This","not","only","accounts","for","intensity","inhomogeneities","but","also","for","other","local","variations","of","intensity",".","Additionally",",","the","segmentation","approach","uses","a","Partial","Volume","Estimation","(","PVE",")","with","a","simplified","mixed","model","of","at","most","two","tissue","types","(","Tohka","et","al",".","2004",")",".","We","start","with","an","initial","segmentation","into","three","pure","classes",":","gray","matter","(","GM",")",",","white","matter","(","WM",")",",","and","cerebrospinal","fluid","(","CSF",")","based","on","the","above","described","AMAP","estimation",".","The","initial","segmentation","is","followed","by","a","PVE","of","two","additional","mixed","classes",":","GM-WM","and","GM-CSF",".","This","results","in","an","estimation","of","the","amount","(","or","fraction",")","of","each","pure","tissue","type","present","in","every","voxel","(","as","single","voxels","-","given","by","Another","important","extension","to","the","SPM12","segmentation","is","the","integration","of","the","Dartel","or","Geodesic","Shooting","registration","into","the","toolbox","by","an","already","existing","Dartel\/Shooting","template","in","MNI","space",".","This","template","was","derived","from","555","healthy","control","subjects","of","the","IXI-database","(","http",":","\/\/www.brain-development.org",")","and","provides","the","several","Dartel","or","Shooting","iterations",".","Thus",",","for","the","majority","of","studies","the","creation","of","sample-specific","templates","is","not","necessary","anymore","and","is","mainly","recommended","for","children","data",".","'","}",";","http",":","\/\/www.neuro.uni-jena.de\/cat12\/CAT12-Manual.pdf","#","page=15","Examples","--","--","--","--",">",">",">","path_mr","=","'structural.nii'",">",">",">","cat","=","CAT12Segment","(","in_files=path_mr",")",">",">",">","cat.run","(",")","#","doctest",":","+SKIP"]
code: def __init__(self, **inputs):
      _local_version = SPMCommand().version
      if _local_version and "12." in _local_version:
          self._jobtype = "tools"
          self._jobname = "cat.estwrite"
  
      SPMCommand.__init__(self, **inputs)
  
imports: import os
  from pathlib import Path
  from nipype.interfaces.base import InputMultiPath, TraitedSpec, traits, isdefined, File, Str
  from nipype.interfaces.cat12.base import Cell
  from nipype.interfaces.spm import SPMCommand
  from nipype.interfaces.spm.base import SPMCommandInputSpec, ImageFileSPM, scans_for_fnames, scans_for_fname
  from nipype.utils.filemanip import split_filename, fname_presuffix
label_desc: Use image node_id 1 to create a new CAT12Segment object from inherited base classes: SPMCommand with example: obj = CAT12Segment()