als.model package¶
Submodules¶
als.model.base module¶
Provide base application data types
-
class
als.model.base.
Image
(data)[source]¶ Bases:
object
Represents an image, our basic processing object.
Image data is a numpy array. Array’s data type is unspecified for now but we’d surely benefit from enforcing one (float32 for example) as it will ease the development of any later processing code
We also store the bayer pattern the image was shot with, if applicable.
If image is from a sensor without a bayer array, the bayer pattern must be None.
-
property
bayer_pattern
¶ Retrieves the bayer pattern the image was shot with, if applicable.
- Returns
the bayer pattern or None
- Return type
-
property
data
¶ Retrieves image data
- Returns
image data
- Return type
-
property
dimensions
¶ Retrieves image dimensions as a tuple.
This is basically the underlying array’s shape tuple, minus the color axis if image is color
- Returns
the image dimensions
- Return type
-
is_bw
()[source]¶ Tells if image is black and white
- Returns
True if no color info is stored in data array, False otherwise
- Return type
-
is_color
()[source]¶ Tells if the image has color information
image has color information if its data array has more than 2 dimensions
- Returns
True if the image has color information, False otherwise
- Return type
-
needs_debayering
()[source]¶ Tells if image needs debayering
- Returns
True if a bayer pattern is known and data does not have 3 dimensions
-
property
origin
¶ retrieves info on image origin.
If Image has been read from a disk file, origin contains the file path
- Returns
origin representation
- Return type
-
property
-
class
als.model.base.
Session
(status: int = 0)[source]¶ Bases:
PyQt5.QtCore.QObject
Represents an ALS session
-
property
is_paused
¶ Is session paused ?
- Returns
True if session is paused, False otherwise
- Return type
-
property
is_running
¶ Is session running ?
- Returns
True if session is running, False otherwise
- Return type
-
property
is_stopped
¶ Is session stopped ?
- Returns
True if session is stopped, False otherwise
- Return type
-
paused
= 2¶
-
running
= 1¶
-
status_changed_signal
¶ Qt signal to emit when status changes
-
stopped
= 0¶
-
property
als.model.data module¶
Provides base application data
-
class
als.model.data.
DynamicData
[source]¶ Bases:
object
Holds and maintain application dynamic data and notify observers on significant changes
-
class
als.model.data.
HistogramContainer
[source]¶ Bases:
object
Holds histogram data for an image (color or b&w)
also holds the global maximum among all held histograms and a way to get the number of bins
-
add_histogram
(histogram: numpy.ndarray)[source]¶ Add an histogram
- Parameters
histogram (numpy.ndarray) – the histogram to add
- Returns
-
property
bin_count
¶ Get the bin count, that is the length of any stored histogram. We check the first one if exists
- Returns
the number of bins used to compute the stored histograms.
- Return type
-
get_histograms
() → List[numpy.ndarray][source]¶ Gets the histograms
- Returns
the histograms
- Return type
List[numpy.ndarray]
-
als.model.params module¶
Holds types used for processing parameters
-
class
als.model.params.
ListParameter
(name: str, description: str, default: Any, choices: list)[source]¶ Bases:
als.model.params.ProcessingParameter
represents a list of choices of type text
-
class
als.model.params.
ProcessingParameter
(name: str, description: str, default: Any)[source]¶ Bases:
object
Base class for all processing parameters
-
class
als.model.params.
RangeParameter
(name: str, description: str, default: Any, minimum: int, maximum: int)[source]¶ Bases:
als.model.params.ProcessingParameter
Represents a parameter of type range
-
class
als.model.params.
SwitchParameter
(name: str, description: str, default: Any)[source]¶ Bases:
als.model.params.ProcessingParameter
Represents an ON / OFF switch
Module contents¶
Provides all needed application types