asap.em_montage_qc package

Submodules

asap.em_montage_qc.detect_montage_defects module

class asap.em_montage_qc.detect_montage_defects.DetectMontageDefectsModule(schema_type=None, *args, **kwargs)[source]

Bases: RenderModule

Note

This class takes a ArgSchema as an input to parse inputs , with a default schema of type DetectMontageDefectsParameters

default_output_schema

alias of DetectMontageDefectsParametersOutput

default_schema

alias of DetectMontageDefectsParameters

run()[source]
asap.em_montage_qc.detect_montage_defects.check_status_of_stack(render, stack, zvalues)[source]
asap.em_montage_qc.detect_montage_defects.detect_disconnected_tiles(render, prestitched_stack, poststitched_stack, z, pre_tilespecs=None, post_tilespecs=None)[source]
asap.em_montage_qc.detect_montage_defects.detect_distortion(render, poststitched_stack, zvalue, threshold_cutoff=[0.005, 0.005], pool_size=20)[source]
asap.em_montage_qc.detect_montage_defects.detect_seams(render, stack, match_collection, match_owner, z, residual_threshold=8, distance=60, min_cluster_size=15, tspecs=None)[source]
asap.em_montage_qc.detect_montage_defects.detect_stitching_gaps(render, prestitched_stack, poststitched_stack, z, pre_tilespecs=None, tilespecs=None)[source]
asap.em_montage_qc.detect_montage_defects.detect_stitching_mistakes(render, prestitched_stack, poststitched_stack, match_collection, match_collection_owner, threshold_cutoff, residual_threshold, neighbor_distance, min_cluster_size, zvalues, pool_size=20)[source]
asap.em_montage_qc.detect_montage_defects.get_pre_post_tspecs(render, prestitched_stack, poststitched_stack, z)[source]
asap.em_montage_qc.detect_montage_defects.run_analysis(render, prestitched_stack, poststitched_stack, match_collection, match_collection_owner, residual_threshold, neighbor_distance, min_cluster_size, threshold_cutoff, z)[source]

asap.em_montage_qc.plots module

asap.em_montage_qc.plots.plot_defects(render, stack, out_html_dir, args)[source]
asap.em_montage_qc.plots.plot_residual(xs, ys, residual)[source]
asap.em_montage_qc.plots.plot_section_maps(render, stack, post_tspecs, matches, disconnected_tiles, gap_tiles, seam_centroids, stats, zvalues, out_html_dir=None, pool_size=5)[source]
asap.em_montage_qc.plots.point_match_plot(tilespecsA, matches, tilespecsB=None)[source]

asap.em_montage_qc.schemas module

class asap.em_montage_qc.schemas.DetectDistortionParameters(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]

Bases: RenderParameters, ZValueParameters, ProcessPoolParameters

This schema is designed to be a schema_type for an ArgSchemaParser object

DetectDistortionParameters

key

description

default

field_type

json_type

pool_size

no description

1

Integer

int

minZ

no description

NA

Integer

int

maxZ

no description

NA

Integer

int

z

no description

NA

Integer

int

zValues

no description

NA

List

int

input_json

file path of input json file

NA

InputFile

str

output_json

file path to output json file

NA

OutputFile

str

log_level

set the logging level of the module

ERROR

LogLevel

str

render

parameters to connect to render server

(REQUIRED)

RenderClientParameters

dict

input_stacks

List of input stacks

None

List

str

threshold_cutoff

Threshold for MAD cutoff in x and y

[0.005, 0.005]

List

float

input_stacks
match_collections = argschema.fields.List(

argschema.fields.Str, required=True, description=’List of montage point match collections’)

match_collection_owners = argschema.fields.List(

argschema.fields.Str, required=False, default=None, missing=None, description=’List of the match collection owners’)

opts = <marshmallow.schema.SchemaOpts object>
threshold_cutoff
num_threads = argschema.fields.Int(

required=False, default=20, description=’Number of parallel threads’)

@post_load def add_match_collection_owner(self, data):

if data[‘match_collection_owners’] is None:

data[‘match_collection_owners’] = [data[‘render’][‘owner’]] * len(data[‘match_collections’])

class asap.em_montage_qc.schemas.DetectDistortionParametersOutput(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]

Bases: DefaultSchema

DetectDistortionParametersOutput

key

description

default

