Documented functions with links to source

Program to examine all excised in-plane rotated segments and compute their collapsed (1D) and 2D power spectrum and width profile of helices

class segmentexam.SegmentExamPar[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_compute_layer_line_correlation

set_layer_line_region

set_power_spectrum_reference

define_parameters_and_their_properties()[source]
define_program_states()[source]
set_compute_layer_line_correlation(feature_set)[source]
set_power_spectrum_reference(feature_set)[source]
set_layer_line_region(feature_set)[source]
class segmentexam.SegmentExamPower(parset=None)[source]
  • Class that holds functions for examining segments from micrographs

  • __init__ Function to interpret multi-input parameters

Methods

apply_binfactor(binfactor, infilestack, …)

  • Function to reduce stack and modify pixelsize according to desired binfactor

collapse_power(addpowimg)

  • Function to project powerspectrum onto 1D plot to determine layer line position

enhance_power([avg_periodogram, pixelsize])

  • Function to visually enhance power spectrum by compensating for decay of amplitude

project_helix([seg])

  • Function to project image along helical axis by adding rows of image

project_normal_to_helix([seg])

  • Function to project image perpendicular to helical axis by adding columns of image

bin_image_stack_by_binfactor

bin_image_stack_by_binfactor(infilestack, binfactor, image_list=None, binned_stack=None)[source]
apply_binfactor(binfactor, infilestack, segsizepix, helixwidthpix, pixelsize, image_list=None, outfile=None)[source]
  • Function to reduce stack and modify pixelsize according to desired binfactor

  1. Input: binfactor, infile stack to be binned, segment size (pixel), helix width (pixel) pixelsize

  2. Output: binned stack, adjusted segment size (pixel), helix width (pixel), pixelsize

  3. Usage: binned stack, segsizepix, helixwidth, pixelsize = apply_binfactor(binfactor, infilestack, segsizepix, helixwidth, pixelsize)

enhance_power(avg_periodogram=None, pixelsize=None)[source]
  • Function to visually enhance power spectrum by compensating for decay of amplitude

  1. Input: power spectrum

  2. Output: enhanced power spectrum

  3. Usage: avg_periodogram_enhanced = enhance_power(avg_periodogram)

collapse_power(addpowimg)[source]
  • Function to project powerspectrum onto 1D plot to determine layer line position

  1. Input: power spectrum, segment size (pixel)

  2. Output: collapsed profile

  3. Usage: add1dimg = collapse_power(avg_periodogram)

project_helix(seg=None)[source]
  • Function to project image along helical axis by adding rows of image

  1. Input: segment

  2. Output: projected profile

  3. Usage: rowsaddimg = project_helix(seg)

project_normal_to_helix(seg=None)[source]
  • Function to project image perpendicular to helical axis by adding columns of image

  1. Input: segment

  2. Output: projected profile

  3. Usage: columnsaddimg = project_normal_to_helix(seg)

class segmentexam.SegmentExamMask(parset=None)[source]

Methods

apply_binfactor(binfactor, infilestack, …)

  • Function to reduce stack and modify pixelsize according to desired binfactor

collapse_power(addpowimg)

  • Function to project powerspectrum onto 1D plot to determine layer line position

enhance_power([avg_periodogram, pixelsize])

  • Function to visually enhance power spectrum by compensating for decay of amplitude

generate_falloff_line(segment_size_in_pixel, …)

>>> from spring.segment2d.segmentexam import SegmentExam

make_smooth_rectangular_mask(hel_width_pix, …)

>>> from spring.segment2d.segmentexam import SegmentExam

project_helix([seg])

  • Function to project image along helical axis by adding rows of image

project_normal_to_helix([seg])

  • Function to project image perpendicular to helical axis by adding columns of image

add_smooth_gaussian_falloff_to_edge_of_binary_mask

bin_image_stack_by_binfactor

compute_radial_average_from_line

generate_radial_falloff_gradient

generate_rectangular_mask_with_linear_falloffs

generate_two_dee_cosine_falloff

insert_radial_falloff_gradient_into_corners_of_rectangular_mask

insure_mirror_symmetry_of_mask_parameters

limit_width_falloff_to_available_pixels_outside_binary_mask

make_binary_shape_mask

pad_image_to_current_size

resize_mask_to_segment_dimensions

window_image_to_current_sizes

limit_width_falloff_to_available_pixels_outside_binary_mask(helix_width_in_pixel, helix_height_in_pixel, segment_size_in_pixel, width_falloff)[source]
insure_mirror_symmetry_of_mask_parameters(helix_width_in_pixel, helix_height_in_pixel)[source]
make_binary_shape_mask(helix_width_in_pixel, helix_height_in_pixel, segment_size_in_pixel)[source]
add_smooth_gaussian_falloff_to_edge_of_binary_mask(segment_size_in_pixel, width_falloff, binary_mask)[source]
generate_falloff_line(segment_size_in_pixel, width_falloff)[source]
>>> from spring.segment2d.segmentexam import SegmentExam
>>> s = SegmentExam()
>>> s.generate_falloff_line(20, 0.5)
(array([1.        , 0.97488286, 0.90205491, 0.78883309, 0.64659262,
       0.48962419, 0.33369821, 0.19448033, 0.08595758, 0.01903308]), 10)
>>> s.generate_falloff_line(20, 0)
(array([], dtype=float64), 0)
generate_two_dee_cosine_falloff(falloff_line, max_dim)[source]
generate_rectangular_mask_with_linear_falloffs(helix_width_in_pixel, helix_height_in_pixel, segment_size_in_pixel, width_falloff)[source]
generate_radial_falloff_gradient(falloff_line)[source]
insert_radial_falloff_gradient_into_corners_of_rectangular_mask(radial_quadrant, falloff_line, rect_mask)[source]
pad_image_to_current_size(emmask, current_xsize, current_ysize)[source]
window_image_to_current_sizes(emmask, current_xsize, current_ysize)[source]
resize_mask_to_segment_dimensions(emmask, segment_size)[source]
compute_radial_average_from_line(falloff_line, falloff_len)[source]
make_smooth_rectangular_mask(hel_width_pix, hel_height_pix, seg_size_pix, width_falloff=0.1)[source]
>>> from spring.segment2d.segmentexam import SegmentExam
>>> helixmask = SegmentExam().make_smooth_rectangular_mask(13, 30, 40)
>>> mask_row = helixmask.get_row(20)
>>> EMNumPy.em2numpy(mask_row)
array([0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        ,
       0.13561368, 0.4896242 , 0.84986573, 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 1.        , 1.        ,
       1.        , 1.        , 1.        , 0.84986573, 0.4896242 ,
       0.13561368, 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        ],
      dtype=float32)
>>> helixmask = SegmentExam().make_smooth_rectangular_mask(20, 20, 40, 0)
>>> mask_row = helixmask.get_row(20)
>>> EMNumPy.em2numpy(mask_row)
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 1., 1., 1., 1., 1., 1.,
       1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 0., 0., 0., 0.,
       0., 0., 0., 0., 0., 0.], dtype=float32)
