Error with batch_fitting

204 views
Skip to first unread message

Blake Neyland

unread,
Sep 28, 2019, 4:34:46 AM9/28/19
to NODDI
Hi Gary,

I am new to the NODDI Toolbox and have been running into some issues when trying to process the example dataset you provide in your tutorial. I have downloaded Matlab 2019b, niftimatlib 1.2, noddi toolbox 1.01, and the matlab optimization toolbox. Create_ROI is running fine, but then I get halted at batch_fitting. The error is posted below:

>> cd /Users/bneyland/Documents/Tools/noddi/practice/
>> CreateROI('NODDI_DWI.hdr', 'roi_mask.hdr', 'NODDI_roi.mat');
loading the DWI volume : NODDI_DWI.hdr
loading the brain mask : roi_mask.hdr
creating the output ROI ...
saving the output ROI as NODDI_roi.mat
done
>> protocol = FSL2Protocol('NODDI_protocol.bval', 'NODDI_protocol.bvec');
>> noddi = MakeModel('WatsonSHStickTortIsoV_B0');
>> batch_fitting('NODDI_roi.mat', protocol, noddi, 'FittedParams.mat', 8);
Error: File: batch_fitting.m Line: 92 Column: 17
Invalid syntax for calling function 'roi' on the path. Use a valid syntax or explicitly initialize 'roi' to make it
a variable.

Have you or anyone else run into this issue? If so, is there a way for me to fix this? I apologize if this is a simple question.

This is line 92 from the batch_fitting.m script:  voxel = roi(i,:)';
As far as I can tell, the 'roi' variable should just pull from my already defined NODDI_roi.mat so I am not sure why there is an error.

Thank you ahead of time and please let me know if you need more information.

Thank you,
Blake

Hui Zhang

unread,
Sep 28, 2019, 4:40:18 AM9/28/19
to no...@googlegroups.com
Hi Blake,

Your error seems to suggest that you have a function also called 'roi' in your matlab environment.

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/d25dda39-fceb-4f36-90e7-95ee2cb055cc%40googlegroups.com.

Jan Valošek

unread,
Oct 15, 2019, 6:26:46 AM10/15/19
to NODDI
Hi Blake and Gary,
I have encountered same problem as reported by Blake. Problem is not in the another function named 'roi'. Cause of this problem is, that parfor loop command requires initialization of all used variables inside this parallel loop. However, 'roi' variable is not initialized in the batch_fitting.m function and is only loaded which is not assumed as initialization. I solved it by adding roi=[]; before load(roifile) command.
I use matlab R2019b, maybe previous version of parallel loop have different requirements. 

Cheers,
Jan 

Dne sobota 28. září 2019 10:40:18 UTC+2 Gary napsal(a):
Hi Blake,

Your error seems to suggest that you have a function also called 'roi' in your matlab environment.

Gary
On Sat, Sep 28, 2019 at 9:34 AM Blake Neyland <bl.n...@hotmail.com> wrote:
Hi Gary,

I am new to the NODDI Toolbox and have been running into some issues when trying to process the example dataset you provide in your tutorial. I have downloaded Matlab 2019b, niftimatlib 1.2, noddi toolbox 1.01, and the matlab optimization toolbox. Create_ROI is running fine, but then I get halted at batch_fitting. The error is posted below:

>> cd /Users/bneyland/Documents/Tools/noddi/practice/
>> CreateROI('NODDI_DWI.hdr', 'roi_mask.hdr', 'NODDI_roi.mat');
loading the DWI volume : NODDI_DWI.hdr
loading the brain mask : roi_mask.hdr
creating the output ROI ...
saving the output ROI as NODDI_roi.mat
done
>> protocol = FSL2Protocol('NODDI_protocol.bval', 'NODDI_protocol.bvec');
>> noddi = MakeModel('WatsonSHStickTortIsoV_B0');
>> batch_fitting('NODDI_roi.mat', protocol, noddi, 'FittedParams.mat', 8);
Error: File: batch_fitting.m Line: 92 Column: 17
Invalid syntax for calling function 'roi' on the path. Use a valid syntax or explicitly initialize 'roi' to make it
a variable.

Have you or anyone else run into this issue? If so, is there a way for me to fix this? I apologize if this is a simple question.

This is line 92 from the batch_fitting.m script:  voxel = roi(i,:)';
As far as I can tell, the 'roi' variable should just pull from my already defined NODDI_roi.mat so I am not sure why there is an error.

Thank you ahead of time and please let me know if you need more information.

Thank you,
Blake

--
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.

Blake Neyland

unread,
Jan 6, 2020, 3:40:44 PM1/6/20
to NODDI
Thanks Jan, I tried this as well and it worked fine!

Hui Zhang

unread,
May 15, 2020, 1:29:52 AM5/15/20
to no...@googlegroups.com
Hi all,

Jan’s diagnosis was spot on.  This was never an issue for the earlier Matlab versions I have developed and tested the toolbox in, but has become an issue now.  A permanent fix is now available as version 1.02.

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/0cc9b239-364e-4392-89f5-2075dc4340df%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages