How to make input points into a double array?
11 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Raunak Gupta
on 12 Aug 2020
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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!