Matlab: DIPimage shadows Matlab toolbox functions #174
-
I am using DIPimage 3.x within Matlab R2024a and want to use the Matlab Toolbox function "cluster" to do hierarchical clustering of multidimensional data. Unfortunately the toolbox function is shadowed by the DIPimage toolbox.
Is there an easy way to call such shadowed function? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Take a look at the answer at the bottom here: https://diplib.org/diplib-docs/sec_dum_faq.html#sec_dum_faq_usage_select Name clashes are inevitable in a language without namespaces, which MATLAB was when we created DIPimage. We avoided using names of existing functions in the toolboxes most relevant to image processing, but that's a moving target, they keep adding new functions and new toolboxes. MATLAB does have namespaces nowadays, but adding a namespace to the DIPimage toolbox is akin to changing all function names, which we don't want to do for backwards-compatibility. So the only thing we can do is show how to call a shadowed function: change directories first: old_dir = cd('C:\Program Files\MATLAB\R2024a\toolbox\stats\stats')
cluster(...)
cd(old_dir) For generic code you need to find that path name first, which involves calling Sorry, this is not the most beautiful solution. :( |
Beta Was this translation helpful? Give feedback.
-
Dear Cris, thank you so much for your prompt reply. |
Beta Was this translation helpful? Give feedback.
Take a look at the answer at the bottom here: https://diplib.org/diplib-docs/sec_dum_faq.html#sec_dum_faq_usage_select
Name clashes are inevitable in a language without namespaces, which MATLAB was when we created DIPimage. We avoided using names of existing functions in the toolboxes most relevant to image processing, but that's a moving target, they keep adding new functions and new toolboxes. MATLAB does have namespaces nowadays, but adding a namespace to the DIPimage toolbox is akin to changing all function names, which we don't want to do for backwards-compatibility.
So the only thing we can do is show how to call a shadowed function: change directories first: