Skip to content

Commit

Permalink
Cleaned up / fixed CLE image reading
Browse files Browse the repository at this point in the history
  • Loading branch information
maubreville committed Nov 20, 2024
1 parent ed9957b commit 8b0f5b2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions exact/exact/images/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,8 @@ def save_file(self, path:Path):
os.chmod(str(folder_path), 0o777)
self.save() # initially save
for frame_id in range(self.frames):
height, width = reader.dimensions
np_image = np.array(reader.read_region(location=(0,0), size=(reader.dimensions), level=0, frame=frame_id))[:,:,0]
linear = np_image.reshape(height * width * self.channels)
vi = pyvips.Image.new_from_memory(np.ascontiguousarray(linear.data), height, width, self.channels, 'uchar')

target_file = folder_path / "{}_{}_{}".format(1, frame_id + 1, path.name) #z-axis frame image
vi.tiffsave(str(target_file), tile=True, compression='lzw', bigtiff=True, pyramid=True, tile_width=256, tile_height=256)
target_file = folder_path / path.name

# save FrameDescription object for each frame
FrameDescription.objects.create(
Expand Down

0 comments on commit 8b0f5b2

Please sign in to comment.