class segmentexam.SegmentExamWidth(parset=None)[source]

Methods

apply_binfactor(binfactor, infilestack, …)

  • Function to reduce stack and modify pixelsize according to desired binfactor

collapse_power(addpowimg)

  • Function to project powerspectrum onto 1D plot to determine layer line position

enhance_power([avg_periodogram, pixelsize])

  • Function to visually enhance power spectrum by compensating for decay of amplitude

find_local_extrema(fits[, target, window])

Function from [SciPy-user] mailing list ‘Finding local minima of greater than a given depth’

generate_falloff_line(segment_size_in_pixel, …)

>>> from spring.segment2d.segmentexam import SegmentExam

make_smooth_rectangular_mask(hel_width_pix, …)

>>> from spring.segment2d.segmentexam import SegmentExam

measure_peakdist([rowsaddimg, segsizepix, …])

  • Function to measure distance between two symmetrical peaks of 1D helix width projection

project_helix([seg])

  • Function to project image along helical axis by adding rows of image

project_normal_to_helix([seg])

  • Function to project image perpendicular to helical axis by adding columns of image

add_smooth_gaussian_falloff_to_edge_of_binary_mask

bin_image_stack_by_binfactor

compute_radial_average_from_line

generate_radial_falloff_gradient

generate_rectangular_mask_with_linear_falloffs

