Commit 2e71208e authored by Josef Brandt's avatar Josef Brandt

Bugfixes

parent 34439505
......@@ -188,15 +188,16 @@ class FakeCamera:
class FakeFilter:
numIndParticles: int = 10 # number of individual particles presets to generate
numBlurSteps: int = 7 # number of blur steps to simulate (additionally to image without any blur)
maxBlurSize: int = 51 # highest blur radius
baseImageSize: int = 100
def __init__(self):
self.numParticles: int = 500
self.xRange: Tuple[float, float] = (-3000, 3000) # min and max of x Dimensions (in µm)
self.yRange: Tuple[float, float] = (-3000, 3000) # min and max of x Dimensions (in µm)
self.particleSizeRange: Tuple[float, float] = (5, 50) # min and max of particle radius (in µm)
self.numIndParticles: int = 10 # number of individual particles presets to generate
self.numBlurSteps: int = 7 # number of blur steps to simulate (additionally to image without any blur)
self.maxBlurSize: int = 51 # highest blur radius
self.baseImageSize: int = 100
self.presetParticles: List[dict] = self._generagePresetParticles()
self.particles: List[FakeParticle] = []
self._generateParticles()
......@@ -254,6 +255,7 @@ class FakeFilter:
newParticleDict[radius] = cv2.GaussianBlur(baseImg, (radius, radius), sigmaX=0)
presetParticles.append(newParticleDict)
return presetParticles
def _generateParticles(self) -> None:
......
......@@ -4,11 +4,15 @@ import json
import numpy as np
from typing import Tuple
from ..ramancom.simulated.simulatedStage import SimulatedStage
from ..ramancom.simulated.imageGenerator import FakeCamera, FakeParticle, OverlapRange, getParticleOverlapRanges
from ..ramancom.simulated.imageGenerator import FakeCamera, FakeFilter, FakeParticle, OverlapRange, getParticleOverlapRanges
class TestSimulatedStage(TestCase):
def setUp(self) -> None:
FakeFilter.numBlurSteps = 1
FakeFilter.numIndParticles = 1
FakeFilter.maxBlurSize = 1
FakeFilter.baseImageSize = 10
self.simulatedStage: SimulatedStage = SimulatedStage(ui=False)
self.simulatedStage.saveConfigToFile()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment