asap.intensity_correction package
Submodules
asap.intensity_correction.apply_multiplicative_correction module
- class asap.intensity_correction.apply_multiplicative_correction.MultIntensityCorr(schema_type=None, *args, **kwargs)[source]
Bases:
StackTransitionModule
Note
This class takes a ArgSchema as an input to parse inputs , with a default schema of type
MultIntensityCorrParams
- default_schema
alias of
MultIntensityCorrParams
- asap.intensity_correction.apply_multiplicative_correction.getImage(ts, channel=None)[source]
Simple function to get the level 0 image of this tilespec as a numpy array
- Parameters
ts (renderapi.tilespec.TileSpec) – tilespec to get images from (presently assumes this is a tiff image whose URL can be read with tifffile)
channel (str) – channel name to get image of, default=None which will default to the non channel image pyramid
- Returns
2d numpy array of this image
- Return type
numpy.array
- asap.intensity_correction.apply_multiplicative_correction.intensity_corr(img, ff, clip, scale_factor, clip_min, clip_max)[source]
utility function to correct an image with a flatfield correction will take img and return img_out = img * max(ff) / (ff + .0001) converted back to the original type of img
- Parameters
img (numpy.array) – N,M array to correct, could be any type
ff (numpy.array) – N,M array of flatfield correction, could be of any type
- Returns
N,M numpy array of the same type as img but now corrected
- Return type
numpy.array
- asap.intensity_correction.apply_multiplicative_correction.process_tile(C, dirout, stackname, clip, scale_factor, clip_min, clip_max, input_ts, corr_dict=None)[source]
function to correct each tile in the input_ts with the matrix C, and potentially move the original tiles to a new location.abs
- Parameters
C (numpy.array) – a 2d numpy array of uint16 or uint8 that represents the correction to apply
corr_dict (dict or None) – a dictionary with keys of strings of channel names and values of corrections (as with C). If None, C will be applied to each channel, if they exist.
dirout (str) – the path to the directory to save all corrected images
input_ts (renderapi.tilespec.TileSpec) – the tilespec with the tiles to be corrected
asap.intensity_correction.calculate_multiplicative_correction module
- class asap.intensity_correction.calculate_multiplicative_correction.MakeMedian(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
MakeMedianParams
- default_schema
alias of
MakeMedianParams
- asap.intensity_correction.calculate_multiplicative_correction.getImageFromTilespecs(alltilespecs, index, channel=None)[source]
asap.intensity_correction.schemas module
- class asap.intensity_correction.schemas.MakeMedianParams(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
file_prefix
File prefix for median image file that is saved
Median
str
output_directory
Output Directory for saving median image
(REQUIRED)
str
num_images
Number of images to randomly subsample to generate median
-1
int
- opts = <marshmallow.schema.SchemaOpts object>
- class asap.intensity_correction.schemas.MultIntensityCorrParams(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
correction_stack
Correction stack (usually median stack for AT data)
(REQUIRED)
str
output_directory
Directory for storing Images
(REQUIRED)
str
cycle_number
what cycleNumber to upload for output_stack on render
2
int
cycle_step_number
what cycleStepNumber to upload for output_stack on render
1
int
clip
whether to clip values
True
bool
scale_factor
scaling value
1.0
float
clip_min
Min Clip value
0
int
clip_max
Max Clip value
65535
int
- opts = <marshmallow.schema.SchemaOpts object>