Reply To: Importing ROIs

Forums Forums General Questions Importing ROIs Reply To: Importing ROIs

#96
Anand Joshi
Moderator

Hi Wes,
1 is a fine value for the script. The problem is that the volume is labeled, but these labels are not transferred to the surfaces, so the thickness values are not computed.

You can follow these steps

1. run Brainsuite + SVReg
2. run thicknessPVC.sh
3. run the following commands
subbasename=’/Storage/session_1/anat_1/mprage’;
vol_label_file=’/Storage/1_LH_V1.label.nii’;
slt=readdfs([subbasename, ‘.pvc-thickness_0-6mm.left.mid.cortex.dfs’]);
sl=readdfs([subbasename, ‘.left.mid.cortex.svreg.dfs’]);

sl.attributes=slt.attributes;

vl=load_untouch_nii(vol_label_file);
res=vl.hdr.dim.pixdim(2:4);
% copy volumetric labels to surfaces;
sl.labels=interp3(double(vl.img),sl.vertices(:,2)/res(2)+1,sl.vertices(:,1)/res(1)+1,sl.vertices(:,3)/res(3)+1,’nearest’);

slin=readdfs([subbasename, ‘.left.inner.cortex.svreg.dfs’]);
slpial=readdfs([subbasename, ‘.left.pial.cortex.svreg.dfs’]);

slin.labels=sl.labels;
slin.attributes=sl.attributes;

slpial.labels=sl.labels;
slpial.attributes=sl.attributes;

writedfs([subbasename, ‘.left.inner.cortex.svreg2.dfs’],slin);
writedfs([subbasename, ‘.left.mid.cortex.svreg2.dfs’],sl);
writedfs([subbasename, ‘.left.pial.cortex.svreg2.dfs’],slpial);

%% Do the same for the right hemisphere
slt=readdfs([subbasename, ‘.pvc-thickness_0-6mm.right.mid.cortex.dfs’]);
sl=readdfs([subbasename, ‘.right.mid.cortex.svreg.dfs’]);

sl.attributes=slt.attributes;

vl=load_untouch_nii(vol_label_file);
res=vl.hdr.dim.pixdim(2:4);
% copy volumetric labels to surfaces;
sl.labels=interp3(double(vl.img),sl.vertices(:,2)/res(2)+1,sl.vertices(:,1)/res(1)+1,sl.vertices(:,3)/res(3)+1,’nearest’);

slin=readdfs([subbasename, ‘.right.inner.cortex.svreg.dfs’]);
slpial=readdfs([subbasename, ‘.right.pial.cortex.svreg.dfs’]);

slin.labels=sl.labels;
slin.attributes=sl.attributes;

slpial.labels=sl.labels;
slpial.attributes=sl.attributes;

writedfs([subbasename, ‘.right.inner.cortex.svreg2.dfs’],slin);
writedfs([subbasename, ‘.right.mid.cortex.svreg2.dfs’],sl);
writedfs([subbasename, ‘.right.pial.cortex.svreg2.dfs’],slpial);

4. now run

ROI_IDs= [1];
surf_ext=’svreg2.dfs’;
output_ext=’testout’; %[subbasename,’.roiwise.’,output_ext,’.stats.txt’]
generate_stats_xls_manual(subbasename,vol_label_file,ROI_IDs,surf_ext,output_ext);

This should work. Please let me know if there is any problem.