[Homer-users] Problem in using PCA Filter

David Boas dboas at nmr.mgh.harvard.edu
Mon Mar 18 08:53:26 EDT 2013
Search archives:

Sorry I missed this before. C is transpose(d) * d where d is the data matrix where each column is another channel of data. If you have inf in one channel, it means that a channel has intensities of 0 or less which when converted to delta OD will likely become inf. I suggest you use prune channels to disable any channels with intensity below a certain threshold. This will exclude those channels from the PCA and you shouldn't get the inf problem.

I've added a check to display a warning if there are any infs passed in y to the PCA.

David





On Mar 17, 2013, at 9:06 PM, Rishabh Gupta <grishabhg at gmail.com> wrote:

> Hi David, 
> 
> First of all thanks a lot for answering my doubt.
> 
> I have tried varying nSV many times ranging from 1,2, etc. and also values less than 1, but it always shows this error. I have 45 channels in total. I checked the code where you calculate the SVD (in the enPCA filter script), there the SVD function takes in 'c' as the input variable but somehow one of the columns of 'c' matrix has Inf or -Inf. Can you identify what must be going wrong? 
> 
> Thanks 
> 
> Rishabh 
> 
> On Sun, Mar 17, 2013 at 1:07 PM, David Boas <dboas at nmr.mgh.harvard.edu> wrote:
>> What is the input that you put in for the nSV for the PCA options? 
>> 
>> The input for nSV should be an integer n, where n is typically 1, 2, or 3 and must be less than or equal to the total number of data channels that you have. nSV can also be a number less than 1 in which case the PCA will remove just enough components from the data to remove less than n*100 % of the variance in the data. 
>> 
>> For motion correction, you only need to enter one number for nSV and this tells the PCA filter to apply it to all channels at the same time. 
>> 
>> From the error that you are reporting, it seems like you have not entered a valid number for nSV.
>> 
>> 
>> 
>> 
>> On 3/17/13 1:13 AM, Rishabh Gupta wrote:
>>> Hi Everyone, 
>>> 
>>> I am using NIRx NIRSScout system for my experiments and I was using Homer2 for the analysis of my signals. In my process stream I have the PCA Filter for motion correction but every time I run it it gives an error saying: " ??? Error using ==> svd    Input to SVD must not contain NaN or Inf." Did anyone else encounter the same problem? Could anyone please let me know how to troubleshoot this error? 
>>> 
>>> ERROR MESSAGE:
>>> 
>>> ??? Error using ==> svd
>>> Input to SVD must not contain NaN or Inf.
>>> 
>>> Error in ==> enPCAFilter at 86
>>>         [V,St,foo] = svd(c);
>>> 
>>> Error in ==> EasyNIRS_Process at 88
>>>         eval( fcall );
>>> 
>>> Error in ==> EasyNIRS>runNIRSsignalProcess at 971
>>> [procResult procInput err] = EasyNIRS_Process(hmr);
>>> 
>>> Error in ==> EasyNIRS>popupmenuNIRSsignalProcess_Callback at 1382
>>>         [procResult err] = runNIRSsignalProcess(iGrp,iSubj,iRun,handles);
>>> 
>>> Error in ==> gui_mainfcn at 96
>>>         feval(varargin{:});
>>> 
>>> Error in ==> EasyNIRS at 43
>>>     gui_mainfcn(gui_State, varargin{:});
>>> 
>>> Error in ==>
>>> @(hObject,eventdata)EasyNIRS('popupmenuNIRSsignalProcess_Callback',hObject,eventdata,guidata(hObject))
>>> 
>>> 
>>> Thanks a lot.
>>> 
>>> 
>>> Rishabh Gupta
>>> 
>>> 
>>> _______________________________________________
>>> Homer-users mailing list
>>> Homer-users at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/homer-users
>> 
>> 
>> _______________________________________________
>> Homer-users mailing list
>> Homer-users at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/homer-users
>> 
>> 
>> The information in this e-mail is intended only for the person to whom it is
>> addressed. If you believe this e-mail was sent to you in error and the e-mail
>> contains patient information, please contact the Partners Compliance HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you in error
>> but does not contain patient information, please contact the sender and properly
>> dispose of the e-mail.
> 
> _______________________________________________
> Homer-users mailing list
> Homer-users at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/homer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/homer-users/attachments/20130318/f6cff4e6/attachment.html 


More information about the Homer-users mailing list