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  

|
July 23, 2019 01:42PM
Hi, Sandra-

Hmm, OK. I don't know of one single command that can do that. You could inflate them separately/individually, while leaving the other ones there so that nothing overlaps...

Taking a step back, I'm a bit curious about inflating them differentially. Can I ask where the original ROIs come from (anatomical, FMRI, other...)? From purely tractographic considerations, there isn't really an expectation that the target ROIs are the same size

But if you really want to, theeeeen you could do something like this:
#!/bin/tcsh

set ivol = start_roi.nii  # your starting volume name-- the 3D dset of ROIs

set opref    = INF

set roi_inds = ( 1 2 3 4 ) # whatever the ROI indices happen to be-- don't have to be consecutive
set infl_val = ( 2 3 1 4 ) # how much to inflate each ROI (matching order of ROI inds)
set Nrois    = $#roi_inds


# initialize 
set basevol = "$ivol" 

foreach ii ( `seq 1 1 $Nrois` )
    # will inflate th ROI each time
    set rrr = ${roi_inds[$ii]}

    # make a list of The Other ROIs-- the ones not inflated in this
    # step. '0' just here for being able to put commas from the start.
    set all_others = "0"  
    foreach jj ( `seq 1 1 $Nrois` )
        if ( $jj != $ii ) then
            set all_others = "${all_others},${roi_inds[$jj]}"
        endif
    end

    set ovol   = "${opref}_${ii}"                # inflated ROI this round
    set ovol2  = "${opref}_${ii}_recon.nii.gz"   # infl ROI + The Others

    echo "++ For output dset $ovol, ii=$ii and the others are $all_others"
    
    3dROIMaker -echo_edu                          \
        -inset "${basevol}<${rrr}>"               \
        -refset "${basevol}<${rrr}>"              \
        -inflate "$infl_val[$ii]"                 \
        -wm_skel DTI/DT_FA+orig.                  \
        -skel_thr 0.2                             \
        -skel_stop                                \
        -csf_skel "${basevol}<${all_others}>"     \
        -mask mask_DWI+orig                       \
        -prefix ${ovol}                          \
        -nifti

    # put back together: the newly inflated ROI and The Others
    3dcalc \
        -a "${basevol}<${all_others}>" \
        -b ${ovol}_GMI.nii.gz          \
        -expr 'a + b'                  \
        -prefix "$ovol2"

    # take the inflated one as the basevol for the next pass
    set basevol = "$ovol2"
end

echo "++ Done.  Final volume of interest should be:"
echo "   $basevol"
Subject Author Posted

3dRoimaker: similar ROI sizes

Sandra Hanekamp July 23, 2019 11:42AM

Re: 3dRoimaker: similar ROI sizes

ptaylor July 23, 2019 12:15PM

Re: 3dRoimaker: similar ROI sizes

Sandra Hanekamp July 23, 2019 12:23PM

Re: 3dRoimaker: similar ROI sizes

ptaylor July 23, 2019 01:42PM

Re: 3dRoimaker: similar ROI sizes

Sandra Hanekamp July 23, 2019 02:45PM

Re: 3dRoimaker: similar ROI sizes

Daniel Glen July 23, 2019 01:45PM