error with SaveParamsAsNIfTI

94 views
Skip to first unread message

Karin Kantarovich

unread,
May 5, 2020, 9:13:04 AM5/5/20
to NODDI
Hi Gary and NODDI Team,

I'm currently practicing using NODDI with the example dataset and when I try to convert the estimated NODDI parameters into volumetric parameter maps using thSaveParamsAsNIfTI command,  I get the following error msg:

>> SaveParamsAsNIfTI('FittedParams.mat', 'NODDI_roi.mat', 'brain_mask.hdr', 'example')
loading the fitted parameters from : FittedParams.mat
loading the roi from : NODDI_roi.mat
loading the target volume : brain_mask.hdr
Undefined function or variable 'model'.

Error in SaveParamsAsNIfTI (line 31)
idxOfFitted = find(model.GD.fixed(1:end-2)==0);

I went into line 31 of the script but I'm not sure what needs to be changed or if there is something I did wrong on my end?

Any help is appreciated, thanks in advance!

Karin

Hui Zhang

unread,
May 6, 2020, 1:37:41 PM5/6/20
to no...@googlegroups.com
Hi Karin,

Are you using the existing FittedParams.mat file in the example dataset?  That file is outdated I am afraid.  You need to run through the steps before that to create a new version of that file first.

Gary

--
You received this message because you are subscribed to the Google Groups "NODDI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to noddi+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/noddi/03779bd2-e187-4e26-b653-e4d61eaece00%40googlegroups.com.

Karin Kantarovich

unread,
May 6, 2020, 3:38:32 PM5/6/20
to NODDI
Hi Gary,

Yes I was, thanks for the tip. I deleted that file and created a FittedParams.mat file using the batch_fitting_single command, but now when I run the SaveParamsAsNIfTI command the following error comes up:

>> SaveParamsAsNIfTI('FittedParams.mat', 'NODDI_roi.mat', 'brain_mask.hdr', 'example')
loading the fitted parameters from : FittedParams.mat
loading the roi from : NODDI_roi.mat
loading the target volume : brain_mask.hdr
converting the fitted parameters into volumetric maps ...
Saving the volumetric maps of the fitted parameters ...
Undefined function or variable 'spm_type'.

Error in nifti/subsasgn>assigndat (line 354)
    if any(sz > spm_type('int16','maxval')) && ~use_nifti2

Error in nifti/subsasgn>fun (line 76)
            obj      = assigndat(obj,val);

Error in nifti/subsasgn (line 20)
        obji    = fun(obji,subs,val);

Error in SaveAsNIfTI (line 27)
N.dat = dat;

Error in SaveParamsAsNIfTI (line 117)
    SaveAsNIfTI(reshape(squeeze(vols(:,i)), [xsize ysize zsize]), niftiSpecs, output);

On Wednesday, May 6, 2020 at 1:37:41 PM UTC-4, Gary wrote:
Hi Karin,

Are you using the existing FittedParams.mat file in the example dataset?  That file is outdated I am afraid.  You need to run through the steps before that to create a new version of that file first.

Gary

On Tue, May 5, 2020 at 2:13 PM Karin Kantarovich <kar.kan...@gmail.com> wrote:
Hi Gary and NODDI Team,

I'm currently practicing using NODDI with the example dataset and when I try to convert the estimated NODDI parameters into volumetric parameter maps using thSaveParamsAsNIfTI command,  I get the following error msg:

>> SaveParamsAsNIfTI('FittedParams.mat', 'NODDI_roi.mat', 'brain_mask.hdr', 'example')
loading the fitted parameters from : FittedParams.mat
loading the roi from : NODDI_roi.mat
loading the target volume : brain_mask.hdr
Undefined function or variable 'model'.

Error in SaveParamsAsNIfTI (line 31)
idxOfFitted = find(model.GD.fixed(1:end-2)==0);

I went into line 31 of the script but I'm not sure what needs to be changed or if there is something I did wrong on my end?

Any help is appreciated, thanks in advance!

Karin

--
You received this message because you are subscribed to the Google Groups "NODDI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to no...@googlegroups.com.

Hui Zhang

unread,
May 7, 2020, 9:20:47 AM5/7/20
to no...@googlegroups.com
Hi Karin,

You must have a version of SPM installed that is clashing with niftimatlib-1.2.  You need to first remove it from your PATH fist.  The command should like like this for SPM8: rmpath(genpath('/usr/local/pkg/spm8'))

Gary

To unsubscribe from this group and stop receiving emails from it, send an email to noddi+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/noddi/1b3b5b27-22a9-4ec3-8008-fb62760b82ea%40googlegroups.com.

Hui Zhang

unread,
May 15, 2020, 1:35:35 AM5/15/20
to no...@googlegroups.com
Hi Karin,

Thanks to your tip, I have now updated the NODDI example dataset with an up-to-date version of FittedParams.mat included in the output folder.

(No need for you to download it again)

Gary

Karin Kantarovich

unread,
May 19, 2020, 11:28:50 AM5/19/20
to NODDI
Hi Gary,

Amazing, thanks! Your advice worked (to remove the path containing a version of SPM that was clashing with niftimatlib-1.2). I did have issues with nifti after that (similar to some of the mex-file issues that previous people reported), I ended up having to re-compile the files through MATLAB as one user in the google group suggested and downloading the full X-Code (not just command line tools) through Apple for Developers. After that everything has been working smoothly.

I'm wondering, is there a google group like this one for AMICO? 

Karin
To unsubscribe from this group and stop receiving emails from it, send an email to no...@googlegroups.com.

Hui Zhang

unread,
May 20, 2020, 3:40:32 AM5/20/20
to no...@googlegroups.com, Alessandro Daducci
Thanks Karin for the update and reminding me of the issue with niftimatlib.  In fact, there is a more recent version of that library now which would have saved your trouble.  I have updated the NODDI toolbox homepage to reflect that.

For AMICO help, I think you can report issues through its GitHub portal.  Copying Alex, here.

But you are welcome to ask AMICO-NODDI related questions here.  I will try to answer any that I can but Alex will likely be happy to chime in.

Gary


To unsubscribe from this group and stop receiving emails from it, send an email to noddi+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/noddi/c878b10d-2632-4490-8d16-d5b47e136bb2%40googlegroups.com.

Alessandro Daducci

unread,
May 25, 2020, 3:31:16 AM5/25/20
to kar.kan...@gmail.com, no...@googlegroups.com, Hui Zhang
Hi Karin and Gary,

yes, the best place to ask for help on AMICO is through github’s “issues” feature: https://github.com/daducci/AMICO/issues

Best,
Ale

Karin Kantarovich

unread,
May 25, 2020, 10:10:18 AM5/25/20
to Alessandro Daducci, no...@googlegroups.com, Hui Zhang
Great, thank you both!

Karin
Reply all
Reply to author
Forward
0 new messages