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  

|
March 17, 2022 04:35AM
I am extremely grateful for your replying!

To make it clear for you, I would like to outline the process. Hope this is helpful.

The whole process is made up of following steps:
1. Download 13 different ROIs in matlab-WFU Human atlas-AAL (e.g. Frontal_Sup_L.nii), and then, for each ROI run the following code

"3dcalc -prefix WFU_Frontal_Sup_L.nii.gz -a Frontal_Sup_L.nii -expr 'step(a-0)'
3dresample -master SB92_noBrainstemCereb.nii.gz -dxyz 3 3 3 -prefix WFU_Frontal_Sup_L_3mm.nii.gz -input WFU_Frontal_Sup_L.nii.gz
3drefit -space MNI WFU_Frontal_Sup_L_3mm.nii.gz"

2. These 13 ROIs were grouped into the original mask by 3dcalc "a*1+b*2+...m*13". However, this original mask didn't fill in the brain well, leaving much empty space especially in the marginal area, so I chose to use the Draw Plungin to fill it——"Choose dataset for copying"- "Save" botton, get a COPY file, and then run the following code:

"3dcalc -a COPY_WFU_Frontal_Sup_L_3mm.nii.gz -b WFU_Frontal_Sup_L_3mm.nii.gz -expr 'a+b' -prefix aaa_Frontal_Sup_L.nii.gz
3dcalc -a aaa_Frontal_Sup_L.nii.gz -b SB92_noBrainstemCereb.nii.gz -expr 'a*b' -prefix Frontal_Sup_L_Edited1.nii.gz"

For each ROI, I repeated this process several times to get a dream one, which filled the border completely.

3. So far, no problem arose. Each ROI can be viewed in the AFNI. However, when I used the previous method, 3dcalc "a*1+b*2+...m*13" ,to make up a new mask. This mask also couldn't be viewed in the AFNI, and had the same "data bytes needed" error. Something wrong must had happened at this time. But I ignored it and found another way to avoide this error. Specifically, I calculated 3-4 ROIs each time (e.g. 3dcalc "a*1+b*2+c*3"), and then added them together. By this way, I got the ROI13_Mask.nii.gz.

I don't know what happen here, but I can view the ROI13_Mask.nii.gz in the AFNI, and the value related with each ROI is correct. When I tried to separate each ROI, that error arose again, as I had mentioned before.



-Here is the output of "nifti_tool -disp_nim -infiles ROI13_4.nii.gz"
----------------------------------------------------------------------------------------------------------------------
header file 'ROI13_4.nii.gz', num_fields = 63, fields:

all fields:
name offset nvals values
------------------- ------ ----- ------
ndim 0 1 3
nx 8 1 64
ny 16 1 76
nz 24 1 64
nt 32 1 1
nu 40 1 1
nv 48 1 1
nw 56 1 1
dim 64 8 3 64 76 64 1 1 1 1
nvox 128 1 311296
nbyper 136 1 1
datatype 140 1 2
dx 144 1 3.0
dy 152 1 3.0
dz 160 1 3.0
dt 168 1 0.0
du 176 1 0.0
dv 184 1 0.0
dw 192 1 0.0
pixdim 200 8 0.0 3.0 3.0 3.0 0.0 0.0 0.0 0.0
scl_slope 264 1 0.0
scl_inter 272 1 0.0
cal_min 280 1 0.0
cal_max 288 1 0.0
qform_code 296 1 4
sform_code 300 1 4
freq_dim 304 1 0
phase_dim 308 1 0
slice_dim 312 1 0
slice_code 316 1 0
slice_start 320 1 0
slice_end 328 1 0
slice_duration 336 1 0.0
quatern_b 344 1 0.0
quatern_c 352 1 -0.0
quatern_d 360 1 0.0
qoffset_x 368 1 -94.5
qoffset_y 376 1 -130.5
qoffset_z 384 1 -76.5
qfac 392 1 1.0
qto_xyz 400 16 3.0 -0.0 0.0 -94.5 0.0 3.0 -0.0 -130.5 0.0 0.0 3.0 -76.5 0.0 0.0 0.0 1.0
qto_ijk 528 16 0.333333 0.0 0.0 31.5 -0.0 0.333333 0.0 43.5 0.0 -0.0 0.333333 25.5 0.0 0.0 0.0 1.0
sto_xyz 656 16 3.0 -0.0 -0.0 -94.5 -0.0 3.0 -0.0 -130.5 0.0 0.0 3.0 -76.5 0.0 0.0 0.0 1.0
sto_ijk 784 16 0.333333 0.0 0.0 31.5 0.0 0.333333 0.0 43.5 -0.0 -0.0 0.333333 25.5 0.0 0.0 0.0 1.0
toffset 912 1 0.0
xyz_units 920 1 2
time_units 924 1 0
nifti_type 928 1 1
intent_code 932 1 0
intent_p1 936 1 0.0
intent_p2 944 1 0.0
intent_p3 952 1 0.0
intent_name 960 16
descrip 976 80
aux_file 1056 24
fname 1080 1 'ROI13_4.nii.gz'
iname 1088 1 'ROI13_4.nii.gz'
iname_offset 1096 1 607359616
swapsize 1104 1 0
byteorder 1108 1 1
data 1112 1 (raw data of unknown type)
num_ext 1120 1 1
ext_list 1128 1 ecode = 4, esize = 607359248, edata = <?xml
------------------------------------------------------------------------------------------------------------------
Besides, I also ran the "nifti_tool -disp_nim -infiles ROI13_Mask.nii.gz". The output of it is almost the same, except that the valve of iname_offset is 5568464 and the esize of ext_list is 5568112.

Thank you again very much.

Wind



Edited 1 time(s). Last edit at 03/17/2022 11:31PM by Wind.
Subject Author Posted

"data bytes needed" error

Wind March 16, 2022 08:50AM

Re: "data bytes needed" error

rick reynolds March 16, 2022 11:06AM

Re: "data bytes needed" error

Wind March 17, 2022 04:35AM

Re: "data bytes needed" error

Wind March 20, 2022 03:39AM

Re: "data bytes needed" error

rick reynolds March 20, 2022 07:48PM

Re: "data bytes needed" error

Ziad Saad August 30, 2022 01:10PM

Re: "data bytes needed" error

Daniel Glen August 30, 2022 05:12PM

Re: "data bytes needed" error

jbteves August 31, 2022 10:23AM

Re: "data bytes needed" error

Ziad Saad August 31, 2022 03:30PM

Re: "data bytes needed" error

Daniel Glen August 31, 2022 05:05PM

Re: "data bytes needed" error

Ziad Saad September 01, 2022 04:15PM

Re: "data bytes needed" error

Peter Molfese September 01, 2022 04:58PM

Re: "data bytes needed" error

Ziad Saad September 06, 2022 04:07PM

Re: "data bytes needed" error

Daniel Glen September 06, 2022 03:39PM

Re: "data bytes needed" error

Ziad Saad September 06, 2022 04:10PM

Re: "data bytes needed" error

Ziad Saad September 06, 2022 05:34PM

Re: "data bytes needed" error

Daniel Glen September 06, 2022 05:40PM

Re: "data bytes needed" error

Ziad Saad September 06, 2022 06:26PM

Re: "data bytes needed" error

Daniel Glen September 07, 2022 01:55PM