help > Welcome to Help
Showing 1-12 of 12 posts
Display:
Results per page:
Sep 11, 2015  12:09 PM | Sungho Tak - Wellcome Trust Centre for Neuroimaging, UCL
Welcome to Help
Welcome to Help
Sep 22, 2015  12:09 PM | harleen chhabra - National Institute of Mental Health and Neurosciences (NIMHANS)
RE: Welcome to Help
Hello,
I am a PhD scholar from India. I am using NirScout for fNIRS data collection. I tried analyzing one of the data sets but got an error while performing GLM-fNIRS for the 1st level analysis step "specify conditions using a file" (irrespective of choosing Yes or No) . I tried 3 different versions of matlab (2013b, 2014b and 2015b) but the same error persisted. Also i tried analyzing the sample data that is provided by the software but still the error occurred. 
I am copying the error messages below. It will be very helpful if you could help me solve this problem.

% Error while "specify conditions using a file" selected as No
Error using uicontrol
While setting the 'Max' property of UIControl:
Value must be numeric or logical.
Error in spm_input (line 1286)
h = uicontrol(Finter,'Style','Pushbutton',...
Error in spm_fnirs_get_ons_ui (line 56)
v = spm_input('number of conditions/trials',2,'w1');
Error in spm_fnirs_specify1st_ui (line 107)
U = spm_fnirs_get_ons_ui;
Error in spm_fnirs>push_specify_Callback (line 75)
spm_fnirs_specify1st_ui;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in spm_fnirs (line 25)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)spm_fnirs('push_specify_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback

% Error while "specify conditions using a file" selected as Yes and .mat loading the generated with spm_fnirs
Undefined variable durations.
Error in spm_fnirs_specify1st_ui (line 104)
U(i).dur = durations{1,i}(:);
Error in spm_fnirs>push_specify_Callback (line 75)
spm_fnirs_specify1st_ui;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in spm_fnirs (line 25)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)spm_fnirs('push_specify_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback

Regards,
Harleen Chhabra
PhD scholar,
NIMHANS, India
Sep 22, 2015  05:09 PM | Guilherme A. Zimeo Morais - NIRx Medical Technologies
RE: Welcome to Help
Hello Harleen,

As I was also trying to perform the 1st level analysis with the NIRx demo dataset, I have run into the same issues you described. And I believe I have found the solution for both of them:

i) Error by choosing "No" for "specify conditions using a file":
Quickly looking into the code (in particular the line 1286) that generated that error, and comparing with previous lines that also set the properties of UIControl, it seems that the variables to be used for property 'Max' and 'UserData' were exchanged. If you replace these variables, the code should work just fine. After doing this, lines 1286-1294 should look like following:

h = uicontrol(Finter,'Style','Pushbutton',...
'String',deblank(Labels(i,:)),...
'Max',i,...
'ToolTipString',sprintf('%s\n%s',deblank(Labels(i,:)),str),...
'Tag',Tag,...
'UserData',hPrmpt,...
'BackgroundColor',COLOUR,...
'Callback',cb,...
'Position',[RRec(1)+(i-1)*dX+1 RRec(2) dX-2 RRec(4)]);

ii) Error by choosing "Yes" for "specify conditions using a file":
Here the issue occurs for a different reason, namely the fact that the multiple_conditions.mat file provided does not have the field "durations", which is required for the SPM modelling. I have checked the header file and, although I am not particularly familiar with the experiment paradigm used for this example dataset, it seems that trigger marker 1 has been used for onsets, while trigger marker 2 for the end of the task (or the beginning of the rest period following that). The only flaw with this theory would be that there is actually an extra marker #1, but looking the pattern of all the other triggers received, it seems that this one should not be there. So considering that all the assumptions made so far here are indeed true, one can actually obtain the durations field missing by calculating onsets{2} - onsets{1}, and then delete the onsets{2} field. After doing so, I created a new file (multiple_conditions_new.mat  - attached) and loaded this to specify the conditions. This worked fine and I was able to define all the other parameters for the 1st level analysis.

I believe we should wait on the feedback from the developers to make sure that all I have written here is indeed correct (mainly regarding the experiment design of the motor example).

Best regards,
Guilherme
Sep 22, 2015  05:09 PM | harleen chhabra - National Institute of Mental Health and Neurosciences (NIMHANS)
RE: Welcome to Help
Hi Guilherme,

Thank you for such an elaborate explanation. I was not able to figure out the solution for the first error but as you correctly mentioned i did try creating a new multiple_conditions.mat file since duration variable was not getting created in the file. Unlike your approach i made it from the scratch using a simple code that defines all the condition names, onsets and durations (like that in Nirslab software, if you are familiar with the software) to create multiple_conditions.mat file and it too worked. But, as you said we should wait on the feedback from the developers and see what solution they have for this.

But after this step i got stuck at the next step where regression conditions are to be specified and got a similar uicontrol error, i guess its the problem with the matlab code and needs some correction. Did you also face the same problem or am i doing something wrong. It will be of great help if you can shed light on this query also.

Regards,
Harleen Chhabra
Sep 23, 2015  10:09 AM | Sungho Tak - Wellcome Trust Centre for Neuroimaging, UCL
RE: Welcome to Help
Dear Harleen, 

Regarding the GUI problem, could you use attached codes instead of modifying the `spm_input.m' code? 
Please make sure that the toolbox is compatible with the SPM12 software.
If the same error occurs, please email me with error messages. 

Regarding the `multiple_conditions.mat' file, `names' and `onsets' are read from *.hdr file. If you would like to specify experimental design using `multiple_conditions.mat' file, please add epoch or event duration to the mat file, as Guilherme suggested. See page 14 in the manual for more details. 