generate_two_dee_cosine_falloff

insert_radial_falloff_gradient_into_corners_of_rectangular_mask

insure_mirror_symmetry_of_mask_parameters

limit_width_falloff_to_available_pixels_outside_binary_mask

make_binary_shape_mask

pad_image_to_current_size

resize_mask_to_segment_dimensions

window_image_to_current_sizes

find_local_extrema(fits, target='maxima', window=None)[source]

Function from [SciPy-user] mailing list ‘Finding local minima of greater than a given depth’

  1. Input: 1D/2D array of data and window size for minimum filter

  2. Output: ordered indices and minimum values

  3. Usage: ind, minima = find_local_extrema(array, target, window)

measure_peakdist(rowsaddimg=None, segsizepix=None, pixelsize=None)[source]
  • Function to measure distance between two symmetrical peaks of 1D helix width projection

  1. Input: rowsaddimg = projection to be measured, segsizepix = segment size (pixel), pixelsize

  2. Output: width of helix in Angstrom

  3. Usage: width = measure_peakdist(rowsaddimg, segsizepix, pixelsize)

class segmentexam.SegmentExamLayerCorrelation(parset=None)[source]

Methods

apply_binfactor(binfactor, infilestack, …)

  • Function to reduce stack and modify pixelsize according to desired binfactor

collapse_power(addpowimg)

  • Function to project powerspectrum onto 1D plot to determine layer line position

compute_radii_for_fourier_mask(…)

>>> from spring.segment2d.segmentexam import SegmentExam

enhance_power([avg_periodogram, pixelsize])

  • Function to visually enhance power spectrum by compensating for decay of amplitude

find_local_extrema(fits[, target, window])

Function from [SciPy-user] mailing list ‘Finding local minima of greater than a given depth’

generate_falloff_line(segment_size_in_pixel, …)

>>> from spring.segment2d.segmentexam import SegmentExam

make_smooth_rectangular_mask(hel_width_pix, …)

>>> from spring.segment2d.segmentexam import SegmentExam

measure_peakdist([rowsaddimg, segsizepix, …])

  • Function to measure distance between two symmetrical peaks of 1D helix width projection

project_helix([seg])

  • Function to project image along helical axis by adding rows of image

project_normal_to_helix([seg])

  • Function to project image perpendicular to helical axis by adding columns of image

add_smooth_gaussian_falloff_to_edge_of_binary_mask

bin_image_stack_by_binfactor

compute_power_correlations_with_rings

compute_radial_average_from_line

enter_correlation_values_in_database

generate_radial_falloff_gradient

generate_rectangular_mask_with_linear_falloffs

generate_series_of_circular_masks_from_radii

generate_two_dee_cosine_falloff

insert_radial_falloff_gradient_into_corners_of_rectangular_mask

insure_mirror_symmetry_of_mask_parameters

limit_width_falloff_to_available_pixels_outside_binary_mask

make_binary_shape_mask

pad_image_to_current_size

resize_mask_to_segment_dimensions

window_image_to_current_sizes

compute_radii_for_fourier_mask(layer_line_region, segment_size, pixelsize)[source]
>>> from spring.segment2d.segmentexam import SegmentExam
>>> SegmentExam().compute_radii_for_fourier_mask(((0.1, 0.2)), 100, 2.5) 
array([25., 50.])
generate_series_of_circular_masks_from_radii(radii_pixel, segment_size)[source]
compute_power_correlations_with_rings(avg_periodogram, masked_power, masks, segment_ids)[source]
enter_correlation_values_in_database(correlations, segment_ids)[source]
class segmentexam.SegmentExamVisualize(parset=None)[source]

