Documented functions with links to source

Program to extract amplitudes and phases from desired layer lines of class averages

class segclasslayer.SegClassLayerPar[source]

Class to initiate default dictionary with input parameters including help and range values and status dictionary

Methods

define_parameters_and_their_properties

define_program_states

set_class_format_choice

set_layer_line_position

set_pad_option

define_parameters_and_their_properties()[source]
define_program_states()[source]
set_class_format_choice(feature_set)[source]
set_layer_line_position(feature_set)[source]
set_pad_option(feature_set)[source]
class segclasslayer.SegClassLayerGui(parent: QWidget = None, flags: Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags())[source]

Methods

PaintDeviceMetric

Attributes

RenderFlag

Attributes

RenderFlags(…)

acceptDrops(self)

accessibleDescription(self)

accessibleName(self)

actionEvent(self, QActionEvent)

actions(self)

activateWindow(self)

addAction(self, QAction)

addActions(self, object)

adjustSize(self)

autoFillBackground(self)

backgroundRole(self)

baseSize(self)

blockSignals(self, bool)

changeEvent(self, QEvent)

childAt(self, QPoint)

childAt(self, int, int) -> QWidget

childEvent(self, QChildEvent)

children(self)

childrenRect(self)

childrenRegion(self)

clearFocus(self)

clearMask(self)

close(self)

closeEvent(self, QCloseEvent)

colorCount(self)

connectNotify(self, QMetaMethod)

contentsMargins(self)

contentsRect(self)

contextMenuEvent(self, QContextMenuEvent)

contextMenuPolicy(self)

create(self, window, initializeWindow, …)

createWindowContainer(QWindow, parent, …)

cursor(self)

customContextMenuRequested

customContextMenuRequested(self, QPoint) [signal]

customEvent(self, QEvent)

deleteLater(self)

depth(self)

destroy(self, destroyWindow, destroySubWindows)

destroyed

destroyed(self, QObject = None) [signal]

devType(self)

devicePixelRatio(self)

devicePixelRatioF(self)

devicePixelRatioFScale()

disconnect(self)

disconnectNotify(self, QMetaMethod)

dragEnterEvent(self, QDragEnterEvent)

dragLeaveEvent(self, QDragLeaveEvent)

dragMoveEvent(self, QDragMoveEvent)

dropEvent(self, QDropEvent)

dumpObjectInfo(self)

dumpObjectTree(self)

dynamicPropertyNames(self)

effectiveWinId(self)

ensurePolished(self)

enterEvent(self, QEvent)

event(self, QEvent)

eventFilter(self, QObject, QEvent)

find(sip.voidptr)

findChild(self, type, name, options, …)

findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject

findChildren(self, type, name, options, …)

findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegExp, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, type, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] findChildren(self, Tuple, QRegularExpression, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]

focusInEvent(self, QFocusEvent)

focusNextChild(self)

focusNextPrevChild(self, bool)

focusOutEvent(self, QFocusEvent)

focusPolicy(self)

focusPreviousChild(self)

focusProxy(self)

focusWidget(self)

font(self)

fontInfo(self)

fontMetrics(self)

foregroundRole(self)

frameGeometry(self)

frameSize(self)

geometry(self)

getContentsMargins(self)

grab(self, rectangle)

grabGesture(self, Qt.GestureType, flags, …)

grabKeyboard(self)

grabMouse(self) grabMouse(self, …)