field_type

json_type

distorted_sections

List of sections that are distorted

(REQUIRED)

List

int

opts = <marshmallow.schema.SchemaOpts object>
class asap.em_montage_qc.schemas.DetectMontageDefectsParameters(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]

Bases: RenderParameters, ZValueParameters, ProcessPoolParameters

This schema is designed to be a schema_type for an ArgSchemaParser object

DetectMontageDefectsParameters

key

description

default

field_type

json_type

pool_size

no description

1

Integer

int

minZ

no description

NA

Integer

int

maxZ

no description

NA

Integer

int

z

no description

NA

Integer

int

zValues

no description

NA

List

int

input_json

file path of input json file

NA

InputFile

str

output_json

file path to output json file

NA

OutputFile

str

log_level

set the logging level of the module

ERROR

LogLevel

str

render

parameters to connect to render server

(REQUIRED)

RenderClientParameters

dict

prestitched_stack

Pre stitched stack (raw stack)

(REQUIRED)

String

str

poststitched_stack

Stitched montage stack

(REQUIRED)

String

str

match_collection

Name of the montage point match collection

NA

String

str

match_collection_owner

Name of the match collection owner

None

String

str

residual_threshold

threshold value to filter residuals for detecting seams (default = 4)

4

Integer

int

neighbors_distance

distance in pixels to look for neighboring points in seam detection (default = 60)

80

Integer

int

min_cluster_size

minimum number of point matches required in each cluster for taking it into account for seam detection (default = 7)

12

Integer

int

threshold_cutoff

Threshold for MAD cutoff in x and y

[0.005, 0.005]

List

float

plot_sections

Do you want to plot the sections with defects (holes or gaps)?. Will plot Bokeh plots in a html file

True

Boolean

bool

out_html_dir

Folder to save the Bokeh plot defaults to /tmp directory

None

InputDir

str

add_match_collection_owner(data)[source]
opts = <marshmallow.schema.SchemaOpts object>
class asap.em_montage_qc.schemas.DetectMontageDefectsParametersOutput(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]

Bases: DefaultSchema

DetectMontageDefectsParametersOutput

key

description

default

field_type

json_type

output_html

Output html file with Bokeh plots showing holes and stitching gaps

None

List

str

qc_passed_sections

List of sections that passed QC

(REQUIRED)

List

int

hole_sections

List of z values which failed QC and has holes

(REQUIRED)

List

int

gap_sections

List of z values which have stitching gaps

(REQUIRED)

List

int

seam_sections

List of z values which have seams detected

(REQUIRED)

List

int

seam_centroids

An array of (x,y) positions of seams for each section with seams

(REQUIRED)

NumpyArray

?

distorted_sections

List of sections that are distorted

(REQUIRED)

List

int

opts = <marshmallow.schema.SchemaOpts object>
class asap.em_montage_qc.schemas.RoughQCOutputSchema(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]

Bases: DefaultSchema

RoughQCOutputSchema

key

description

default

field_type

json_type

iou_plot

Pdf/html file showing IOU plots

(REQUIRED)

OutputFile

str

distortion_plot

Pdf/html file with distortion plots

(REQUIRED)

OutputFile

str

opts = <marshmallow.schema.SchemaOpts object>
class asap.em_montage_qc.schemas.RoughQCSchema(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]

Bases: RenderParameters

This schema is designed to be a schema_type for an ArgSchemaParser object

RoughQCSchema

key

description

default

field_type

json_type

input_json

file path of input json file

NA

InputFile

str

output_json

file path to output json file

NA

OutputFile

str

log_level

set the logging level of the module

ERROR

LogLevel

str

render

parameters to connect to render server

(REQUIRED)

RenderClientParameters

dict

input_downsampled_stack

Pre rough aligned downsampled stack

(REQUIRED)

String

str

output_downsampled_stack

Rough aligned stack name

(REQUIRED)

String

str

minZ

min z

(REQUIRED)

Integer

int

maxZ

max z

(REQUIRED)

Integer

int

pool_size

Pool size

10

Integer

int

output_dir

temp filename to save fig

None

OutputDir

str

out_file_format

Do you want the output to be bokeh plots in html (option = ‘html’) or pdf files for plots (option = ‘pdf’, default)

pdf

String

str

opts = <marshmallow.schema.SchemaOpts object>

Module contents