From fe895af0f89cc64c4cf9fcf74047d133807d0788 Mon Sep 17 00:00:00 2001 From: Martin Salinas Date: Thu, 14 Mar 2024 10:49:29 +0100 Subject: [PATCH] Substitution for np random rng --- xmipptomo/protocols/protocol_phantom_subtomo.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/xmipptomo/protocols/protocol_phantom_subtomo.py b/xmipptomo/protocols/protocol_phantom_subtomo.py index ce4eab7..0323525 100644 --- a/xmipptomo/protocols/protocol_phantom_subtomo.py +++ b/xmipptomo/protocols/protocol_phantom_subtomo.py @@ -304,9 +304,6 @@ def applyRandomOrientation(self, fnIn, fnOut): shiftX = rng.integers(self.xmin.get(), self.xmax.get()) shiftY = rng.integers(self.ymin.get(), self.ymax.get()) shiftZ = rng.integers(self.zmin.get(), self.zmax.get()) - #shiftX = np.random.randint(self.xmin.get(), self.xmax.get()) - #shiftY = np.random.randint(self.ymin.get(), self.ymax.get()) - #shiftZ = np.random.randint(self.zmin.get(), self.zmax.get()) self.runJob("xmipp_transform_geometry", @@ -418,9 +415,10 @@ def _addCoordinate(self, subtomo, tomo): coor = Coordinate3D() coor.setVolume(tomo) tomoDim = tomo.getDim() - coor.setX(np.random.randint(0, tomoDim[0]), const.BOTTOM_LEFT_CORNER) - coor.setY(np.random.randint(0, tomoDim[1]), const.BOTTOM_LEFT_CORNER) - coor.setZ(np.random.randint(0, tomoDim[2]), const.BOTTOM_LEFT_CORNER) + rng = np.random.default_rng() + coor.setX(rng.integers(tomoDim[0]), const.BOTTOM_LEFT_CORNER) + coor.setY(rng.integers(tomoDim[1]), const.BOTTOM_LEFT_CORNER) + coor.setZ(rng.integers(tomoDim[2]), const.BOTTOM_LEFT_CORNER) self.coordsSet.append(coor) self.coordsSet.setBoxSize(subtomo.getDim()[0])