AFNI Message Board

History of AFNI updates  

|
June 15, 2022 02:38PM
Hi, Matthew-

You should be able to use those other dsets. NB: I am not sure what FMRIprep's dset is *exactly*---you could use AFNI's 3dDiff to difference it with the MNI volume you cited.

The pair of FATCAT reference volumes (one pair for T1w, and one pair for T2w) are just: a template, and weightmask (with the weighting being an ellipsoid/spheroid in the subcortical region). In the original demo, the MNI template was tweaked to be ACPC aligned (because that was a focal aspect for collaborators). In your case, it sounds like you would not like this rotating associated with ACPC alignment, because you want to match a specific template space. That should be fine---the ACPC alignment is pretty minimal rotation, and is mostly for visualization aspects.

The recipe for making the pair of *ACPCE.nii.gz and *ACPCE_wtell.nii.gz dsets are in the `3dinfo -history ...` of each dset. But the following script should pick out the highlights and make the relevant datasets for you. So, if you save this as "do_new_fatproc_ref.tcsh", you can run it as "tcsh do_new_fatproc_ref.tcsh", and it should make the datasets of interest for you:
#!/bin/tcsh

# ----------------------- get data ---------------------------------

set my_mni = mni_icbm152_nlin_asym_09c              # used to make new data

if ( ! -d ${my_mni} ) then
    echo "++ Get MNI dir: ${my_mni}"
    curl -O www.bic.mni.mcgill.ca/~vfonov/icbm/2009/${my_mni}_nifti.zip
    unzip ${my_mni}_nifti.zip

    if ( $status ) then
        echo "** ERROR: problem getting my MNI: ${my_mni}"
        exit 1
    endif
endif

# ----------------------- proc data ---------------------------------

# get the T1, mask and T2 dsets
set dset_t1   = `\ls ${my_mni}/mni*_t1_*.nii | grep --color=never -v mask`
set dset_t2   = `\ls ${my_mni}/mni*_t2_*.nii`
set dset_mask = `\ls ${dset_t1:gas/.nii/_mask.nii/}`

echo "++ T1 dset is   : ${dset_t1}"
echo "++ T2 dset is   : ${dset_t2}"
echo "++ mask dset is : ${dset_mask}"

set dset_t1_mskd = `basename ${dset_t1:gas/.nii/_pseudoACPCE.nii.gz/}`
3dcalc                                                             \
    -overwrite                                                     \
    -a      ${dset_mask}                                           \
    -b      ${dset_t1}                                             \
    -expr  'a*b'                                                   \
    -prefix ${dset_t1_mskd}                                        \
    -float
echo "++ Created masked t1: ${dset_t1_mskd}"

set dset_t2_mskd = `basename ${dset_t2:gas/.nii/_pseudoACPCE.nii.gz/}`
3dcalc                                                             \
    -overwrite                                                     \
    -a      ${dset_mask}                                           \
    -b      ${dset_t2}                                             \
    -expr  'a*b'                                                   \
    -prefix ${dset_t2_mskd}                                        \
    -float
echo "++ Created masked t1: ${dset_t1_mskd}"

# make oblong weight
3dcalc                                                             \
    -overwrite                                                     \
    -a     ${dset_mask}                                            \
    -expr  'step((1-(x-0)*(x-0)/(30**2)-(y-9)*(y-9)/(50**2)-(z-2)*(z-2)/(30**2)))' \
    -prefix ELL.nii                                                \
    -float

3dmerge                                                            \
    -overwrite                                                     \
    -1blur_rms 4.2                                                 \
    -prefix ELLBLUR.nii                                            \
    ELL.nii

set dset_t1_wtell = `basename ${dset_t1:gas/.nii/_pseudoACPCE_wtell.nii.gz/}`
3dcalc \
    -overwrite                                                     \
    -a       ${dset_t1_mskd}                                       \
    -b       ELLBLUR.nii                                           \
    -expr    'a*(1+5*b)'                                           \
    -prefix  ${dset_t1_wtell}


set dset_t2_wtell = `basename ${dset_t2:gas/.nii/_pseudoACPCE_wtell.nii.gz/}`
3dcalc \
    -overwrite                                                     \
    -a       ${dset_t2_mskd}                                       \
    -b       ELLBLUR.nii                                           \
    -expr    'a*(1+5*b)'                                           \
    -prefix  ${dset_t2_wtell}

# clean
\rm ELL*.nii

cat <<EOF
++ DONE.

See the following dsets:

    t2 masked ref template dset     : ${dset_t2_mskd}
    t2 masked 'ellipse weight' dset : ${dset_t2_wtell}
    t1 masked ref template dset     : ${dset_t1_mskd}
    t1 masked 'ellipse weight' dset : ${dset_t1_wtell}

Though the MNI dsets here have not really been ACPC aligned (hence, the 'pseudo' in the name)
EOF

I don't think it is necessary to resample it to RAI dset orientation, for example, which was done in the original.

Please let me know how that seems.

--pt
Subject Author Posted

Using MNI152NLin2009cAsym template in FATCAT?

Matthew Hoptman June 15, 2022 01:08PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

ptaylor June 15, 2022 02:38PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

Matthew Hoptman June 15, 2022 02:51PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

ptaylor June 15, 2022 03:44PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

Matthew Hoptman June 15, 2022 03:27PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

ptaylor June 15, 2022 03:45PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

Matthew Hoptman June 15, 2022 03:27PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

ptaylor June 15, 2022 03:48PM

Re: Using MNI152NLin2009cAsym template in FATCAT?

Matthew Hoptman June 15, 2022 04:30PM



Sorry, only registered users may post in this forum.

Click here to login