class_docstr: Freesurfer subject directory and version information.
  
  Examples
  --------
  
  >>> from nipype.interfaces.freesurfer import Info
  >>> Info.version()  # doctest: +SKIP
  >>> Info.subjectsdir()  # doctest: +SKIP
class_docstr_tok: ["Freesurfer","subject","directory","and","version","information",".","Examples","--","--","--","--",">",">",">","from","nipype.interfaces.freesurfer","import","Info",">",">",">","Info.version","(",")","#","doctest",":","+SKIP",">",">",">","Info.subjectsdir","(",")","#","doctest",":","+SKIP"]
docstr: Return a comparable version object
  
  If no version found, use LooseVersion('0.0.0')
docstr_tok: ["Return","a","comparable","version","object","If","no","version","found",",","use","LooseVersion","(","'","0.0.0","'",")"]
code: def looseversion(cls):
      """Return a comparable version object
  
      If no version found, use LooseVersion('0.0.0')
      """
      ver = cls.version()
      if ver is None:
          return LooseVersion("0.0.0")
  
      vinfo = ver.rstrip().split("-")
      try:
          int(vinfo[-1], 16)
      except ValueError:
          githash = ""
      else:
          githash = "." + vinfo[-1]
  
      # As of FreeSurfer v6.0.0, the final component is a githash
      if githash:
          if vinfo[3] == "dev":
              # This will need updating when v6.0.1 comes out
              vstr = "6.0.0-dev" + githash
          elif vinfo[5][0] == "v":
              vstr = vinfo[5][1:]
          elif len([1 for val in vinfo[3] if val == "."]) == 2:
              "version string: freesurfer-linux-centos7_x86_64-7.1.0-20200511-813297b"
              vstr = vinfo[3]
          else:
              raise RuntimeError("Unknown version string: " + ver)
      # Retain pre-6.0.0 heuristics
      elif "dev" in ver:
          vstr = vinfo[-1] + "-dev"
      else:
          vstr = ver.rstrip().split("-v")[-1]
  
      return LooseVersion(vstr)
  
imports: import os
  from looseversion import LooseVersion
  from ...utils.filemanip import fname_presuffix
  from ..base import CommandLine, Directory, CommandLineInputSpec, isdefined, traits, TraitedSpec, File, PackageInfo
label_desc: Use image node_id 2 for calling the Info obj's underlying member method code with example usage: obj.looseversion(cls) and returns: LooseVersion, LooseVersion