asap.rough_align package
Submodules
asap.rough_align.apply_rough_alignment_to_montages module
- exception asap.rough_align.apply_rough_alignment_to_montages.ApplyRoughAlignmentException[source]
Bases:
RenderModuleException
Something is wrong in ApplyRough….
- class asap.rough_align.apply_rough_alignment_to_montages.ApplyRoughAlignmentTransform(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
ApplyRoughAlignmentTransformParameters
- default_output_schema
alias of
ApplyRoughAlignmentOutputParameters
- default_schema
- asap.rough_align.apply_rough_alignment_to_montages.add_masks_to_lowres(render, stack, z, mask_map)[source]
- asap.rough_align.apply_rough_alignment_to_montages.apply_rough_alignment(render, input_stack, prealigned_stack, lowres_stack, output_stack, output_dir, scale, mask_input_dir, update_lowres_with_masks, read_masks_from_lowres_stack, filter_montage_output_with_masks, mask_exts, Z, apply_scale=False, consolidateTransforms=True, remap_section_ids=False)[source]
- asap.rough_align.apply_rough_alignment_to_montages.filter_highres_with_masks(resolved_highres, tspec_lowres, mask_map)[source]
- function to return a filtered list of tilespecs from a
ResolvedTiles object, based on a lowres mask
- Parameters
resolved_highres (renderapi.resolvedtiles.ResolvedTiles object) – tilespecs and transforms from a single section
tspec_lowres (renderapi.tilespec.TileSpec object) – tilespec from a downsampled stack
mask_map (dict) – keys should match lowres tileids, values are mask file URI
- Returns
new_highres – which highres specs are fully contained within the boundary of mask=255
- Return type
List of renderapi.tilespec.TileSpec objects
asap.rough_align.do_rough_alignment module
asap.rough_align.schemas module
- class asap.rough_align.schemas.ApplyRoughAlignmentOutputParameters(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
Bases:
DefaultSchema
key
description
default
field_type
json_type
zs
list of z values that were applied to
NA
?
output_stack
stack where applied transforms were set
NA
str
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.ApplyRoughAlignmentTransformParameters(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
key
description
default
field_type
json_type
input_json
file path of input json file
NA
str
output_json
file path to output json file
NA
str
log_level
set the logging level of the module
ERROR
str
render
parameters to connect to render server
(REQUIRED)
dict
montage_stack
stack to make a downsample version of
(REQUIRED)
str
prealigned_stack
stack with dropped tiles corrected for stitching errors
None
str
lowres_stack
montage scape stack with rough aligned transform
(REQUIRED)
str
output_stack
output high resolution rough aligned stack
(REQUIRED)
str
tilespec_directory
path to save section images
(REQUIRED)
str
map_z
map the montage Z indices to the rough alignment indices (default - False)
False
bool
remap_section_ids
map section ids as well with the new z mapping. Default = False
False
bool
consolidate_transforms
should the transforms be consolidated? (default - True)
True
bool
scale
scale of montage scapes
(REQUIRED)
float
apply_scale
do you want to apply scale
False
bool
pool_size
pool size for parallel processing
10
int
new_z
List of new z values to be mapped to
None
int
old_z
List of z values to apply rough alignment to
(REQUIRED)
int
mask_input_dir
directory containing mask files. basenames of masks that match tileIds in the rough stack will be handled.
None
str
read_masks_from_lowres_stack
masks will be taken from lowres tilespecs. any mask_input_dir ignored.
False
bool
update_lowres_with_masks
should the masks be added to the rough stack?
False
bool
filter_montage_output_with_masks
should the tiles written be filtered by the masks?
False
bool
mask_exts
what kind of mask files to recognize
[‘png’, ‘tif’]
str
close_stack
whether to set output stack to COMPLETE
True
bool
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.DownsampleMaskHandlerSchema(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
key
description
default
field_type
json_type
input_json
file path of input json file
NA
str
output_json
file path to output json file
NA
str
log_level
set the logging level of the module
ERROR
str
render
parameters to connect to render server
(REQUIRED)
dict
stack
stack that is read and modified with masks
(REQUIRED)
str
close_stack
set COMPLETE or not
True
bool
mask_dir
directory containing masks, named <z>_*.png where<z> is a z value in input_stack and may be specifiedin z_apply
None
str
collection
name of collection to be filtered by mask, or resetcan be None for no operation
None
str
zMask
z values for which the masks will be set
None
int
zReset
z values for which the masks will be reset
None
int
mask_exts
what kind of mask files to recognize
[‘png’, ‘tif’]
str
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.LowresStackParameters(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
Bases:
DefaultSchema
key
description
default
field_type
json_type
stack
Input downsample images section stack
(REQUIRED)
str
owner
Owner of the input lowres stack
None
str
project
Project of the input lowres stack
None
str
service_host
Service host for the input stack Render service
None
str
baseURL
Base URL of the Render service for the source stack
None
str
renderbinPath
Client scripts location
None
str
verbose
Want the output to be verbose?
0
int
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.MakeAnchorStackSchema(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
Bases:
StackTransitionParameters
This schema is designed to be a schema_type for an ArgSchemaParser object
key
description
default
field_type
json_type
pool_size
no description
1
int
minZ
no description
NA
int
maxZ
no description
NA
int
z
no description
NA
int
zValues
not used in this module, keeps parents happy
[1000]
int
input_json
file path of input json file
NA
str
output_json
file path to output json file
NA
str
log_level
set the logging level of the module
ERROR
str
render
parameters to connect to render server
(REQUIRED)
dict
input_stack
no description
(REQUIRED)
str
output_stack
no description
(REQUIRED)
str
close_stack
no description
False
bool
overwrite_zlayer
no description
False
bool
output_stackVersion
no description
NA
dict
transform_xml
xml transforms from trakemimages from which these are madeare assumed to be named <z>_*.png
NA
str
transform_json
Human generated list of transforms.or, json scraped from xmlKeys are of form <z>_*.png where z matches a tilespec in input_stack and values are AffineModel transform jsonswill override xml input.
None
str
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.OutputLowresStackParameters(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
Bases:
DefaultSchema
key
description
default
field_type
json_type
stack
Input downsample images section stack
(REQUIRED)
str
owner
Owner of the input lowres stack
None
str
project
Project of the input lowres stack
None
str
service_host
Service host for the input stack Render service
None
str
baseURL
Base URL of the Render service for the source stack
None
str
renderbinPath
Client scripts location
None
str
verbose
Want the output to be verbose?
0
int
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.PairwiseRigidOutputSchema(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
Bases:
DefaultSchema
key
description
default
field_type
json_type
minZ
minimum z value in output stack
(REQUIRED)
int
maxZ
minimum z value in output stack
(REQUIRED)
int
output_stack
name of output stack
(REQUIRED)
str
missing
list of z values missing in z range of output stack
(REQUIRED)
int
masked
list of z values masked in z range of output stack
(REQUIRED)
int
residuals
pairwise residuals in output stack
(REQUIRED)
?
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.PairwiseRigidSchema(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
Bases:
StackTransitionParameters
This schema is designed to be a schema_type for an ArgSchemaParser object
key
description
default
field_type
json_type
pool_size
no description
1
int
minZ
no description
NA
int
maxZ
no description
NA
int
z
no description
NA
int
zValues
no description
NA
int
input_json
file path of input json file
NA
str
output_json
file path to output json file
NA
str
log_level
set the logging level of the module
ERROR
str
render
parameters to connect to render server
(REQUIRED)
dict
input_stack
no description
(REQUIRED)
str
output_stack
no description
(REQUIRED)
str
close_stack
no description
False
bool
overwrite_zlayer
no description
False
bool
output_stackVersion
no description
NA
dict
match_collection
Point match collection name
(REQUIRED)
str
gap_file
json file {k: v} where int(k) is a z value to skipentries in here that are not already missing willbe omitted from the output stacki.e. this is a place one can skip sections
None
str
translate_to_positive
translate output stack to positive space
True
bool
translation_buffer
minimum (x, y) of output stack if translate_to_positive=True
[0, 0]
float
anchor_stack
fix transforms using tiles in this stack
None
str
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.rough_align.schemas.PointMatchCollectionParameters(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
Bases:
DefaultSchema
key
description
default
field_type
json_type
owner
Point match collection owner (defaults to render owner
None
str
match_collection
Point match collection name
(REQUIRED)
str
server
baseURL of the Render service holding the point match collection
None
str
verbose
Verbose output flag
0
int
- opts = <marshmallow.schema.SchemaOpts object>