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
-
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)customContextMenuRequestedcustomContextMenuRequested(self, QPoint) [signal]
customEvent(self, QEvent)deleteLater(self)depth(self)destroy(self, destroyWindow, destroySubWindows)destroyeddestroyed(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)objectNameChangedobjectNameChanged(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)windowIconChangedwindowIconChanged(self, QIcon) [signal]
windowIconText(self)windowIconTextChangedwindowIconTextChanged(self, str) [signal]
windowModality(self)windowOpacity(self)windowRole(self)windowState(self)windowTitle(self)windowTitleChangedwindowTitleChanged(self, str) [signal]
windowType(self)x(self)y(self)activateOrInactivateBfactor
add_new_tab_with_layer_line_profile
prepare_layer_line_profile_plot
setCurrentDisplay
-
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.])
-
center_leftside(leftarr, rightarr)[source]¶ Function to flip and center left image side with respect to right image side and complement first pixel
Input: left-side amplitude, right-side amplitude
Output: complemented and mirrored left-side amplitudes
Usage: leftarrflip = center_leftside(leftarr, rightarr)
-
retrieve_ampnphases(llampprofile, llphprofile)[source]¶ Function to retrieve amplitude and phases along a layer line of interest
Input: layerline amplitude profile, layerline phase profile
Output: leftamplitude, rightamplitude and phase difference
Usage: leftamp, rightamp, phasediff = retrieve_ampnphases(llampprofile, llphprofile)
-
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
-
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
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
-
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
Input: helix width in Angstrom
Output: table with Bessel order and their corroesponding primary maximum and expected maximum for helix width
Usage: add_besseltable(helixwidth)
-
visualize_layerlines(figno, layerlines, layer_profiles)[source]¶ Function to visualize layer lines
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
Output: figure with stacked amplitude profile and phase difference plots
Usage: figure = visualize_layerlines(figno, layerlines, leftamp, rightamp, phasediff)
