AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
February 11, 2015 03:46PM
I'm using dicom_hdr to look at the siemens extra data for some files when I tell grep to exit after the first match:

some scans have no problem either way:
> dicom_hdr -sexinfo $dcmfile1 | grep 'lOffset'
sGRADSPEC.lOffsetX	 = 	-1500

> dicom_hdr -sexinfo $dcmfile1 | grep -m1 'lOffset'
sGRADSPEC.lOffsetX	 = 	-1500

Other scans are fine with a normal grep, but throws a fit if I "grep -m1":
> dicom_hdr -sexinfo $dcmfile2 | grep 'lOffset'
sGRADSPEC.lOffsetX	 = 	-1054

> dicom_hdr -sexinfo $dcmfile2 | grep -m1 'lOffset'
sGRADSPEC.lOffsetX	 = 	-1054

Fatal Signal 13 (SIGPIPE) received
  dicom_hdr main
 Bottom of Debug Stack
** AFNI version = AFNI_2011_12_21_1014  Compile date = Jul 30 2013
** [[Precompiled binary linux_openmp_64: Jul 30 2013]]
** Program Abort **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.

The failures usually happen on non-product sequences, but does fail on some product sequences as well.

I've tried a few different versions of dicom_hdr as well, always with the same result

My workaround is just to leave out "-m1" and let it scan the entire file, but I'd really like to be able to speed up my scripts by telling grep to exit after the first match.

Any thoughts on how I can address this?

Thanks!
-Keith
Subject Author Posted

dicom_hdr crashing when siemens extra data "grep -m1" for SOME files

kjamison February 11, 2015 03:46PM

Re: dicom_hdr crashing when siemens extra data "grep -m1" for SOME files

Daniel Glen February 11, 2015 03:54PM

Re: dicom_hdr crashing when siemens extra data "grep -m1" for SOME files

kjamison February 11, 2015 03:59PM

Re: dicom_hdr crashing when siemens extra data "grep -m1" for SOME files

Isaac Schwabacher February 11, 2015 04:11PM

Re: dicom_hdr crashing when siemens extra data "grep -m1" for SOME files

kjamison February 11, 2015 06:54PM

Re: dicom_hdr crashing when siemens extra data "grep -m1" for SOME files

Isaac Schwabacher February 11, 2015 04:00PM