Closed LanceSab closed 2 years ago
Dear Qing Zhao,
Thank you for letting us know about the issue!
I have looked into it, and I have found the reason for your encountered problem. I assume you are using DIPlib 3.X. The reason is that the newest releases of DIPlib include a function called ‘cluster’. The problem is that MATLAB itself also has function ‘cluster’, with the same name. The code for demo_classification actually requires the MATLAB build-in ‘cluster’ function, and not the DIPlib one. I think the problem in your case is that MATLAB choses the DIPlib function, which gives an error.
My proposed solution is to tell MATLAB to first look in its own functions, before consulting the DIPlib function. You can do this via ‘Home>Set Path’ in the MATLAB toolbar. This menu shows you a list of folders that MATLAB will consult top-to-bottom searching for functions. After you have initialised DIPlib, the DIPlib folders will appear on top of this list. You have to select the DIPlib folders and then click ‘Move to Bottom’. This will make sure MATLAB first searches is own functions before consulting the DIPlib functions.
Other (less favourable) solutions would be to: 1) revert DIPlib to an older version (<3.0), or 2) only initialise DIPlib for plotting, after the classification has been performed.
Please let me know if one of these solutions doesn’t work for you!
Kind regards, Teun
Dear Teun,
Thank you so much for the reply. It works now.
Best, Qing
发件人: TeunHuijben @.> 发送时间: 2022年4月4日 20:13 收件人: imphys/smlm_datafusion2d @.> 抄送: Qing Zhao @.>; Author @.> 主题: Re: [imphys/smlm_datafusion2d] eigenApproach parameter (Issue #9)
Dear Qing Zhao,
Thank you for letting us know about the issue!
I have looked into it, and I have found the reason for your encountered problem. I assume you are using DIPlib 3.X. The reason is that the newest releases of DIPlib include a function called ‘cluster’. The problem is that MATLAB itself also has function ‘cluster’, with the same name. The code for demo_classification actually requires the MATLAB build-in ‘cluster’ function, and not the DIPlib one. I think the problem in your case is that MATLAB choses the DIPlib function, which gives an error.
My proposed solution is to tell MATLAB to first look in its own functions, before consulting the DIPlib function. You can do this via ‘Home>Set Path’ in the MATLAB toolbar. This menu shows you a list of folders that MATLAB will consult top-to-bottom searching for functions. After you have initialised DIPlib, the DIPlib folders will appear on top of this list. You have to select the DIPlib folders and then click ‘Move to Bottom’. This will make sure MATLAB first searches is own functions before consulting the DIPlib functions.
Other (less favourable) solutions would be to: 1) revert DIPlib to an older version (<3.0), or 2) only initialise DIPlib for plotting, after the classification has been performed.
Please let me know if one of these solutions doesn’t work for you!
Kind regards, Teun
― Reply to this email directly, view it on GitHubhttps://github.com/imphys/smlm_datafusion2d/issues/9#issuecomment-1087917070, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATRRYU4I6LRPSCZKMRENEUTVDM5NFANCNFSM5R7PVR3Q. You are receiving this because you authored the thread.Message ID: @.***>
Perfect, thank you for letting us know!
I have an issue when I run the demo_classification.m file. Here is the error message I got.
Error using dip_segmentation Unsigned integer value expected in function: dip::uint dml::GetUnsigned(const mxArray*) (~/opt/diplib/include/dip_matlab_interface.h at line number 158)
Error in cluster (line 48) [varargout{:}] = dip_segmentation('cluster',varargin{:});
Error in eigenApproach (line 36) c3 = cluster(linkage(weights(:,1),'average'),'maxClust',C);
Error in demo_classification_withoutAll2All (line 132) classes_merged = eigenApproach(classes_aligned,C,width);