constitch.stage_model
index
/home/nicho/starcall-docs/constitch/stage_model.py

 
Modules
       
constitch.alignment
collections
dataclasses
math
numpy
matplotlib.pyplot
sklearn

 
Classes
       
constitch.alignment.Aligner(builtins.object)
StageModelAligner
sklearn.base.BaseEstimator(builtins.object)
ConversionStageModel
GlobalStageModel
SimpleOffsetModel

 
class ConversionStageModel(sklearn.base.BaseEstimator)
    ConversionStageModel(model=None)
 

 
 
Method resolution order:
ConversionStageModel
sklearn.base.BaseEstimator
builtins.object

Methods defined here:
__init__(self, model=None)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).
__str__(self)
Return str(self).
conversion_func(self, poses1, poses2)
fit(self, X, y)
fit_predict(self, X, y)
predict(self, X)
score(self, X, y)
split_X(self, X)

Methods inherited from sklearn.base.BaseEstimator:
__getstate__(self)
__setstate__(self, state)
get_params(self, deep=True)
Get parameters for this estimator.
 
Parameters
----------
deep : bool, default=True
    If True, will return the parameters for this estimator and
    contained subobjects that are estimators.
 
Returns
-------
params : dict
    Parameter names mapped to their values.
set_params(self, **params)
Set the parameters of this estimator.
 
The method works on simple estimators as well as on nested objects
(such as :class:`~sklearn.pipeline.Pipeline`). The latter have
parameters of the form ``<component>__<parameter>`` so that it's
possible to update each component of a nested object.
 
Parameters
----------
**params : dict
    Estimator parameters.
 
Returns
-------
self : estimator instance
    Estimator instance.

Data descriptors inherited from sklearn.base.BaseEstimator:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class GlobalStageModel(ConversionStageModel)
    GlobalStageModel(model=None)
 
Stage model that takes into account the global positions of the
two images, by passing both image positions to the model unchanged.
 
This is equivalent to just using the internal model directly, this is
just a separate class for documentation and consistency.
 
 
Method resolution order:
GlobalStageModel
ConversionStageModel
sklearn.base.BaseEstimator
builtins.object

Methods defined here:
__init__(self, model=None)
Initialize self.  See help(type(self)) for accurate signature.
conversion_func(self, poses1, poses2)

Methods inherited from ConversionStageModel:
__repr__(self)
Return repr(self).
__str__(self)
Return str(self).
fit(self, X, y)
fit_predict(self, X, y)
predict(self, X)
score(self, X, y)
split_X(self, X)

Methods inherited from sklearn.base.BaseEstimator:
__getstate__(self)
__setstate__(self, state)
get_params(self, deep=True)
Get parameters for this estimator.
 
Parameters
----------
deep : bool, default=True
    If True, will return the parameters for this estimator and
    contained subobjects that are estimators.
 
Returns
-------
params : dict
    Parameter names mapped to their values.
set_params(self, **params)
Set the parameters of this estimator.
 
The method works on simple estimators as well as on nested objects
(such as :class:`~sklearn.pipeline.Pipeline`). The latter have
parameters of the form ``<component>__<parameter>`` so that it's
possible to update each component of a nested object.
 
Parameters
----------
**params : dict
    Estimator parameters.
 
Returns
-------
self : estimator instance
    Estimator instance.

Data descriptors inherited from sklearn.base.BaseEstimator:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class SimpleOffsetModel(ConversionStageModel)
    SimpleOffsetModel(model=None)
 
Simple stage model that calculates the offsets of the two
images and gives them to the internal model (default LinearRegression)
for estimation.
 
This model is the most simple, it only considers the relative positions of
the two images
 
 
Method resolution order:
SimpleOffsetModel
ConversionStageModel
sklearn.base.BaseEstimator
builtins.object

Methods defined here:
conversion_func(self, poses1, poses2)

Methods inherited from ConversionStageModel:
__init__(self, model=None)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).
__str__(self)
Return str(self).
fit(self, X, y)
fit_predict(self, X, y)
predict(self, X)
score(self, X, y)
split_X(self, X)

Methods inherited from sklearn.base.BaseEstimator:
__getstate__(self)
__setstate__(self, state)
get_params(self, deep=True)
Get parameters for this estimator.
 
Parameters
----------
deep : bool, default=True
    If True, will return the parameters for this estimator and
    contained subobjects that are estimators.
 
Returns
-------
params : dict
    Parameter names mapped to their values.
set_params(self, **params)
Set the parameters of this estimator.
 
The method works on simple estimators as well as on nested objects
(such as :class:`~sklearn.pipeline.Pipeline`). The latter have
parameters of the form ``<component>__<parameter>`` so that it's
possible to update each component of a nested object.
 
Parameters
----------
**params : dict
    Estimator parameters.
 
Returns
-------
self : estimator instance
    Estimator instance.

Data descriptors inherited from sklearn.base.BaseEstimator:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class StageModelAligner(constitch.alignment.Aligner)
    StageModelAligner(model, error=15, score=0.2)
 

 
 
Method resolution order:
StageModelAligner
constitch.alignment.Aligner
builtins.object

Methods defined here:
__init__(self, model, error=15, score=0.2)
Initialize self.  See help(type(self)) for accurate signature.
align(self, constraint, precalc1=None, precalc2=None)
Performs the alignment of two images, finding the pixel offset that best aligns the
two images. The offset should be from image1 to image2. The return value should be a Constraint
object, with at least the dx, dy fields filled in to represent the offset of image2 needed
to align the two images. If the function finds the images don't overlap, None should be returned.
If a constraint is specified, this method should only return a constraint that fits within the error
of given constraint, meaning within constraint.error pixels from the (constraint.dx, constraint.dy)
offset.

Methods inherited from constitch.alignment.Aligner:
precalculate(self, image, box)
Performs an arbitrary precalculation step specific to the alignment algorithm.
This would be a step in the algorithm that only has to be run once per image,
and can be cached for each calculation done with the same image. The result of
this function will be passed to the align function as the precalc1 or precalc2 argument
precalculate_if_needed(self, constraint, precalc1, precalc2)
resize_if_needed(self, image, box=None, downscale_factor=None, padding=None)
# Helper functions for subclasses:

Data descriptors inherited from constitch.alignment.Aligner:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)