How to make input points into a double array?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
CD11
el 22 de Jul. de 2020
Comentada: CD11
el 28 de Ag. de 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
0 comentarios
Respuesta aceptada
Raunak Gupta
el 12 de Ag. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!