How to make input points into a double array?
11 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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!