nm_model
Noise models config.
Array = Annotated[Union[np.ndarray, torch.Tensor], PlainSerializer(_array_to_json, return_type=str), PlainValidator(_to_numpy)]
module-attribute
#
Annotated array type, used to serialize arrays or tensors to JSON strings and deserialize them back to arrays.
GaussianMixtureNMConfig
#
Bases: BaseModel
Gaussian mixture noise model.
Source code in src/careamics/config/nm_model.py
max_signal = Field(default=1.0, ge=0.0)
class-attribute
instance-attribute
#
Maximum signal intensity expected in the image.
min_sigma = Field(default=200.0, ge=0.0)
class-attribute
instance-attribute
#
Minimum value of standard deviation
allowed in the GMM. All values of standard deviation
below this are clamped to this value.
min_signal = Field(default=0.0, ge=0.0)
class-attribute
instance-attribute
#
Minimum signal intensity expected in the image.
n_coeff = Field(default=2, ge=2)
class-attribute
instance-attribute
#
Number of coefficients to describe the functional relationship between gaussian parameters and the signal. 2 implies a linear relationship, 3 implies a quadratic relationship and so on.
n_gaussian = Field(default=1, ge=1)
class-attribute
instance-attribute
#
Number of gaussians used for the GMM.
observation = Field(default=None, exclude=True)
class-attribute
instance-attribute
#
Path to the file containing observation or respective numpy array.
path = None
class-attribute
instance-attribute
#
Path to the directory where the trained noise model (*.npz) is saved in the train
method.
signal = Field(default=None, exclude=True)
class-attribute
instance-attribute
#
Path to the file containing signal or respective numpy array.
tol = Field(default=1e-10)
class-attribute
instance-attribute
#
Tolerance used in the computation of the noise model likelihood.
weight = None
class-attribute
instance-attribute
#
A [3*n_gaussian, n_coeff] sized array containing the values of the weights describing the GMM noise model, with each row corresponding to one parameter of each gaussian, namely [mean, standard deviation and weight]. Specifically, rows are organized as follows: - first n_gaussian rows correspond to the means - next n_gaussian rows correspond to the weights - last n_gaussian rows correspond to the standard deviations If weight=None
, the weight array is initialized using the min_signal
and max_signal
parameters.
MultiChannelNMConfig
#
Bases: BaseModel
Noise Model config aggregating noise models for single output channels.
Source code in src/careamics/config/nm_model.py
noise_models
instance-attribute
#
List of noise models, one for each target channel.