Methods

apply_binfactor(binfactor, infilestack, …)

  • Function to reduce stack and modify pixelsize according to desired binfactor

cleanup(*files)

  • Function to clean up intermediate image files

collapse_power(addpowimg)

  • Function to project powerspectrum onto 1D plot to determine layer line position

compute_radii_for_fourier_mask(…)

>>> from spring.segment2d.segmentexam import SegmentExam

display_average_and_variance([twodavg, twodvar])

  • Function to add average and variance images to diagnostic output plot

display_power_spectra_enhanced_and_collapsed([…])

  • Function to visualize power spectra: sum of power spectra, enhanced sum and their collapsed 1D profile

enhance_power([avg_periodogram, pixelsize])

  • Function to visually enhance power spectrum by compensating for decay of amplitude

find_local_extrema(fits[, target, window])

Function from [SciPy-user] mailing list ‘Finding local minima of greater than a given depth’

generate_falloff_line(segment_size_in_pixel, …)

>>> from spring.segment2d.segmentexam import SegmentExam

make_oneoverres([arr, pixelsize])

  • Function to generate an array of resolution in reciprocal Angstrom

make_smooth_rectangular_mask(hel_width_pix, …)

>>> from spring.segment2d.segmentexam import SegmentExam

measure_peakdist([rowsaddimg, segsizepix, …])

  • Function to measure distance between two symmetrical peaks of 1D helix width projection

project_helix([seg])

  • Function to project image along helical axis by adding rows of image

project_normal_to_helix([seg])

  • Function to project image perpendicular to helical axis by adding columns of image

setup_fourxtwo([figno])

  • Function to setup 4 x 2 subplot grid for diagnostic output

split_quarters([addpowimgenh])

  • Function to split enhanced power spectrum (EMData object) into lower right quarter

visualize_widthprofile_and_histogram([…])

  • Function to add width profile to diagnostic output plot

add_smooth_gaussian_falloff_to_edge_of_binary_mask

add_width_histogram_next_to_width_profile

add_width_profile_from_avg_and_var

bin_image_stack_by_binfactor

compute_power_correlations_with_rings

compute_radial_average_from_line

enter_correlation_values_in_database

generate_radial_falloff_gradient

generate_rectangular_mask_with_linear_falloffs

generate_series_of_circular_masks_from_radii

generate_two_dee_cosine_falloff

insert_radial_falloff_gradient_into_corners_of_rectangular_mask

insure_mirror_symmetry_of_mask_parameters

limit_width_falloff_to_available_pixels_outside_binary_mask

make_binary_shape_mask

pad_image_to_current_size

resize_mask_to_segment_dimensions

window_image_to_current_sizes

split_quarters(addpowimgenh=None)[source]
  • Function to split enhanced power spectrum (EMData object) into lower right quarter

  1. Input: avg_periodogram_enhanced = added power spectrum, segment size (pixel)

  2. Output: lower right quarter

  3. Usage: addpowimgenh1st = split_quarters(avg_periodogram_enhanced)

setup_fourxtwo(figno=None)[source]
  • Function to setup 4 x 2 subplot grid for diagnostic output

  1. Input: figno = figure number

  2. Output: figure

  3. Usage figure = setupfourxtwo(figno)

display_average_and_variance(twodavg=None, twodvar=None)[source]
  • Function to add average and variance images to diagnostic output plot

  1. Input: 2D average, 2d variance

  2. Output: subplot ax1, subplot ax3

  3. Usage: ax1, ax3 = display_average_and_variance(twodavg, twodvar)

add_width_profile_from_avg_and_var(widthavg, widthvar, pixelsize, axx, quantity='width')[source]
add_width_histogram_next_to_width_profile(widths)[source]
visualize_widthprofile_and_histogram(widths=None, widthavg=None, widthvar=None, pixelsize=None)[source]
  • Function to add width profile to diagnostic output plot

