def get_ground_image(self): self.ground_image = Image3D.load(self.project, key='ground') if not self.ground_image: self.ground_image = self.cp.image2plane_v2(reducing=self.reducing, plane=self.ground_plane, lines=self.ground, key='ground', max_size=PROJECTION_SIZE)
def get_walls_images(self): self.walls_images = [] for num, wall in enumerate(self.walls): img = Image3D.load(self.project, key='wall' + str(num)) if not img: img = self.cp.image2plane_v2(reducing=self.reducing, plane=self.walls_planes[num], key='wall' + str(num), lines=wall, max_size=PROJECTION_SIZE) self.walls_images.append(img)
def read(self, nz, nx, ny): print('.read file %s with dim %dx%dx%d' % (self.file_name, nz, nx, ny)) with open(self.file_name, mode='rb') as file: bytes_data = file.read() array_data = np.frombuffer(bytes_data, dtype='b', count=bytes_data.__len__()) if bytes_data.__len__() == nx * nz * ny: return Image3D(np.reshape(array_data, (nz, nx, ny))) return None