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  

|
Daniel Glen
January 29, 2008 06:09PM
At first thought, I would use 3dTcat or 3dbucket in a loop, but you can also do it with this script that uses 3dcalc and duplicated sub-bricks in the sub-brick list.

I'm not sure exactly what you're trying to accomplish, but you might want to use a 1D text file instead of a 3D+time datasets. For info on using 1D files as input for 3D programs.

[afni.nimh.nih.gov]



#!/bin/tcsh
# multi_copy.csh
if ("$1" == '' || "$1" == "-help" || "$1" == "-h") then
echo "Usage: A script to create a 3D+time dataset by duplicating "
echo " the 0th sub-brick n times"
echo ""
echo " `basename $0` n-copies <dsetname>"
echo ""
echo "The output dataset is saved as dsetprefix_multi+orig"
echo ""
goto END
endif

set ncopies = $1

set dset = `@GetAfniPrefix $2`
set outdset = ${dset}_multi
set copylist = '0'

@ ncopies--
rm -f $outdset+orig.*
foreach copyi (`count 1 ${ncopies}`)
set copylist = `echo "${copylist},0"`
end

3dcalc -a ${2}."[${copylist}]" -prefix $outdset -expr a

END:
Subject Author Posted

duplicate subricks inside a BRIK file?

Prantik Kundu January 29, 2008 05:20PM

Re: duplicate subricks inside a BRIK file?

Daniel Glen January 29, 2008 06:09PM

Re: duplicate subricks inside a BRIK file?

Prantik Kundu January 29, 2008 07:38PM

Re: duplicate subricks inside a BRIK file?

bobcox January 29, 2008 09:20PM

Re: duplicate subricks inside a BRIK file?

Daniel Glen January 30, 2008 10:28AM