Input: widths = list of widths, widthavg = average of width, widthvar = variance of width, pixelsize Output: subplot ax2, ax4 Usage: ax2, ax4 = visualize_widthprofile_and_histogram(widths, widthavg, widthvar, pixelsize)

display_power_spectra_enhanced_and_collapsed(avg_periodogram=None, avg_periodogram_enhanced=None, avg_collapsed_power_line=None, avg_collapsed_line_enhanced=None)[source]
  • Function to visualize power spectra: sum of power spectra, enhanced sum and their collapsed 1D profile

  1. Input: avg_periodogram = sum of power spectra (img), avg_periodogram_enhanced = enhanced sum of power spectra, avg_collapsed_power_line = collapsed profile of power spectrum (img), avg_collapsed_line_enhanced = collapsed profile of enhanced power spectrum

  2. Output: subplots ax5, ax6, ax7, ax8

  3. Usage: ax5, ax6, ax7, ax8 = display_power_spectra_enhanced_and_collapsed(avg_periodogram,

    avg_periodogram_enhanced, avg_collapsed_power_line, avg_collapsed_line_enhanced)

make_oneoverres(arr=None, pixelsize=None)[source]
  • Function to generate an array of resolution in reciprocal Angstrom

  1. Input: array, pixelsize

  2. Output: array of reciprocal resolution (1/Angstrom)

  3. Usage: arrresolution = make_overoverres(arr, pixelsize)

>>> from spring.segment2d.segmentexam import SegmentExam
>>> SegmentExam().make_oneoverres(range(10), 10)
array([0.        , 0.00555556, 0.01111111, 0.01666667, 0.02222222,
       0.02777778, 0.03333333, 0.03888889, 0.04444444, 0.05      ])
>>> SegmentExam().make_oneoverres(range(25), 1)
array([0.        , 0.02083333, 0.04166667, 0.0625    , 0.08333333,
       0.10416667, 0.125     , 0.14583333, 0.16666667, 0.1875    ,
       0.20833333, 0.22916667, 0.25      , 0.27083333, 0.29166667,
       0.3125    , 0.33333333, 0.35416667, 0.375     , 0.39583333,
       0.41666667, 0.4375    , 0.45833333, 0.47916667, 0.5       ])
>>> 1/SegmentExam().make_oneoverres(range(25), 1)
array([        inf, 48.        , 24.        , 16.        , 12.        ,
        9.6       ,  8.        ,  6.85714286,  6.        ,  5.33333333,
        4.8       ,  4.36363636,  4.        ,  3.69230769,  3.42857143,
        3.2       ,  3.        ,  2.82352941,  2.66666667,  2.52631579,
        2.4       ,  2.28571429,  2.18181818,  2.08695652,  2.        ])
cleanup(*files)[source]
  • Function to clean up intermediate image files

Input: arbitrary number of files Ouput: None Usage: cleanup(thisfile, anotherfile)

class segmentexam.SegmentExam(parset=None)[source]

Methods

add_power_spectra_from_verticalized_stack(…)

  • Function to compute sum of in-planed rotated segments

apply_binfactor(binfactor, infilestack, …)

  • Function to reduce stack and modify pixelsize according to desired binfactor

cleanup(*files)

  • Function to clean up intermediate image files

collapse_power(addpowimg)

  • Function to project powerspectrum onto 1D plot to determine layer line position

compute_radii_for_fourier_mask(…)

>>> from spring.segment2d.segmentexam import SegmentExam

determine_width(infilestack, segsizepix, …)

  • Function to project width profile of segments

display_average_and_variance([twodavg, twodvar])

  • Function to add average and variance images to diagnostic output plot

display_power_spectra_enhanced_and_collapsed([…])

  • Function to visualize power spectra: sum of power spectra, enhanced sum and their collapsed 1D profile

enhance_power([avg_periodogram, pixelsize])

  • Function to visually enhance power spectrum by compensating for decay of amplitude

find_local_extrema(fits[, target, window])

Function from [SciPy-user] mailing list ‘Finding local minima of greater than a given depth’

