fsleyes.actions.resample
¶
This module provides the ResampleAction
class, a FSLeyes action
which allows the user to resample an image to a different resolution.
-
class
fsleyes.actions.resample.
ResampleAction
(overlayList, displayCtx, frame)¶ Bases:
fsleyes.actions.base.Action
-
__init__
(overlayList, displayCtx, frame)¶ Create a
ResampleAction
.Parameters: - overlayList – The
OverlayList
. - displayCtx – The
DisplayContext
. - frame – The
FSLeyesFrame
.
- overlayList – The
-
destroy
()¶ Removes listeners from the
DisplayContext
andOverlayList
, and callsAction.destroy()
.
-
_ResampleAction__resample
()¶ Called when this
ResampleAction
is invoked. Shows aResampleDialog
, and then resamples the currently selected overlay.
-
_ResampleAction__selectedOverlayChanged
(*a)¶ Called when the selected overlay, or overlay list, changes.
Enables/disables this action depending on the nature of the selected overlay.
-
__module__
= 'fsleyes.actions.resample'¶
-
-
class
fsleyes.actions.resample.
ResampleDialog
(parent, title, shape, pixdim)¶ Bases:
__main__.MockClass
The
ResampleDialog
is used by theResampleAction
to prompt the user for a new resampled image shape. It contains controls allowing the user to select new voxel and pixdim values, and to select resampling options for interpolation, data type, and smoothing.-
__init__
(parent, title, shape, pixdim)¶ Create a
ResampleDialog
.Parameters: - parent –
wx
parent object - title – Dialog title
- shape – The original image shape (a tuple of three integers)
- pixdim – The original image pixdims (a tuple of three floats)
- parent –
-
GetVoxels
()¶ Returns the current voxel values.
-
GetInterpolation
()¶ Returns the currently selected interpolation setting, either
'nearest'
,'linear'
, or'cubic'
.
-
GetDataType
()¶ Returns the currently selected data type setting as a
numpy.dtype
, one ofuint8
,int16
,int32
,float32
, orfloat64
.
-
GetSmoothing
()¶ Returns the currently selected smoothing setting, either
True
, orFalse
.
-
GetPixdims
()¶ Returns the current pixdim values.
-
_ResampleDialog__derivePixdims
()¶ Derives new pixdim values from the current voxel values.
-
_ResampleDialog__deriveVoxels
()¶ Derives new voxel values from the current pixdim values.
-
_ResampleDialog__onCancel
(ev)¶ Called when the cancel button is pushed. Closes the dialog.
-
_ResampleDialog__onOk
(ev)¶ Called when the ok button is pushed. Closes the dialog.
-
_ResampleDialog__onPixdim
(ev)¶ Called when the user changes a pixdim value. Updates the voxel values accordingly.
-
_ResampleDialog__onReset
(ev)¶ Called when the reset button is pushed. Resets the shape and pixdims to their original values.
-
_ResampleDialog__onVoxel
(ev)¶ Called when the user changes a voxel value. Updates the pixdim values accordingly.
-
__module__
= 'fsleyes.actions.resample'¶
-