INFO:dcm2bids.dcm2bids:BIDS directory: /Volumes/vision/Data/BIDS/bidsout
INFO:dcm2bids.utils:Running ['dcm2niix', '-b', 'y', '-ba', 'y', '-z', 'y', '-f', '%3s_%f_%p_%t', '-o', PosixPath('BIDS/bidsout/tmp_dcm2bids/sub-01'), PosixPath('PilotStudy/PilotSession11/data/dicoms')]
Error: Unable to find any DICOM images in PilotStudy/PilotSession11/data/dicoms (or subfolders 5 deep)
But that is the directory with the data. Am I not formatting the command correctly? Surely I don’t have to pre-extract the dcms from each tgz (i have used dcm2niix from within matlab and python packages and pointing it at tgz files works - is that some extra capability of other packages?)… Or…?
dcm2niix does not extract DICOMs from compressed files. It assumes that the input folder is read only (e.g. DICOMs often come on CD-ROMs).
You can always write a wrapper for dcm2niix that extracts .tgz files to a temporary folder, calls dcm2niix and then deletes the temporary folder. Be aware that servers often have very slow disk storage, so you may want the temporary folder to be on a RAM disk.
As an aside, whereas one can rapidly read the contents of a .zip format archive and randomly access the contents the same is not true for .tar.gz archives.
I’m pretty sure now you have all the answers needed to fix your issue with dcm2bids/dcm2niix.
Thank you for rising the issue about dcm2bids tutorials. It should now be fixed.
Arnaud
Great! Thank you, now I know. I will figure out how to do something like this. (dcm2bids does work nicely with the uncompressed inputs, first time I’ve gotten something like this to work!)
If it helps, I noticed that bidscoin has functionality to untar / unzip files if a source directory contains any .tar.gz, .gz or .zip. The in-built dicom-scanner and graphical mapping editor are also super convenient!