open-discussion > RE: dcm2niix ignores compresion flag
Nov 3, 2016  03:11 PM | Chris Rorden
RE: dcm2niix ignores compresion flag
Make sure the executable pigz.exe is in the same folder as the dcm2niix.exe. Both executables are included with MRIcroGL. dcm2niix generates a warning if you request gzipped output but it can not find pigz. By the way, future versions of the Windows software will use the internal compressor if it can not find pigz, similar to the current Linux/OSX releases. In general, the multithreaded pigz is much faster than the single-threaded internal compressor, but if you are storing data to a slow (networked) disk, you may find the internal compressor faster (since using pigz requires the software to first save the uncompressed data to disk and then compress that file, while the internal compressor saves the data compressed in a single pass). This explains why Linux/OSX versions of dcm2niix allow you to specify three options for gzip: "-z y", "-z i", "-z n", that will (respectively) gzip output (using pigz if found), gzip output (using internal compressor) or not gzip the output.

--------- Example 1 : pigz found ---------

c:\mricrogl>dcm2niix -z Y c:\tst_t1
Chris Rorden's dcm2niiX version 10oct2016 (32-bit Windows)
Found 192 DICOM image(s)
Convert 192 DICOM as c:\tst_t1\20140228152127_T1_mprage_ns_sag_p2_iso_1.0mm__4 (
256x256x192x1)
compress: ".\pigz" -n -f "c:\tst_t1\20140228152127_T1_mprage_ns_sag_p2_iso_1.0mm
__4.nii"
Conversion required 1.781000 seconds.
--------- Example 2 : pigz not found ---------
c:\mricrogl>dcm2niix -z Y c:\tst_t1
Compression requires pigz.exe in the same folder as the executable
Chris Rorden's dcm2niiX version 10oct2016 (32-bit Windows)
Found 192 DICOM image(s)
Convert 192 DICOM as c:\tst_t1\20140228152127_T1_mprage_ns_sag_p2_iso_1.0mm__4 (
256x256x192x1)
Conversion required 0.234000 seconds.

Threaded View

TitleAuthorDate
Javier Juan-AlbarracĂ­n Oct 27, 2016
RE: dcm2niix ignores compresion flag
Chris Rorden Nov 3, 2016