Skip to content

N2V Manipulation

Source

N2V manipulation configuration.

N2VManipulateConfig

Bases: BaseModel

Configuration of the N2V manipulation transform.

Attributes:

masked_pixel_percentage = Field(default=0.2, ge=0.05, le=10.0) class-attribute instance-attribute

Percentage of masked pixels per image.

roi_size = Field(default=11, ge=3, le=21) class-attribute instance-attribute

Size of the region where the pixel manipulation is applied.

seed = Field(default_factory=generate_random_seed, gt=0) class-attribute instance-attribute

Random seed for reproducibility. If not specified, a random seed is generated.

strategy = Field(default='uniform') class-attribute instance-attribute

Strategy for pixel value replacement.

struct_mask_axis = Field(default='none') class-attribute instance-attribute

Orientation of the structN2V mask. Set to "none" to not apply StructN2V.

struct_mask_span = Field(default=5, ge=3, le=15) class-attribute instance-attribute

Size of the structN2V mask.

model_dump(**kwargs)

Return the model as a dictionary.

Parameters:

  • **kwargs

    Pydantic BaseMode model_dump method keyword arguments.

Returns:

  • {str: Any}

    Dictionary representation of the model.

odd_value(v) classmethod

Validate that the value is odd.

Parameters:

  • v (int) –

    Value to validate.

Returns:

  • int

    The validated value.

Raises: