How to make input points into a double array?

8 vues (au cours des 30 derniers jours)
CD11
CD11 le 22 Juil 2020
Commenté : CD11 le 28 Août 2020
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

Réponse acceptée

Raunak Gupta
Raunak Gupta le 12 Août 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.
  1 commentaire
CD11
CD11 le 28 Août 2020
Thank you this worked!!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by