Hi,
I'm testing mri_convert for our dicom conversion needs; one thing that would be fantastic is to be able to feed it a .tar.gz (or .zip) containing a dicom series we'd like to convert. Is there a way to do that?
Alternately, if there were a way to make it use stdin, I could just pipe the output of tar to it.
Thanks! -Nate
no, sorry doug On 03/20/2014 11:28 AM, Nate Vack wrote:
Hi,
I'm testing mri_convert for our dicom conversion needs; one thing that would be fantastic is to be able to feed it a .tar.gz (or .zip) containing a dicom series we'd like to convert. Is there a way to do that?
Alternately, if there were a way to make it use stdin, I could just pipe the output of tar to it.
Thanks! -Nate _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Thanks! If you're ever looking for a feature request, then, that's mine :)
Best, -Nate
On Thu, Mar 20, 2014 at 12:10 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
no, sorry doug On 03/20/2014 11:28 AM, Nate Vack wrote:
Hi,
I'm testing mri_convert for our dicom conversion needs; one thing that would be fantastic is to be able to feed it a .tar.gz (or .zip) containing a dicom series we'd like to convert. Is there a way to do that?
Alternately, if there were a way to make it use stdin, I could just pipe the output of tar to it.
Thanks! -Nate _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2 www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Also, for what it's worth, here's a little script that wraps this up:
https://gist.github.com/njvack/9674025
Best, -Nate
On Thu, Mar 20, 2014 at 12:29 PM, Nate Vack njvack@wisc.edu wrote:
Thanks! If you're ever looking for a feature request, then, that's mine :)
Best, -Nate
On Thu, Mar 20, 2014 at 12:10 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
no, sorry doug On 03/20/2014 11:28 AM, Nate Vack wrote:
Hi,
I'm testing mri_convert for our dicom conversion needs; one thing that would be fantastic is to be able to feed it a .tar.gz (or .zip) containing a dicom series we'd like to convert. Is there a way to do that?
Alternately, if there were a way to make it use stdin, I could just pipe the output of tar to it.
Thanks! -Nate _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2 www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
FYI, you can also get the first file like this:
first_file=$(tar ztf ${in_file} | head -1)
It will be much faster than 'find'.
On 03/20/2014 05:18 PM, Nate Vack wrote:
Also, for what it's worth, here's a little script that wraps this up:
https://gist.github.com/njvack/9674025
Best, -Nate
On Thu, Mar 20, 2014 at 12:29 PM, Nate Vack njvack@wisc.edu wrote:
Thanks! If you're ever looking for a feature request, then, that's mine :)
Best, -Nate
On Thu, Mar 20, 2014 at 12:10 PM, Douglas N Greve greve@nmr.mgh.harvard.edu wrote:
no, sorry doug On 03/20/2014 11:28 AM, Nate Vack wrote:
Hi,
I'm testing mri_convert for our dicom conversion needs; one thing that would be fantastic is to be able to feed it a .tar.gz (or .zip) containing a dicom series we'd like to convert. Is there a way to do that?
Alternately, if there were a way to make it use stdin, I could just pipe the output of tar to it.
Thanks! -Nate _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Douglas N. Greve, Ph.D. MGH-NMR Center greve@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422
Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2 www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Huh, will you look at that:
$ time find s04_epi -type f |sed 1q s04_epi/s04_epi.0001
real 0m0.096s user 0m0.002s sys 0m0.014s
$ time tar tf s04_epi.tar.gz |sed 1q s04_epi/s04_epi.0001
real 0m0.016s user 0m0.001s sys 0m0.008s
Thanks! (Also, modern 'tar' seems to figure out compression on its own, which is nice if you don't know ahead of time if your input will be gz or bz2 or xz.)
-n
On Thu, Mar 20, 2014 at 5:58 PM, Chris Watson Christopher.Watson@childrens.harvard.edu wrote:
FYI, you can also get the first file like this:
first_file=$(tar ztf ${in_file} | head -1)
Not to beat this to death, but sometimes this returns a directory name instead of a file name. So `find -type f` is safer, unless there's some way to make tar not do the directory name thing.
-n
freesurfer@nmr.mgh.harvard.edu