Effacer les filtres
Effacer les filtres

How to put filter size for option NeighborhoodSize in adaptthresh function

2 vues (au cours des 30 derniers jours)
Dear all, I want to use adaptthresh for volume segmentation as method, But I dont know hoe to put the size of filter for NeighborhoodSize
I have code below,
The image data as attached.
clear all
close all
[spect map]=dicomread('I-1312568N1.dcm');
info = dicominfo('I-1312568N1.dcm');
T = adaptthresh(spect,0.000000000000001, "NeighborhoodSize","75x75");
BW = imbinarize(spect,T);
figure, imshow3D(BW)
Error using validateThreeDFilterSize
Expected filterSize to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64
Error in images.internal.validateThreeDFilterSize (line 8)
validateattributes(filterSize_, {'numeric'},...
Error in adaptthresh>validateFilterSize (line 335)
filtSize = images.internal.validateThreeDFilterSize(filtSize);
Error in adaptthresh>parseInputs (line 302)
options.(ParamNames{idx}) = validate(Value,1);
Error in adaptthresh (line 135)
[I,options] = parseInputs(I, args{:});

Réponse acceptée

Image Analyst
Image Analyst le 15 Jan 2023
Help says "Size of neighborhood used to compute local statistic around each pixel, specified as a positive odd integer or a 2-element vector of positive odd integers." so you need an odd integer, OR a 2 element vector, like
% Window will be 75 x 75
T = adaptthresh(spect, 0.000000000000001, "NeighborhoodSize", 75);
% OR specify both width and height independently
T = adaptthresh(spect, 0.000000000000001, "NeighborhoodSize", [75, 75]);

Plus de réponses (0)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by