Skip to content

Commit

Permalink
fuse: always use zlib compression when creating tiffs
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzamuto committed Oct 8, 2021
1 parent ad41b25 commit f9e8136
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
11 changes: 1 addition & 10 deletions zetastitcher/fuse/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ def parse_args():

group.add_argument('--ch', type=int, dest='channel', help='channel')

group.add_argument('-c', type=str, default=0, dest='compression',
choices=[str(i) for i in range(10)] + ['lzma'],
help='compression')
group.add_argument('--downsample-xy', metavar='S', type=int, required=False,
help='downsample XY plane by factor S')

Expand Down Expand Up @@ -161,11 +158,6 @@ def preprocess_and_check_args(args):
elif args.nz is not None:
args.zmax = args.zmin + args.nz

try:
args.compression = int(args.compression)
except ValueError:
pass


def compute_absolute_positions(args, fm):
xcorr_fm = XcorrFileMatrix.from_yaml(fm.input_path)
Expand Down Expand Up @@ -247,8 +239,7 @@ def main():
logger.info(f'fused shape, whole volume: {fr.output_shape}, {bytes_human}')
if args.output_filename is not None:

keys = ['zmin', 'zmax', 'output_filename', 'debug', 'channel',
'compression', 'downsample_xy']
keys = ['zmin', 'zmax', 'output_filename', 'debug', 'channel', 'downsample_xy']

for k in keys:
setattr(fr, k, getattr(args, k))
Expand Down
3 changes: 1 addition & 2 deletions zetastitcher/fuse/fuse_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def run(self):
fused = np.moveaxis(fused, -3, -1)

logger.info('saving output to {}'.format(self.output_filename))
tiff.imwrite(self.output_filename, fused, append=True,
bigtiff=bigtiff, compress=self.compression)
tiff.imwrite(self.output_filename, fused, append=True, bigtiff=bigtiff, compression='zlib')

self.zmin += thickness

0 comments on commit f9e8136

Please sign in to comment.