History of AFNI updates  

|
December 22, 2009 12:50PM
If you change the assignment of fileList in the foreach loop to:

set fileList = ( $fileList Image.$i )

then fileList will be an array. You can extract the Rescale Slope
from the Dicom header like this:

dicom_hdr $fileList[1] | grep Rescale

---

But get rid of the extra garbage with awk, and use it to set scale:

set scale = `dicom_hdr $fileList[1] | grep Slope | awk -F/ '{print $5}'`

---

Then run to3d and 3dcalc:

3dcalc -a ... -expr "a*$scale" ...

Be sure to use double quotes in the 3dcalc expression, in order
to access the $scale variable.

- rick

Subject Author Posted

Byte-swapping for to3d?

Yisheng Xu December 22, 2009 10:58AM

Re: Byte-swapping for to3d?

rick reynolds December 22, 2009 11:05AM

Re: Byte-swapping for to3d?

Yisheng Xu December 22, 2009 11:09AM

Re: Byte-swapping for to3d?

rick reynolds December 22, 2009 12:05PM

Re: Byte-swapping for to3d?

Yisheng Xu December 22, 2009 12:30PM

Re: Byte-swapping for to3d?

Yisheng Xu December 22, 2009 12:31PM

Re: Byte-swapping for to3d?

rick reynolds December 22, 2009 12:50PM