Hello, thank you for the great scikit-image library. I have encountered an error when using the function skimage.filters.threshold_local: threshold = skimage.filters.threshold_local(data, 7, method='gaussian', offset=0, mode='nearest') File "/mnt/depot64/NPsoftware/simnibs/charm_dev/charm_env/lib/python3.8/site-packages/skimage/filters/thresholding.py", line 209, in threshold_local check_nD(image, 2) File "/mnt/depot64/NPsoftware/simnibs/charm_dev/charm_env/lib/python3.8/site-packages/skimage/_shared/utils.py", line 320, in check_nD raise ValueError(msg_incorrect_dim % (arg_name, '-or-'.join([str(n) for n in ndim]))) ValueError: The parameter `image` must be a 2-dimensional array For my understanding, the 'image' can be N-dimensional, but why does it give me the error? Do I misunderstand something? In my case, the 'data' is a 3D image with dtype of 'float32', and the element values range from '-2000' to '+2000'. Thank you in advance. Kind regards, Fang
Hi Fang, The *threshold_local* function has n-dimensional image support in our development branch, but not in the current 0.18.x releases. It may be the documentation you are looking at is for the development version. You can use https://scikit-image.org/docs/stable/ for docs corresponding to the most recent release. On Fri, Aug 6, 2021 at 8:54 AM Fang CAO <fang.t.cao@gmail.com> wrote:
Hello,
thank you for the great scikit-image library. I have encountered an error when using the function skimage.filters.threshold_local:
threshold = skimage.filters.threshold_local(data, 7, method='gaussian', offset=0, mode='nearest')
File "/mnt/depot64/NPsoftware/simnibs/charm_dev/charm_env/lib/python3.8/site-packages/skimage/filters/thresholding.py", line 209, in threshold_local check_nD(image, 2)
File "/mnt/depot64/NPsoftware/simnibs/charm_dev/charm_env/lib/python3.8/site-packages/skimage/_shared/utils.py", line 320, in check_nD raise ValueError(msg_incorrect_dim % (arg_name, '-or-'.join([str(n) for n in ndim])))
ValueError: The parameter `image` must be a 2-dimensional array
For my understanding, the 'image' can be N-dimensional, but why does it give me the error? Do I misunderstand something? In my case, the 'data' is a 3D image with dtype of 'float32', and the element values range from '-2000' to '+2000'. Thank you in advance.
Kind regards, Fang _______________________________________________ scikit-image mailing list -- scikit-image@python.org To unsubscribe send an email to scikit-image-leave@python.org https://mail.python.org/mailman3/lists/scikit-image.python.org/ Member address: grlee77@gmail.com
Thank you, Gregory, for the quick response. I will wait for the new release then. Again, thank you for developing the nice toolbox. Kind regards, Fang Cao Postdoc at Danish Research Center for Magnetic Resonance Copenhagen University Hospital Hvidovre, DK-2650 Hvidovre, Denmark & Department of Health Technology Technical University of Denmark DK-2800 Kgs. Lyngby, Denmark On Fri, Aug 6, 2021 at 4:21 PM Gregory Lee <grlee77@gmail.com> wrote:
Hi Fang,
The *threshold_local* function has n-dimensional image support in our development branch, but not in the current 0.18.x releases. It may be the documentation you are looking at is for the development version. You can use https://scikit-image.org/docs/stable/ for docs corresponding to the most recent release.
On Fri, Aug 6, 2021 at 8:54 AM Fang CAO <fang.t.cao@gmail.com> wrote:
Hello,
thank you for the great scikit-image library. I have encountered an error when using the function skimage.filters.threshold_local:
threshold = skimage.filters.threshold_local(data, 7, method='gaussian', offset=0, mode='nearest')
File "/mnt/depot64/NPsoftware/simnibs/charm_dev/charm_env/lib/python3.8/site-packages/skimage/filters/thresholding.py", line 209, in threshold_local check_nD(image, 2)
File "/mnt/depot64/NPsoftware/simnibs/charm_dev/charm_env/lib/python3.8/site-packages/skimage/_shared/utils.py", line 320, in check_nD raise ValueError(msg_incorrect_dim % (arg_name, '-or-'.join([str(n) for n in ndim])))
ValueError: The parameter `image` must be a 2-dimensional array
For my understanding, the 'image' can be N-dimensional, but why does it give me the error? Do I misunderstand something? In my case, the 'data' is a 3D image with dtype of 'float32', and the element values range from '-2000' to '+2000'. Thank you in advance.
Kind regards, Fang _______________________________________________ scikit-image mailing list -- scikit-image@python.org To unsubscribe send an email to scikit-image-leave@python.org https://mail.python.org/mailman3/lists/scikit-image.python.org/ Member address: grlee77@gmail.com
_______________________________________________ scikit-image mailing list -- scikit-image@python.org To unsubscribe send an email to scikit-image-leave@python.org https://mail.python.org/mailman3/lists/scikit-image.python.org/ Member address: fang.t.cao@gmail.com
participants (2)
-
Fang CAO
-
Gregory Lee