grabShortcut(self, Union[QKeySequence, …)

graphicsEffect(self)

graphicsProxyWidget(self)

hasFocus(self)

hasHeightForWidth(self)

hasMouseTracking(self)

height(self)

heightForWidth(self, int)

heightMM(self)

hide(self)

hideEvent(self, QHideEvent)

inherits(self, str)

initPainter(self, QPainter)

inputMethodEvent(self, QInputMethodEvent)

inputMethodHints(self)

inputMethodQuery(self, Qt.InputMethodQuery)

insertAction(self, QAction, QAction)

insertActions(self, QAction, Iterable[QAction])

installEventFilter(self, QObject)

isActiveWindow(self)

isAncestorOf(self, QWidget)

isEnabled(self)

isEnabledTo(self, QWidget)

isFullScreen(self)

isHidden(self)

isLeftToRight(self)

isMaximized(self)

isMinimized(self)

isModal(self)

isRightToLeft(self)

isSignalConnected(self, QMetaMethod)

isVisible(self)

isVisibleTo(self, QWidget)

isWidgetType(self)

isWindow(self)

isWindowModified(self)

isWindowType(self)

keyPressEvent(self, QKeyEvent)

keyReleaseEvent(self, QKeyEvent)

keyboardGrabber()

killTimer(self, int)

layout(self)

layoutDirection(self)

leaveEvent(self, QEvent)

locale(self)

logicalDpiX(self)

logicalDpiY(self)

lower(self)

mapFrom(self, QWidget, QPoint)

mapFromGlobal(self, QPoint)

mapFromParent(self, QPoint)

mapTo(self, QWidget, QPoint)

mapToGlobal(self, QPoint)

mapToParent(self, QPoint)

mask(self)

maximumHeight(self)

maximumSize(self)

maximumWidth(self)

metaObject(self)

metric(self, QPaintDevice.PaintDeviceMetric)

minimumHeight(self)

minimumSize(self)

minimumSizeHint(self)

minimumWidth(self)

mouseDoubleClickEvent(self, QMouseEvent)

mouseGrabber()

mouseMoveEvent(self, QMouseEvent)

mousePressEvent(self, QMouseEvent)

mouseReleaseEvent(self, QMouseEvent)

move(self, QPoint) move(self, int, int)

moveEvent(self, QMoveEvent)

moveToThread(self, QThread)

nativeEvent(self, Union[QByteArray, bytes, …)

nativeParentWidget(self)

nextInFocusChain(self)

normalGeometry(self)

objectName(self)

objectNameChanged

objectNameChanged(self, str) [signal]

overrideWindowFlags(self, …)

overrideWindowState(self, …)

paintEngine(self)

paintEvent(self, QPaintEvent)

paintingActive(self)

palette(self)

parent(self)

parentWidget(self)

physicalDpiX(self)

physicalDpiY(self)

pos(self)

previousInFocusChain(self)

property(self, str)

pyqtConfigure(…)

Each keyword argument is either the name of a Qt property or a Qt signal.

raise_(self)

receivers(self, PYQT_SIGNAL)

rect(self)

releaseKeyboard(self)

releaseMouse(self)

releaseShortcut(self, int)

removeAction(self, QAction)

removeEventFilter(self, QObject)

render(self, QPaintDevice, targetOffset, …)

repaint(self) repaint repaint repaint(self, …)

resize(self, QSize) resize(self, int, int)

resizeEvent(self, QResizeEvent)

restoreGeometry(self, Union[QByteArray, …)

saveGeometry(self)

scroll(self, int, int) scroll(self, int, …)

sender(self)

senderSignalIndex(self)

setAcceptDrops(self, bool)

setAccessibleDescription(self, str)

setAccessibleName(self, str)

setAttribute(self, Qt.WidgetAttribute, on)

setAutoFillBackground(self, bool)

setBackgroundRole(self, QPalette.ColorRole)

setBaseSize(self, int, …)

setContentsMargins(self, int, int, int, …)

setContextMenuPolicy(self, Qt.ContextMenuPolicy)

setCursor(self, Union[QCursor, Qt.CursorShape])

setDisabled(self, bool)

setEnabled(self, bool)

setFixedHeight(self, int)

setFixedSize(self, QSize) setFixedSize(self, …)

setFixedWidth(self, int)

setFocus(self) setFocus(self, Qt.FocusReason)

setFocusPolicy(self, Qt.FocusPolicy)

setFocusProxy(self, QWidget)

setFont(self, QFont)

setForegroundRole(self, QPalette.ColorRole)

setGeometry(self, QRect) setGeometry(self, …)

setGraphicsEffect(self, QGraphicsEffect)

setHidden(self, bool)

setInputMethodHints(self, …)

setLayout(self, QLayout)

setLayoutDirection(self, Qt.LayoutDirection)

setLocale(self, QLocale)

setMask(self, QBitmap) setMask(self, QRegion)

setMaximumHeight(self, int)

setMaximumSize(self, int, …)

setMaximumWidth(self, int)

setMinimumHeight(self, int)

setMinimumSize(self, int, …)

setMinimumWidth(self, int)

setMouseTracking(self, bool)

setObjectName(self, str)

setPalette(self, QPalette)

setParent(self, QWidget) setParent(self, …)

setProperty(self, str, Any)

setShortcutAutoRepeat(self, int, enabled)

setShortcutEnabled(self, int, enabled)

setSizeIncrement(self, int, …)

setSizePolicy(self, …)

setStatusTip(self, str)

setStyle(self, QStyle)

setStyleSheet(self, str)

setTabOrder(QWidget, QWidget)

setToolTip(self, str)

setToolTipDuration(self, int)

setUpdatesEnabled(self, bool)

setVisible(self, bool)

setWhatsThis(self, str)

setWindowFilePath(self, str)

setWindowFlags(self, Union[Qt.WindowFlags, …)

setWindowIcon(self, QIcon)

setWindowIconText(self, str)

setWindowModality(self, Qt.WindowModality)

setWindowModified(self, bool)

setWindowOpacity(self, float)

setWindowRole(self, str)

setWindowState(self, Union[Qt.WindowStates, …)

setWindowTitle(self, str)

sharedPainter(self)

show(self)

showEvent(self, QShowEvent)

showFullScreen(self)

showMaximized(self)

showMinimized(self)

showNormal(self)

signalsBlocked(self)

size(self)

sizeHint(self)

sizeIncrement(self)

sizePolicy(self)

stackUnder(self, QWidget)

startTimer(self, int, timerType)

statusTip(self)

style(self)

styleSheet(self)

tabletEvent(self, QTabletEvent)

testAttribute(self, Qt.WidgetAttribute)

thread(self)

timerEvent(self, QTimerEvent)

toolTip(self)

toolTipDuration(self)

tr(self, str, disambiguation, n)

underMouse(self)

ungrabGesture(self, Qt.GestureType)

unsetCursor(self)

unsetLayoutDirection(self)

unsetLocale(self)

update(self) update update update(self, int, …)

updateGeometry(self)

updateMicroFocus(self)

updatesEnabled(self)

visibleRegion(self)

whatsThis(self)

wheelEvent(self, QWheelEvent)

width(self)

widthMM(self)

winId(self)

window(self)

windowFilePath(self)

windowFlags(self)

windowHandle(self)

windowIcon(self)

windowIconChanged

windowIconChanged(self, QIcon) [signal]

windowIconText(self)

windowIconTextChanged

windowIconTextChanged(self, str) [signal]

windowModality(self)

windowOpacity(self)

windowRole(self)

windowState(self)

windowTitle(self)

windowTitleChanged

windowTitleChanged(self, str) [signal]

windowType(self)

x(self)

y(self)

activateOrInactivateBfactor

add_new_tab_with_layer_line_profile

prepare_layer_line_profile_plot

setCurrentDisplay

enterEvent(self, QEvent)[source]
setCurrentDisplay(each_index)[source]
activateOrInactivateBfactor()[source]
add_new_tab_with_layer_line_profile(index_pair)[source]
prepare_layer_line_profile_plot(class_plot, layer_profile, ampmax=None)[source]
class segclasslayer.SegClassLayerExtract(parset=None)[source]
  • Class that holds functions for extracting layer lines including amplitude and phase from class averages

  • __init__ Function to interpret multi-input parameters

Methods

center_leftside(leftarr, rightarr)

  • Function to flip and center left image side with respect to right image side and complement first pixel

compute_phase_difference(leftph, rightph)

>>> from spring.segment2d.segclasslayer import SegClassLayer

compute_phase_difference_old(leftph, rightph)

>>> from spring.segment2d.segclasslayer import SegClassLayer

pad_avg(layerlines, classno)

  • Function to pad average to fit layer lines directly onto pixel row (pads classavg and adjusts segmentsize)

retrieve_ampnphases(llampprofile, llphprofile)

  • Function to retrieve amplitude and phases along a layer line of interest

extract_layer_line_amplitude_and_phases

get_amplitude_and_phase_at_position

make_named_tuple_layer_line

prepare_amplitude_and_phase_image

compute_phase_difference(leftph, rightph)[source]
>>> from spring.segment2d.segclasslayer import SegClassLayer
>>> s = SegClassLayer()
>>> s.compute_phase_difference(np.array([50] * 2), np.array([-120] * 2))
array([170, 170])
>>> s.compute_phase_difference(np.array([170]), np.array([180]))
array([-10])
>>> s.compute_phase_difference(np.array([-70]), np.array([170]))
array([120])
compute_phase_difference_old(leftph, rightph)[source]
>>> from spring.segment2d.segclasslayer import SegClassLayer
>>> s = SegClassLayer()
>>> s.compute_phase_difference_old(np.array([50]), np.array([-120]))
array([170.])
>>> s.compute_phase_difference_old(np.array([170]), np.array([180]))
array([-10.])
>>> s.compute_phase_difference_old(np.array([-70]), np.array([170]))
array([120.])
make_named_tuple_layer_line()[source]
center_leftside(leftarr, rightarr)[source]
  • Function to flip and center left image side with respect to right image side and complement first pixel

  1. Input: left-side amplitude, right-side amplitude

  2. Output: complemented and mirrored left-side amplitudes

  3. Usage: leftarrflip = center_leftside(leftarr, rightarr)

retrieve_ampnphases(llampprofile, llphprofile)[source]
  • Function to retrieve amplitude and phases along a layer line of interest

  1. Input: layerline amplitude profile, layerline phase profile

  2. Output: leftamplitude, rightamplitude and phase difference

  3. Usage: leftamp, rightamp, phasediff = retrieve_ampnphases(llampprofile, llphprofile)

prepare_amplitude_and_phase_image(avg)[source]
get_amplitude_and_phase_at_position(amplitude_of_avg, phase_of_average, lineimgpos)[source]
extract_layer_line_amplitude_and_phases(avg, layerlinespix)[source]
pad_avg(layerlines, classno)[source]
  • Function to pad average to fit layer lines directly onto pixel row (pads classavg and adjusts segmentsize)

  1. Input: list of layerlines in pixel

  2. Output: list of adjusted layerlines in pixel

  3. Usage: layerlines = pad_avg(layerlines)

class segclasslayer.SegClassLayerGuiSupport(parset=None)[source]

Methods

center_leftside(leftarr, rightarr)

  • Function to flip and center left image side with respect to right image side and complement first pixel

compute_phase_difference(leftph, rightph)

>>> from spring.segment2d.segclasslayer import SegClassLayer

compute_phase_difference_old(leftph, rightph)

>>> from spring.segment2d.segclasslayer import SegClassLayer

pad_avg(layerlines, classno)

  • Function to pad average to fit layer lines directly onto pixel row (pads classavg and adjusts segmentsize)

retrieve_ampnphases(llampprofile, llphprofile)

  • Function to retrieve amplitude and phases along a layer line of interest

extract_layer_line_amplitude_and_phases

get_amplitude_and_phase_at_position

get_class_img

make_named_tuple_amp_phase_images

make_named_tuple_layer_line

prepare_amplitude_and_phase_image

prepare_class_img_and_power_spectrum

make_named_tuple_amp_phase_images()[source]
get_class_img(class_id)[source]
prepare_class_img_and_power_spectrum(class_id, class_plot)[source]
class segclasslayer.SegClassLayer(parset=None)[source]

Methods

add_besseltable(diag_plot, tbl[, helixwidth])

  • Function to add Bessel order look-up table to printout

center_leftside(leftarr, rightarr)

  • Function to flip and center left image side with respect to right image side and complement first pixel

compute_phase_difference(leftph, rightph)

>>> from spring.segment2d.segclasslayer import SegClassLayer

compute_phase_difference_old(leftph, rightph)

>>> from spring.segment2d.segclasslayer import SegClassLayer

determine_max()

  • Function to determine maximum of layer line

get_bessel_table_quant(helixwidth)

>>> from spring.segment2d.segclasslayer import SegClassLayer

pad_avg(layerlines, classno)

  • Function to pad average to fit layer lines directly onto pixel row (pads classavg and adjusts segmentsize)

retrieve_ampnphases(llampprofile, llphprofile)

  • Function to retrieve amplitude and phases along a layer line of interest

visualize_layerlines(figno, layerlines, …)

  • Function to visualize layer lines

add_amplitude_and_phase_difference_to_plot

add_labels_to_plot

determine_first_maxima_computationally

extract_and_visualize_layer_lines

extract_layer_line_amplitude_and_phases

extract_layerlines

get_amplitude_and_phase_at_position

get_class_img

launch_segclasslayer_gui

make_named_tuple_amp_phase_images

make_named_tuple_layer_line

plot_individual_layer_lines

prepare_amplitude_and_phase_image

prepare_class_img_and_power_spectrum

print_layerlines_as_requested

add_amplitude_and_phase_difference_to_plot(layer_profile, arrresolution, ax1, ampmax=None)[source]
determine_first_maxima_computationally(layer_profile, ax1)[source]
add_labels_to_plot(ax1, ax2)[source]
plot_individual_layer_lines(diag_plot, layerlines, layer_profiles)[source]
determine_max()[source]
  • Function to determine maximum of layer line

get_bessel_table_quant(helixwidth)[source]
>>> from spring.segment2d.segclasslayer import SegClassLayer
>>> s = SegClassLayer()
>>> s.get_bessel_table_quant(100) 
([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], 
[0.0, 1.8, 3.1, 4.2, 5.3, 6.4, 7.5, 8.6, 9.6, 10.7, 11.8, 12.8, 13.9, 
14.9, 16.0, 17.0, 18.1, 19.1, 20.1, 21.2], [0.0, 0.006, 0.01, 0.013, 
0.017, 0.02, 0.024, 0.027, 0.031, 0.034, 0.038, 0.041, 0.044, 0.047, 
0.051, 0.054, 0.058, 0.061, 0.064, 0.067])
add_besseltable(diag_plot, tbl, helixwidth=None)[source]
  • Function to add Bessel order look-up table to printout

  1. Input: helix width in Angstrom

  2. Output: table with Bessel order and their corroesponding primary maximum and expected maximum for helix width

  3. Usage: add_besseltable(helixwidth)

extract_layerlines(infilestack, classno)[source]
visualize_layerlines(figno, layerlines, layer_profiles)[source]
  • Function to visualize layer lines

  1. Input: figurenumber, list of layerlines (1/Angstrom), list of left-side centered amplitude arrays, list of right-side centered amplitude arrays, list of phasedifference arrays

  2. Output: figure with stacked amplitude profile and phase difference plots

  3. Usage: figure = visualize_layerlines(figno, layerlines, leftamp, rightamp, phasediff)

print_layerlines_as_requested()[source]
launch_segclasslayer_gui(feature_set)[source]
extract_and_visualize_layer_lines()[source]
segclasslayer.main()[source]