generate_falloff_line(segment_size_in_pixel, …)

>>> from spring.segment2d.segmentexam import SegmentExam

make_oneoverres([arr, pixelsize])

  • Function to generate an array of resolution in reciprocal Angstrom

make_smooth_rectangular_mask(hel_width_pix, …)

>>> from spring.segment2d.segmentexam import SegmentExam

measure_peakdist([rowsaddimg, segsizepix, …])

  • Function to measure distance between two symmetrical peaks of 1D helix width projection

project_helix([seg])

  • Function to project image along helical axis by adding rows of image

project_normal_to_helix([seg])

  • Function to project image perpendicular to helical axis by adding columns of image

setup_fourxtwo([figno])

  • Function to setup 4 x 2 subplot grid for diagnostic output

split_quarters([addpowimgenh])

  • Function to split enhanced power spectrum (EMData object) into lower right quarter

visualize_power_avg_and_width_analysis(…)

  • Function to combine output of width and power spectra analysis into single summary sheet

visualize_widthprofile_and_histogram([…])

  • Function to add width profile to diagnostic output plot

add_smooth_gaussian_falloff_to_edge_of_binary_mask

add_up_power_spectra

add_width_histogram_next_to_width_profile

add_width_profile_from_avg_and_var

bin_image_stack_by_binfactor

collapse_periodograms

compute_avg_and_var_of_width_and_image

compute_power_correlations_with_rings

compute_radial_average_from_line

copy_database_and_filter_segment_ids

correlate_layer_lines_of_average_power_with_individual_segments

enter_correlation_values_in_database

generate_radial_falloff_gradient

generate_rectangular_mask_with_linear_falloffs

generate_series_of_circular_masks_from_radii

generate_two_dee_cosine_falloff

insert_radial_falloff_gradient_into_corners_of_rectangular_mask

insure_mirror_symmetry_of_mask_parameters

limit_width_falloff_to_available_pixels_outside_binary_mask

make_binary_shape_mask

pad_image_to_current_size

resize_mask_to_segment_dimensions

window_image_to_current_sizes

write_avg_periodograms

collapse_periodograms(avg_periodogram, avg_periodogram_enhanced)[source]
write_avg_periodograms(avg_periodogram, power_img, power_enhanced_img)[source]
add_power_spectra_from_verticalized_stack(infilestack, segment_ids, helixwidth=None, masked_infilestack=None, power_infilestack=None, padsize=4)[source]
  • Function to compute sum of in-planed rotated segments

compute_avg_and_var_of_width_and_image(infilestack, temp_rowsadd)[source]
determine_width(infilestack, segsizepix, segment_ids)[source]
  • Function to project width profile of segments

  1. Input: stackfile, segment size (pixel)

  2. Output: width average profile, width variance profile, measured width list

  3. Usage: widthavg, widthvar, widths = determine_width(infilestack, segsizepix)

correlate_layer_lines_of_average_power_with_individual_segments(avg_periodogram, masked_power, segment_ids)[source]
visualize_power_avg_and_width_analysis(widthavg, widthvar, widths, twodavg, twodvar, avg_periodogram, avg_periodogram_enhanced, avg_collapsed_power_line, avg_collapsed_line_enhanced)[source]
  • Function to combine output of width and power spectra analysis into single summary sheet

copy_database_and_filter_segment_ids()[source]
add_up_power_spectra()[source]
segmentexam.main()[source]
class segmentexam_mpi.SegmentExamMpi(parset=None)[source]

Methods

add_power_spectra_from_verticalized_stack(…)

  • Function to compute sum of in-planed rotated segments

apply_binfactor(binfactor, infilestack, …)

  • Function to reduce stack and modify pixelsize according to desired binfactor

cleanup(*files)

  • Function to clean up intermediate image files

collapse_power(addpowimg)

  • Function to project powerspectrum onto 1D plot to determine layer line position

compute_radii_for_fourier_mask(…)

>>> from spring.segment2d.segmentexam import SegmentExam

determine_width(infilestack, segsizepix, …)

  • Function to project width profile of segments

