# API

## Submodules

## tomogui.gui.MainWidget module

class tomogui.gui.MainWidget.TomoguiMainWindow(showOnlyReconsOpt=False, mockNoFreeart=False)

  Bases: `PyQt5.QtWidgets.QWidget`

  Window proposing all the possibility to use tomogui

  LAYOUT_INDEX_LIMIT = 100
  mainWindow

    The tomogui project main window

  creator

    The tomogui absorption matrix creator

  launchAbsMatCreator()
  launchTomoguiproject()

## tomogui.gui.ProjectWidget module

class tomogui.gui.ProjectWidget.ProjectWindow(parent=None, cfgFile=None)

  Bases: `PyQt5.QtWidgets.QMainWindow`

  This is the main window to deal with a freeART reconsparam

  Parameters

    parent – the parent of the widget in the Qt hierarchy

  clean()
  setConfFile(cfgFile)
  filterOtherThan(id)

    set the widget on for the given reconsparam type.

    Parameters

      id –

    Returns

  setReconsFluoMode(opt)

    Set the reconsparam from fluo to be made from albsorption files directly or from I0 and It

    Parameters

      opt – the reconsparam we want. Should be in QDataSourceFluoWidget.RECONS_MODE

    Returns

  setSinoToRecons(reconsType, sinograms, names)
  setIt(it, name=None)
  setI0(i0, name=None)
  setLogRecons(isLogRecons)

    Set reconstruction mode for transmission reconstruction

class tomogui.gui.ProjectWidget.MainWidget(parent=None, statusBar=None)

  Bases: `PyQt5.QtWidgets.QWidget`

  This is the main widget for a freeART reconsparam.

  Parameters

    parent – the parent of the widget in the Qt hierarchy

  clean()
  setSinoToRecons(reconsType, sinogramsData, names=None)

    Set the GUI to run the reconstruction of the given sinograms in the given mode.

    Note

    for Tx and FBP reconstruction we can now only deal with one reconstruction. Multiple sinogram reconstruction is only managed for fluorescence and compton.

    Parameters

      - reconsType (str) – the type of reconstruction to run

      - sinogramsData (list) – list of numpy arrays to reconstruct. Numpy nd arrays should be 2D.

      - names – list of the names of the sinograms

  setIt(it, name=None)
  setI0(i0, name=None)
  setLogRecons(isLog)
  getReconsParamWidget()
  getNormalizationWidget()
  getDataSourceWidget()
  getMaterialsWidget()
  saveConfiguration(filePath, merge)

    Save the current configuration to the given file paths

  getConfiguration(configFile)

    Save the current configuration to the required configFile

  setReconstructionType(reconsType)
  loadConfigurationFromFile(filePath)

    Update the widget fron a configuraton file :param filePath: The path of the configuration file.

    > Warning: This must be a ‘.cfg’ file

  loadConfiguration(config)
  getReconstructionType()