batch_fitting error

220 views
Skip to first unread message

Dario Del Cuore

unread,
May 6, 2022, 5:08:47 AM5/6/22
to NODDI
To Whom It May Concerns, 
I'm trying to apply the NODDI model to my dataset for thesis purposes and I'm completely new at it. 

I actually registered an issue related to the batch_fitting problem: 

batch_fitting('noddi_roi.mat', protocol, noddi, 'FittedParams.mat');
Starting parallel pool (parpool) using the 'local' profile ... connected to 10 workers.
Undefined variable "ParforProgressMonitor" or class
"ParforProgressMonitor.createServer".

Error in ParforProgMon (line 118)
            o.JavaBit   = ParforProgressMonitor.createServer( strWindowTitle,
            nNumIterations, nProgressStepSize, nWidth, nHeight );

Error in batch_fitting (line 91)
ppm = ParforProgMon(['Fitting ' roifile, ' : '],
numOfVoxels-current_split_start+1,...

These are the errors that are appearing here. Does anyone know how to solve these issues? 

In addiction, I tried to perform the batch_fitting_single and the errors that I registered are posted as followed: 

Fitting voxel 1
Index exceeds matrix dimensions.

Error in EstimateSigma (line 9)
    sigma = std(signal(protocol.b0_Indices), 1);

Error in ThreeStageFittingVoxel (line 64)
sig = EstimateSigma(Epn, protocol, model);

Error in batch_fitting_single (line 88)
        [gsps(i,:), fobj_gs(i), mlps(i,:), fobj_ml(i), error_code(i)] =
        ThreeStageFittingVoxel(voxel, protocol, model);

Waiting for your reply. 

Thank you, 
Kind regards. 

Hui Zhang

unread,
May 6, 2022, 6:29:21 PM5/6/22
to no...@googlegroups.com
Hi,

Have you already gone through the process with the example dataset provided?  Did you see the same issues?

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/675e0bd7-0b5d-42d0-a8fa-03bc888f2950n%40googlegroups.com.

Dario Del Cuore

unread,
May 23, 2022, 7:41:41 AM5/23/22
to NODDI
Hi Gary, 
Yes, with the example dataset I had the same problem. Indeed, batch fitting didn't work, but batch_fitting single did. 

Now,  I managed to let batch_fitting_single work for my data but it is really slow, unfortunately. I believe that even if the 2 of them are equivalent, the batch_fitting could be faster than the single one. I reckon that if I'll find a solution for batch_fitting, I can solve also the issue related to the required time. 

Do you have any idea about the issue related to batch_fitting? 

Thank you so much, 
Kind Regards.

Hui Zhang

unread,
May 25, 2022, 2:46:47 PM5/25/22
to no...@googlegroups.com
Hi Dario,

I suspected you were experiencing two different issues - one to do with the way you have prepared your data; the other to do with some missing software dependencies.  Can you send me the error message of running batch_fitting on the example data?

Gary


Dario Del Cuore

unread,
May 28, 2022, 7:06:37 AM5/28/22
to NODDI
Hi Gary, 
Actually I think that it is related to the version of Matlab that I currently have. I tried with an updated version and it worked. 

Either way, here you can find the errors:

batch_fitting('noddi_roi.mat', protocol, noddi, 'FittedParams.mat', 8);

Undefined variable "ParforProgressMonitor" or class

"ParforProgressMonitor.createServer".


Error in ParforProgMon (line 118)

            o.JavaBit   = ParforProgressMonitor.createServer( strWindowTitle,

            nNumIterations, nProgressStepSize, nWidth, nHeight );


Error in batch_fitting (line 91)

ppm = ParforProgMon(['Fitting ' roifile, ' : '],

numOfVoxels-current_split_start+1,...


Thank you again, 

Kind Regards. 


Hui Zhang

unread,
May 28, 2022, 7:20:40 AM5/28/22
to no...@googlegroups.com
Thanks Dario.  Can you tell me which version of Matlab worked? and which did not?

Gary

Dario Del Cuore

unread,
May 28, 2022, 10:17:44 AM5/28/22
to NODDI
In my mac, I have the version 2020a and it worked. In the remote computer that I'm using for the thesis, the version is 2016a and it didn't work. 

Thank you again. 

Jee Won Kang

unread,
Jul 1, 2022, 3:08:11 AM7/1/22
to NODDI
I just wanted to add that I am running into this same issue with Matlab version 2019a when trying to use batch_fitting with the parallel computing toolbox. I've checked that the version of Matlab being used does have the toolbox installed, so I'm not sure what's causing the problem.

Thank you,
Jee Won

Hui Zhang

unread,
Jul 1, 2022, 3:25:17 AM7/1/22
to no...@googlegroups.com
I just found this old thread on a similar fault and the proposed fix.  Take a look and see if it helps.

Gary

Jee Won Kang

unread,
Jul 1, 2022, 2:33:53 PM7/1/22
to NODDI
Hi, unfortunately this did not address the issue we were having.

The error message I got was a little different than the one mentioned by Dario, but happened in the same spot when using batch_fitting:

Error using ParforProgMon (line 118)
Java exception occurred:
java.awt.HeadlessException
    at
        java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
            at java.awt.Window.<init>(Window.java:536)
    at java.awt.Frame.<init>(Frame.java:420)
    at javax.swing.JFrame.<init>(JFrame.java:233)
    at
        ParforProgressMonitor$ProgServer.<init>(ParforProgressMonitor.java:88)
    at
        ParforProgressMonitor$ProgServer.<init>(ParforProgressMonitor.java:77)
    at ParforProgressMonitor.createServer(ParforProgressMonitor.java:16)


Error in batch_fitting (line 91)
ppm = ParforProgMon(['Fitting ' roifile, ' : '],
numOfVoxels-current_split_start+1,...

I think this may be due to trying to use the toolbox on a computing cluster with the -nodesktop option, as I was able to get things working on 2018b locally.

Is there a way to make the script compatible with cluster use?

Thank you,
Jee Won

Matt Lyon

unread,
Dec 3, 2022, 4:20:24 AM12/3/22
to NODDI
This error is due to the progress bar failing to load in a remote/SSH environment. You can remove the progress bar by commenting out/deleting the following lines within fitting/batch_fitting.m:


ppm = ParforProgMon(['Fitting ' roifile, ' : '], numOfVoxels-current_split_start+1,...
        % progressStepSize, 400, 80);
ppm.increment();
ppm.delete();

Additionally if you want some progress status update still you can add the following lines:

fprintf('%i voxels to fit\n', numOfVoxels-current_split_start+1);
Add this line before the "for split_start=current_split_start:progressStepSize:numOfVoxels" line.

and 
fprintf('%i voxels done.\n', i * progressStepSize);
within the "if mod(i, progressStepSize)==0" if statement.

Hope this helps.

Matt

Daniel Salinas

unread,
May 18, 2023, 2:17:00 AM5/18/23
to NODDI
Thank you Matt
We had this same problem using a cluster with an older Matlab 2016 and this worked wonderfully on our end!

Reply all
Reply to author
Forward
0 new messages