display_average_and_variance([twodavg, twodvar])

  • Function to add average and variance images to diagnostic output plot

display_power_spectra_enhanced_and_collapsed([…])

  • Function to visualize power spectra: sum of power spectra, enhanced sum and their collapsed 1D profile

enhance_power([avg_periodogram, pixelsize])

  • Function to visually enhance power spectrum by compensating for decay of amplitude

find_local_extrema(fits[, target, window])

Function from [SciPy-user] mailing list ‘Finding local minima of greater than a given depth’

generate_falloff_line(segment_size_in_pixel, …)

>>> from spring.segment2d.segmentexam import SegmentExam

generate_local_name_for_reduction(…)

>>> from spring.segment2d.segmentexam_mpi import SegmentExamMpi

make_oneoverres([arr, pixelsize])

  • Function to generate an array of resolution in reciprocal Angstrom

make_smooth_rectangular_mask(hel_width_pix, …)

>>> from spring.segment2d.segmentexam import SegmentExam

measure_peakdist([rowsaddimg, segsizepix, …])

  • Function to measure distance between two symmetrical peaks of 1D helix width projection

project_helix([seg])

  • Function to project image along helical axis by adding rows of image

project_normal_to_helix([seg])

  • Function to project image perpendicular to helical axis by adding columns of image

setup_fourxtwo([figno])

  • Function to setup 4 x 2 subplot grid for diagnostic output

split_quarters([addpowimgenh])

  • Function to split enhanced power spectrum (EMData object) into lower right quarter

visualize_power_avg_and_width_analysis(…)

  • Function to combine output of width and power spectra analysis into single summary sheet

visualize_widthprofile_and_histogram([…])

  • Function to add width profile to diagnostic output plot

add_powers_locally_and_reduce_on_main_node

add_smooth_gaussian_falloff_to_edge_of_binary_mask

add_up_power_spectra

add_width_histogram_next_to_width_profile

add_width_profile_from_avg_and_var

bin_image_stack_by_binfactor

collapse_periodograms

compute_avg_and_var_of_width_and_image

compute_power_correlations_with_rings

compute_radial_average_from_line

copy_database_and_filter_segment_ids

correlate_layer_line_region_mpi

correlate_layer_lines_of_average_power_with_individual_segments

determine_width_from_collapsed_profile_mpi

enter_correlation_values_in_database

generate_radial_falloff_gradient

generate_rectangular_mask_with_linear_falloffs

generate_series_of_circular_masks_from_radii

generate_two_dee_cosine_falloff

insert_radial_falloff_gradient_into_corners_of_rectangular_mask

insure_mirror_symmetry_of_mask_parameters

limit_width_falloff_to_available_pixels_outside_binary_mask

make_binary_shape_mask

pad_image_to_current_size

prepare_segmentexam_mpi

reduce_emdata_from_memory_on_main_node

resize_mask_to_segment_dimensions

visualize_avg_var_widths_and_power_spectra_mpi

window_image_to_current_sizes

write_avg_periodograms

generate_local_name_for_reduction(emdata_file, rank)[source]
>>> from spring.segment2d.segmentexam_mpi import SegmentExamMpi
>>> SegmentExamMpi().generate_local_name_for_reduction('ps_234567891.hdf', 2)
'ps_2345678912.hdf'
reduce_emdata_from_memory_on_main_node(widthavg)[source]
prepare_segmentexam_mpi()[source]
add_powers_locally_and_reduce_on_main_node(segment_ids)[source]
correlate_layer_line_region_mpi(segment_ids, avg_periodogram, power_infilestack)[source]
determine_width_from_collapsed_profile_mpi(segment_ids, masked_infilestack)[source]
visualize_avg_var_widths_and_power_spectra_mpi(avg_periodogram, avg_periodogram_enhanced, avg_collapsed_power_line, avg_collapsed_line_enhanced, common_masked_stack, common_rows)[source]
add_up_power_spectra()[source]
segmentexam_mpi.main()[source]