【问题标题】:Not enough input arguments using radiomics package使用 radiomics 包的输入参数不足
【发布时间】:2019-12-12 16:26:58
【问题描述】:

我正在尝试使用以下代码使用 radiomics 包 (https://www.mathworks.com/matlabcentral/fileexchange/51948-radiomics) 运行 GLCM:

volume = double(rgb2gray(imread('http://www.cs.sjsu.edu/~bruce/images/fall_2016_cs160/lectures/eye_pupil_tracking/grayscale_eye_cropped_to_bounding_box.png')));
mask = ones(size(volume,1),size(volume,2));
[ROIonly,levels] = prepareVolume(volume,mask,'Other','Matrix','Uniform',32);
[GLCM] = getGLCM(ROIonly,levels);

我收到以下错误:

输入参数不足。

prepareVolume 中的错误(第 110 行) if ~strcmp(textType,'Global') && ~strcmp(textType,'Matrix')

无标题错误(第 7 行) [ROIonly,levels] = prepareVolume(volume,mask,'Other','Matrix','Uniform',32);

我该如何解决?

【问题讨论】:

    标签: matlab input


    【解决方案1】:

    prepareVolume 的函数定义如下:

    prepareVolume(volume,mask,scanType,pixelW,slices,R,scale,textType,quantAlgo,Ng)
    

    第 8 个输入是 textType

    你调用时只提供了6个输入

    prepareVolume(volume,mask,'Other','Matrix','Uniform',32);
    

    所以错误准确地描述了哪里出了问题

    输入参数不足。

    只有第 9 和第 10 个输入是可选的,由该函数 if nargin > 8 中的第 3 个实际代码行捕获。但是,第一行代码使用 textType 并始终假定它已作为输入传递。

    【讨论】:

    • 'Matrix' 是文本类型。如果情况是我必须填写所有 8-10 个参数,我希望使用的 png 文件的 pixelW,slices,R,scale 是多少?
    • 我不知道,这取决于您想做什么,您必须了解输入的作用并将其应用于您想要实现的目标! MATLAB 输入按顺序传递,当前 'Matrix'pixelW 输入,因为您已将其作为第四个输入传递
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-17
    相关资源
    最近更新 更多