I am working on a searchlight analysis and am using 3dmaskdump and 3dUndump in MATLAB. However, after running the searchlight, the results seem to be flipped in orientation -- even though the 3dinfo -verb output says all data are in LPI.
For example, I get a series out errors like this:
[7m*+ WARNING:[0m File /Users/andrewlynn/Desktop/sf_afni_tmp/test.txt line 452016: y coord=-92.5 is outside -91.2525 .. 126.253
Below I simplified this by trying to pull the atlas info then use 3dUndump to recreate the atlas and the flip happens here too.
I think there may be a bug in the AFNI code? This seems to be fixed by multiplying the X and Y coords
cmask = ['/Volumes/NBL_Projects/NSF_DDK2/matfiles/preprocessing_pipeline/HaskinsPeds/HaskinsPeds_NL_atlas2.5+tlrc.BRIK.gz'];
loc = ['~/Desktop/sf_afni_tmp'];
unix(['3dmaskdump -overwrite -noijk -xyz -o ' loc 'tmp.n_voxel_coord ' cmask]);
rois = dir([loc 'tmp.n_voxel_coord']);
nrois = load([rois.folder '/' rois.name]);
writematrix(nrois,[loc '/test.txt'],'Delimiter','tab');
unix(['3dUndump -overwrite -xyz -datum float -prefix ' loc '/Haskings_coord_mask -master ' cmask ' ' loc '/test.txt']);
Attachments:
open |
download -
Screen Shot 2021-11-30 at 1.23.16 PM.png
(511.8 KB)