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:
Does the following: |
- class fsleyes.actions.loaddicom.LoadDicomAction(overlayList, displayCtx, frame)[source]¶
Bases:
fsleyes.actions.base.Action
The
LoadDicomAction
is anAction
which allows the user to load images from a DICOM directory. When invoked, theLoadDicomAction
does the following:Prompts the user to select a DICOM directory
Identifies the data series that are present in the directory
Prompts the user to select which series they would like to load
Loads the selected series.
- __init__(overlayList, displayCtx, frame)[source]¶
Create a
LoadDicomAction
.- Parameters
overlayList – The
OverlayList
.displayCtx – The
DisplayContext
.frame – The
FSLeyesFrame
.
- __loadDicom()¶
Called when this
LoadDicomAction
is invoked. Calls theloadDicom()
function.
- __annotations__ = {}¶
- __module__ = 'fsleyes.actions.loaddicom'¶
- fsleyes.actions.loaddicom.loadDicom(dcmdir=None, parent=None, callback=None)[source]¶
Does the following:
Prompts the user to select a DICOM directory (unless
dcmdir is not None
)Loads metadata about all of the data series in the DICOM directory
Uses a
BrowseDicomDialog
to allow the user to choose which data series they wish to loadLoads 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.
parent –
wx
parent object.callback – Function which is passed the loaded DICOM series (
Image
objects).
- class fsleyes.actions.loaddicom.BrowseDicomDialog(parent, dcmseries)[source]¶
Bases:
__main__.docbuilder.run.<locals>.MockClass
The
BrowseDicomDialog
contains aBrowseDicomPanel
, 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
parent –
wx
parent objectdcmseries – List of DICOM data series, as returned by the
fsl.data.dicom.scanDir()
function.
- __onLoad(ev)¶
Called when the Load button is pushed. Closes the dialog.
- __onCancel(ev)¶
Called when the Cancel button is pushed. Closes the dialog.
- IsSelected(sidx)[source]¶
Returns
True
if the DICOM series at the given index has been selected by the user,False
otherwise.
- __annotations__ = {}¶
- __module__ = 'fsleyes.actions.loaddicom'¶
- class fsleyes.actions.loaddicom.BrowseDicomPanel(parent, dcmseries)[source]¶
Bases:
__main__.docbuilder.run.<locals>.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
parent –
wx
parent objectdcmseries – 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'¶