fsleyes.actions.loaddicom

This module provides the LoadDicomAction class, an Action which allows the user to load images from a DICOM directory.

A few standalone functions are also defined in this module:

loadDicom Does the following:
class fsleyes.actions.loaddicom.LoadDicomAction(overlayList, displayCtx, frame)[source]

Bases: fsleyes.actions.base.Action

The LoadDicomAction is an Action which allows the user to load images from a DICOM directory. When invoked, the LoadDicomAction does the following:

  1. Prompts the user to select a DICOM directory
  2. Identifies the data series that are present in the directory
  3. Prompts the user to select which series they would like to load
  4. Loads the selected series.
__init__(overlayList, displayCtx, frame)[source]

Create a LoadDicomAction.

Parameters:
_LoadDicomAction__loadDicom()

Called when this LoadDicomAction is invoked. Calls the loadDicom() function.

__module__ = 'fsleyes.actions.loaddicom'
fsleyes.actions.loaddicom.loadDicom(dcmdir=None, parent=None, callback=None)[source]

Does the following:

  1. Prompts the user to select a DICOM directory (unless dcmdir is not None)
  2. Loads metadata about all of the data series in the DICOM directory
  3. Uses a BrowseDicomDialog to allow the user to choose which data series they wish to load
  4. Loads the selected series, and passes them to the callback function if it is provided.
Parameters:
  • dcmdir – Directory to load DICOMs from. If not provided, the user is prompted to select a directory.
  • parentwx parent object.
  • callback – Function which is passed the loaded DICOM series (Image objects).
class fsleyes.actions.loaddicom.BrowseDicomDialog(parent, dcmseries)[source]

Bases: __main__.MockClass

The BrowseDicomDialog contains a BrowseDicomPanel, and a couple of buttons, allowing the user to select which DICOM series they would like to load.

__init__(parent, dcmseries)[source]

Create a BrowseDicomDialog.

Parameters:
  • parentwx parent object
  • dcmseries – List of DICOM data series, as returned by the fsl.data.dicom.scanDir() function.
IsSelected(sidx)[source]

Returns True if the DICOM series at the given index has been selected by the user, False otherwise.

_BrowseDicomDialog__onCancel(ev)

Called when the Cancel button is pushed. Closes the dialog.

_BrowseDicomDialog__onLoad(ev)

Called when the Load button is pushed. Closes the dialog.

__module__ = 'fsleyes.actions.loaddicom'
class fsleyes.actions.loaddicom.BrowseDicomPanel(parent, dcmseries)[source]

Bases: __main__.MockClass

The BrowseDicomPanel displayes information about a collection of DICOM data series, and allows the user to select which series they would like to load.

__init__(parent, dcmseries)[source]

Create a BrowseDicomPanel.

Parameters:
  • parentwx parent object
  • dcmseries – List of DICOM data series, as returned by the fsl.data.dicom.scanDir() function.
IsSelected(sidx)[source]

Returns True if the DICOM series at the given index has been selected by the user, False otherwise.

__module__ = 'fsleyes.actions.loaddicom'