adalca / neurite

Neural networks toolbox focused on medical image analysis
Apache License 2.0
335 stars 67 forks source link

Error cannot provide both bin centers and nb_bins, while only providing bin centers #67

Open zozo19999 opened 1 year ago

zozo19999 commented 1 year ago

Hi, I'm trying to use ne.metrics.MutualInformation, I provide the function only bin centers and not number of bins, and I receive the error "Error cannot provide both bin centers and nb_bins".

If I only provide the nb_bins parameter I don't receive this error. My assumption for the root cause for the problem is in the class MutualInformation, when defining the bin_centers it redifines the number of bins by using nb_bins = bin_centers.shape[0] (line 95). And when it runs self.quanitize (line 315) it sees that both nb_bins and bins_centers are not None and I receive this error. Can please someone help, Maybe the script needs to be fixed? err

adalca commented 1 year ago

Sorry i am seeing this late. I think the problem is that soft_quantize has a default of nb_bins =16, no? Can you force-set this to None? This is probably bad design on our part