-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using zopfli for compression #90
Comments
I have updated the code to allow you to adjust the gz compression level using the command line parameters -1..-9. This works for both the external pigz parallel compressor as well as the built-in single-threaded compressor. You can even use the Spinal-Tap inspired "-11" function for pigz which provides a tiny bit more compression at the expense of a tremendous amount of processing time. For example, on my computer the default setting compressed an image to 47.8% of its original size while the extreme setting was able to reduce it to 44.6% of its original size, but the extreme version took 376 times longer. For my sample image, the extreme pigz actually outperformed zopfli, which compressed the file to 45.1% of its original size. Further, the single-threaded zopfli execution took 611 times longer than the default pigz setting (requiring over 3 minutes to compress a 1mm isotropic T1 scan). Personally, I think these extreme compression options make sense if you are compressing a file once that will be downloaded with limited bandwidth thousands or millions of times. However, they do not seem practical for the typical use cases of dcm2niix. If you want, you are free to submit a pull-request to execute an external copy of zopfli - you can use the current code which executes an external copy of pigz as a template. Alternatively, you could write a simple script in a language of your choice (shell, python, etc) that would have dcm2niix generate uncompressed nii images and call zopfli to compress them. |
Wow - this is very slow! Thanks for looking into this!
…On Sat, Mar 18, 2017 at 11:06 AM, Chris Rorden ***@***.***> wrote:
I have updated the code to allow you to adjust the gz compression level
using the command line parameters -1..-9. This works for both the external
pigz parallel compressor as well as the built-in single-threaded
compressor. You can even use the Spinal-Tap inspired "-11" function for
pigz which provides a tiny bit more compression at the expense of a
tremendous amount of processing time. For example, on my computer the
default setting compressed an image to 47.8% of its original size while the
extreme setting was able to reduce it to 44.6% of its original size, but
the extreme version took 376 times longer. For my sample image, the extreme
pigz actually outperformed zopfli, which compressed the file to 45.1% of
its original size. Further, the single-threaded zopfli execution took 611
times longer than the default pigz setting (requiring over 3 minutes to
compress a 1mm isotropic T1 scan).
Personally, I think these extreme compression options make sense if you
are compressing a file once that will be downloaded with limited bandwidth
thousands or millions of times. However, they do not seem practical for the
typical use cases of dcm2niix. If you want, you are free to submit a
pull-request to execute an external copy of zopfli - you can use the
current code which executes an external copy of pigz as a template.
Alternatively, you could write a simple script in a language of your choice
(shell, python, etc) that would have dcm2niix generate uncompressed nii
images and call zopfli to compress them.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOkp1zIgpljFXw3xoA52VWw96so_t9Zks5rnB0VgaJpZM4Mg0GW>
.
|
https://github.com/google/zopfli
It's backward compatible with gzip when it comes to decompressing, but creates smaller files.
The text was updated successfully, but these errors were encountered: