From 1a02a9c40dfc8db7b2a1f70d432959176b87ef75 Mon Sep 17 00:00:00 2001 From: Martin Genet <martin.genet@polytechnique.edu> Date: Tue, 4 Jun 2019 18:10:47 +0200 Subject: [PATCH] Box structure now works in any dimension --- generate_images_Image.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/generate_images_Image.py b/generate_images_Image.py index 6907186..7606c6e 100644 --- a/generate_images_Image.py +++ b/generate_images_Image.py @@ -24,7 +24,13 @@ import dolfin_dic as ddic class Image(): - def __init__(self, images, structure, texture, noise, generate_image_gradient=False): + def __init__( + self, + images, + structure, + texture, + noise, + generate_image_gradient=False): self.L = images["L"] @@ -33,8 +39,8 @@ class Image(): self.I0_structure = self.I0_structure_no_wGrad if (generate_image_gradient) else self.I0_structure_no elif (structure["type"] == "box"): self.I0_structure = self.I0_structure_box_wGrad if (generate_image_gradient) else self.I0_structure_box - self.Xmin = structure["Xmin"] - self.Xmax = structure["Xmax"] + self.Xmin = structure["Xmin"]+[float("-Inf")]*(3-images["n_dim"]) + self.Xmax = structure["Xmax"]+[float("+Inf")]*(3-images["n_dim"]) elif (structure["type"] == "heart"): if (images["n_dim"] == 2): self.I0_structure = self.I0_structure_heart_2_wGrad if (generate_image_gradient) else self.I0_structure_heart_2 -- GitLab