Menu

#6 unable to buid roi from image (batch)

v1.0 (example)
open
nobody
5
2020-07-13
2020-07-13
ilaria sani
No

Dear All,

I am trying to batch script roi extraction from image (nii) to then perform ROI analysis over multiple ROIs and subjects.
So, I am trying to batch script roi extraction from image (nii) to then perform ROI analysis over multiple ROIs and subjects.

I am using the example lines provided:

fname = roi_list{1};
roi = maroi_image(fname);

I got an error early on while loading the roi:

maroi_image ERROR (line 34) params.vol = spm_vol(params);

-I have seen a couple of posts that resolved a similar issue by adding marsbar('on'). It didn't work for me.
-I tried to versions of matlab: 2016b and 2019a - same error

So I tried a workaround by using

fname = spm_vol(roi_list{i1}); % instead of fname = 'image.nii'
roi = maroi_image(fname);
roi = maroi_matrix(roi);

the script now runs without errors and roi.mat is generated.

However, when I attempt to visualize the rois from marsbar - roi definition - view
They do not appear in the gui in the folder where they are. Thus I understand that marsbar does not recognize them.

Does anyone have a clue?

I noticed that the there is one difference between the roi build via scripting and via gui:
the label field is empty:

val =

[maroi_matrix - 11 - binarized]

label: ''
   source: 'C:\path-to-roi\11_roi.mat'
 binarize: 1
roithresh: 0.5000
 spm_hold: 1


  dat: [158×190×136 double]
  mat: [4×4 double]
maroi: [1×1 maroi]

Can this be the problem?

Please help!!!
Thanks!
Ilaria

Related

Support Requests: #6

Discussion


Log in to post a comment.