Menu

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

2020-07-12
2021-09-28
  • ilaria sani

    ilaria sani - 2020-07-12

    Dear All,

    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 get an error early on while loading the roi.

    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

    I am using spm8

    I am able to use the line params.vol = spm_vol(params) outside the script.
    So it must be something (trivial) related to how params is defined, but I am unable to spot it.

    Can anyone help please?

    Thanks,
    Ilaria

     
  • ilaria sani

    ilaria sani - 2020-07-13

    I thought I had found 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:\00_WAF_lab\2018_humanDTI\0_revision\2020_roi_analysis\sub-HS40\dt-neuro-rois_merged\rois\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?

    Thanks!
    Ilaria

     
  • Matthew Brett

    Matthew Brett - 2021-09-28

    I'm really sorry I missed this one. If you still haven't solved this - can you post over at https://marsbar.discourse.group/ ?

     

Log in to post a comment.