ins-amu / scripts

prepare data for TVB
MIT License
21 stars 12 forks source link

K_list=3, subparcel.m "error using read" #37

Closed maedoc closed 9 years ago

maedoc commented 9 years ago

After deleting $PRD/connectivity/* and rerunning with newest mrtrix and scripts, I have

curr_K =
8

K =
     3

PRD =
/home/duke/vibrations/scripts/proc/ol/scripts/..

SUBJ_ID =
ol

Error using read (line 21)
File missing.\n

Error in subparcel (line 80)

My config.sh is

export PRD=/home/duke/vibrations/scripts/proc/ol/scripts/..
export FS=/home/duke/vibrations/fs
export SUBJ_ID=ol
export FSL=""
export MCR=/home/duke/mcr/v81
set -e
export CHECK=no

export percent_value_mask=10
export lmax=6 
export region_mapping_corr="0.42"
export number_tracks=5000000
export K_list=3 # subdivide parcellation into 70*2^k regions
export parcel=AAL
export eddy_correct=simple
export act=yes
export sift=yes
export topup="reversed"

I had forgot to pull latest changes from scripts for the topup reveresed, so now I'm rerunning, but this seems like an unrelated issue so I'm posting it anyways.

timpx commented 9 years ago

Could you check if you have a $"PRD"/connectivity/aparcaseg_2_diff_cortical_only.nii and a $"PRD"/connectivity/aparcaseg_2_diff.nii.gz file?

maedoc commented 9 years ago

yep both are are there. when I run curr_K=2 PRD=$(pwd)/../ SUBJ_ID=hh matlab and run subparcel interactively, I have the error reported above, then I see

>> exist(Msk)
ans =
     2

so it's a file format issue? I tried

>> gunzip(Msk)
Error using gunzip>gunzipwrite (line 184)
File "/home/duke/vibrations/scripts/proc/hh/connectivity/aparcaseg_2_diff_cortical_only.nii" is not
in GZIP format.
maedoc commented 9 years ago

I see in uniform_parcellate/read.m

if exist(strcat(fileprefix,'.hdr'),'file') &  exist(strcat(fileprefix,'.img'),'file')
    type=0; 
    hdr_filename=strcat(fileprefix,'.hdr');  
    data_filename=strcat(fileprefix,'.img');  
elseif exist(strcat(fileprefix,'.nii'),'file')
    type=1;
    hdr_filename=strcat(fileprefix,'.nii');
    data_filename=strcat(fileprefix,'.nii');    
else
    error('File missing.\n'); 
end

Perhaps one reads to strip the .nii for this logic to work?

maedoc commented 9 years ago

sorry clicked the wrong button

maedoc commented 9 years ago

The problem is that I'm using a path containing /../ and the lines 5-10 are finding the first . and setting fileprefix to whatever is before that. Doing a fullfile on the path resolves these "up" paths and allows read to work correctly.