필터 지우기
필터 지우기

How to make input points into a double array?

조회 수: 10 (최근 30일)
CD11
CD11 2020년 7월 22일
댓글: CD11 2020년 8월 28일
I am using a local file called aMaSiNe to analyze images as a test run. The code is running well, but I keep getting a notification that "the input points must be a double array." I'm not sure how to adjust this. I'll attach the error and code below for reference. Any help would be much appreciated. Thanks.
Error using alphaShape/inShape
The input points must be a double array.
Error in STEP_5_Transform_and_ROI_drawing (line 374)
out_bnd=inShape(out_bnd_alpha,cell_detected_all(:,2),cell_detected_all(:,1));
Code:
%%% detect cells across the whole slice image
cell_detected_all = round([cell_warped_x, cell_warped_y]);
if ~isempty(cell_detected_all)
out_bnd_alpha = ref_boundarypad_0809_step5( img_warped_no_scale, xy_pix/xy_pix_resc_factor );
out_bnd=inShape(out_bnd_alpha,cell_detected_all(:,2),cell_detected_all(:,1));
cell_detected_all=cell_detected_all(~out_bnd,:);
end

채택된 답변

Raunak Gupta
Raunak Gupta 2020년 8월 12일
Hi David,
The inShape works only for numeric data type double-precision and I guess the cell_detected_all is not present in double format. So, you can convert to double array as follows.
cell_detected_all = round([cell_warped_x, cell_warped_y]);
if ~isempty(cell_detected_all)
out_bnd_alpha = ref_boundarypad_0809_step5( img_warped_no_scale, xy_pix/xy_pix_resc_factor );
out_bnd=inShape(out_bnd_alpha,double(cell_detected_all(:,2)),double(cell_detected_all(:,1)));
cell_detected_all=cell_detected_all(~out_bnd,:);
end
This will clear current error message.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by