Best wishes, 
Sungho
Attachment: updates_spec.zip
Sep 24, 2015  06:09 PM | Guilherme A. Zimeo Morais - NIRx Medical Technologies
RE: Welcome to Help
Dear Sungho,

Thank you for the very quick response. I have tested the codes you provided us with and these work fine without having to change the spm_input.m file.

Could you please send me more information about the experiment paradigm performed during the recording of the motor dataset example?

Also, I was wondering whether it is possible to export the individual analysis results from NIRS-SPM to SPM12 so I can proceed with the second level analysis of my data?

Best regards,
Guilherme
Sep 26, 2015  05:09 AM | harleen chhabra - National Institute of Mental Health and Neurosciences (NIMHANS)
RE: Welcome to Help
Thank you Dr. Sungho for such a spontaneous response.  The updated codes are working without any error message.

The other problem that i am facing is the error i get while running the MARA during temporal pre-processing. The error is as following:
Apply a temporal filter to hemoglobin changes...
Undefined function or variable 'smooth'.

Error in spm_fnirs_MARA>MARemoval (line 258)
S = smooth(segments{2,i},alpha,'loess');
Error in spm_fnirs_MARA (line 63)
[x_n] = MARemoval(segments,alpha);
Error in spm_fnirs_preproc (line 93)
Y(:, indx_m(i)) = spm_fnirs_MARA(Y(:, indx_m(i)), P.fs, th(indx_m(i)), L(indx_m(i)) ,
alpha(indx_m(i)));
Error in spm_fnirs_temporalpreproc_ui (line 155)
[fy, P] = spm_fnirs_preproc(y, P);
Error in spm_fnirs>push_temporal_Callback (line 69)
spm_fnirs_temporalpreproc_ui;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in spm_fnirs (line 25)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)spm_fnirs('push_temporal_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback

It will be of great help if you can shed light on this very error also. Without running MARA script rest of the analysis till the end is working fine.

Sincerely,
Harleen
Sep 28, 2015  03:09 PM | Sungho Tak - Wellcome Trust Centre for Neuroimaging, UCL
RE: Welcome to Help
Dear Harleen, 

`Smooth' is a function of Curve Fitting Toolbox in MATLAB. Therefore, you need to install the Curve Fitting Toolbox into MATLAB, to use the MARA. Please contact Dr Felix Scholkmann who is an author of MARA if you need more detailed information on MARA: Felix.Scholkmann AT usz.ch 

Best wishes, 
Sungho
Sep 28, 2015  04:09 PM | Sungho Tak - Wellcome Trust Centre for Neuroimaging, UCL
RE: Welcome to Help
Dear Guilherme, 

I believe that it is necessary to have one paradigm for the manual and we already provided users with the Stroop paradigm for testing the toolbox. I would like to provide the motor task/imagery data with experimental paradigm for testing the DCM-fNIRS analysis in the future. 

Regarding the second question (second level analysis), I am currently working on a method for exporting results to SPM12 and will be in contact with you again soon. 

Best wishes, 

Sungho
Oct 8, 2015  11:10 AM | harleen chhabra - National Institute of Mental Health and Neurosciences (NIMHANS)
RE: Welcome to Help
Dr. Sungho,

I have been working with my fNIRS analysis and the software is working smoothly.

I could like to know if NIR-SPM supports analysis for resting state data in its current version or will in future there will be a provision for the same.

Sincerely,
Harleen Chhabra
Oct 11, 2017  05:10 PM | Geoff Green - The Ohio State University
RE: Welcome to Help
I keep getting errors when following the manual for the "spatial registration of NIRS channel locations" section, specifically the "using 3D digitizer" subsection starting on page 22 of the manual.

When I load the "origin" and "others" files and select "registration" button, then click "ok" in the next window, I continuously get errors:
___________________________________________________________
Subscript indices must either be real positive integers or logicals.
Error in nfri_mni_estimation_modified>AffineEstimation4 (line 581)
BrainColorMap(Area(j, 6), :) * BCratio;
Error in nfri_mni_estimation_modified>BtnFcnCheck (line 215)
AffineEstimation4(loadedData);
Error while evaluating DestroyedObject Callback.
_____________________________________________________________-
As a result, when the image of the brain appears, it is bare. None of the channels, optodes, nor red, green, pink, and white dots appear on the head/cortical surfaces. This stops further analysis of the data.

Additionally, when trying to convert NIRx data into data compatible for NIRS_SPM (pg 8 in manual) what is the purpose because when the code converts the optical density changes into hemodynamic measurements, the new data is saved in a format the nirs spm cannot read.

This code is unchanged, downloaded directly from the NIRS SPM website, so I am not sure why these errors are coming up.

Thank you in advance.  Any tips/advice helps
Dec 22, 2018  12:12 PM | fakun chen
RE: Welcome to Help
Hi Geoff

I'm facing the same problem that you have had.

Attempted to access BrainColorMap(-16,:); index must be a positive integer or logical.

Error in nfri_mni_estimation_modified>AffineEstimation4 (line 580)
PlotColor = MeanPointColor * MCratio + ...
Error in nfri_mni_estimation_modified>BtnFcnCheck (line 215)
AffineEstimation4(loadedData);
Error while evaluating uicontrol Callback

How did you figure it out?

Many thanks for any help from you!