Code Monkey home page Code Monkey logo

pliman's Introduction

pliman's People

Contributors

olivroy avatar tiagoolivoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pliman's Issues

leaves area without holes

Hello,

I am trying to figure it out how to estimates the areas of the three leaves in the attached files, without taking into account the small holes in the upper leaf.

I use the developement version 2.0.0.

The script I use is basically the following:

I first crop the image to get rid of the borders

leaves.crop <-
    pliman::image_crop(leaves,
                       plot = T)

After screening for index, I choose the R index. It does not discriminate the reference area from leaves, but my idea is to use afterward the function get_measures and select the reference id and its area.

I have tried several set of parameters but the closest output to what I want is the following, trying to play with extension and tolerance parameters. However, this is not totally satisfying as one of the hole is not identified, and two of the leaves are over-segmented. What would be the best strategy to overcome this ?
Thanks

res <- analyze_objects(leaves.crop,
                       index = "R",
                       fill_hull = F,
                       watershed = T,
                       extension = 1, 
                       tolerance = 20,
                       marker = "id",
                       object_size = "large"
                       )

Desbordesia glaucescens_652-PT78_L1-2-3

Release pliman 1.0.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted πŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

issue on image_crop for the CRAN version

Dear Tiago,

thanks for previous answers to my questions (and for this great package).

I have an issue that only appears on the version on CRAN using the image_crop function. I have myself the developement version which does not have this issue. I tried to instal the development version for one of my student but it did no work the reason why I installed the CRAN version.

In any case, here the line of code that provide an error :

pliman::image_crop(leaves,
                       plot = TRUE)

After selecting the two points on the plot to crop the image, he gets this error.

Error in [email protected][w, h, ] : only 0's may be mixed with negative subscripts

I dont know whether this is because he is using the CRAN version.
But when trying to install the development version from gihtub, I have the following error

devtools::install_github("TiagoOlivoto/pliman")

Downloading GitHub repo TiagoOlivoto/pliman@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet, :
download from 'https://api.github.com/repos/TiagoOlivoto/pliman/tarball/HEAD' failed

Attached is the image that causes the error but it seems to be the case for all images.
PH_1

Include checks for mosaic_index2()

Include checks and improve user information on how to install python and gdal_calc.py. Also, translate the current indexes for numpy syntax.

install_github() and pak() installing older version

Hi Tiago,

Thank you for the great work with this package. I'm trying to install its dev version, but I'm afraid that the CRAN version is being installed instead. Could you please check that? Not sure how I can make this issue reproducible, but please let me know if you can grasp something from the information provided.

Thank you in advance.

devtools::install_github("TiagoOlivoto/pliman", force = TRUE)

Downloading GitHub repo TiagoOlivoto/pliman@HEAD
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────
βœ”  checking for file 'C:\Users\diego\AppData\Local\Temp\RtmpIPq3a6\remotes48587a6d2613\TiagoOlivoto-pliman-e0e9c29/DESCRIPTION' ... 
─  preparing 'pliman': (3.8s)
βœ”  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts (620ms)
─  checking for empty or unneeded directories
─  building 'pliman_1.1.0.9000.tar.gz'
   
Installing package into β€˜C:/R/R/library’
(as β€˜lib’ is unspecified)
* installing *source* package 'pliman' ...
** using staged installation
** libs
using C++ compiler: 'G__~1.EXE (GCC) 12.2.0'
using C++11
g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG  -I'C:/R/R/library/Rcpp/include' -I'C:/R/R/library/RcppArmadillo/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RcppExports.cpp -o RcppExports.o
g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG  -I'C:/R/R/library/Rcpp/include' -I'C:/R/R/library/RcppArmadillo/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c code.cpp -o code.o
g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG  -I'C:/R/R/library/Rcpp/include' -I'C:/R/R/library/RcppArmadillo/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c code_polygons.cpp -o code_polygons.o
g++ -shared -s -static-libgcc -o pliman.dll tmp.def RcppExports.o code.o code_polygons.o -fopenmp -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lRlapack -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lRblas -lgfortran -lm -lquadmath -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lR
installing to C:/R/R/library/00LOCK-pliman/00new/pliman/libs/x64
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pliman)
* 
sessionInfo()

R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: Europe/Tallinn
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] miniUI_0.1.1.1      jsonlite_1.8.5      compiler_4.3.0      crayon_1.5.2        promises_1.2.0.1   
 [6] Rcpp_1.0.10         stringr_1.5.0       callr_3.7.3         later_1.3.1         credentials_1.3.2  
[11] fastmap_1.1.1       mime_0.12           R6_2.5.1            curl_5.0.1          htmlwidgets_1.6.2  
[16] desc_1.4.2          profvis_0.3.8       rprojroot_2.0.3     openssl_2.0.6       shiny_1.7.4        
[21] rlang_1.1.1         cachem_1.0.8        stringi_1.7.12      httpuv_1.6.11       fs_1.6.2           
[26] sys_3.4.2           pkgload_1.3.2       memoise_2.0.1       cli_3.6.1           magrittr_2.0.3     
[31] ps_1.7.5            digest_0.6.31       processx_3.8.1      rstudioapi_0.14     xtable_1.8-4       
[36] remotes_2.4.2       devtools_2.4.5.9000 askpass_1.1         lifecycle_1.0.3     vctrs_0.6.2        
[41] prettyunits_1.1.1   glue_1.6.2          urlchecker_1.0.1    sessioninfo_1.2.2   pkgbuild_1.4.1.9000
[46] purrr_1.0.1         usethis_2.2.0       tools_4.3.0         ellipsis_0.3.2      htmltools_0.5.5 

ANALYZING ORTHOMOSAICS IN R WITH PLIMAN PACKAGE -FUNCTION analyze_mosaic is not present in the package

Good morning,

I was watching your video: https://www.youtube.com/watch?v=zROvQKKRPqA (ANALYZING ORTHOMOSAICS IN R WITH PLIMAN PACKAGE).

Finally I could download the package in LINUX, unfortunately I don't see the function analyze_mosaic included. The following mosaic functions are installed: mosaic_crop; mosaic_export; mosaic_index; mosaic_input; mosaic_to_pliman; mosaic_to_rgb; mosaic_view and mosaic_plot.

Can you help me please?

Analyze nearinfrared pictures

Hi !

Thanks for this nice package.
Do you know how I should proceed to use it to measure symptom area from pictures obtained from a Bio-Rad ChemiDoc MP Imager with nearinfrared settings that are black and white? I have troubles using the measure_disease function on those.
po-pi-b4-l2

Thanks for your help !

Florian Rocher

Bug with the function "mosaic_analyze" when the argument "segment_individuals = TRUE"

Hi Tiago

I am using the pliman (latest version) to extract some features about the canopy of citrus plants (area, diameter, etc).
I imported the mosaic and shapefile (made in QGIS) into R without any problem. They are in the same CRS (coordinate reference system).

My mosaic (object orto) looks like this:

print(orto) # 3 camadas: R, G e B
class : SpatRaster
dimensions : 8317, 5725, 3 (nrow, ncol, nlyr)
resolution : 0.01999664, 0.01999765 (x, y)
extent : 252903.9, 253018.4, 7515062, 7515229 (xmin, xmax, ymin, ymax)
coord. ref. : WGS 84 / UTM zone 23S (EPSG:32723)
source : Ortomosaico-citrus-abril-2024.tif
names : red, green, blue

My shapefile (object parcelas) looks like this:

Simple feature collection with 373 features and 3 fields
Geometry type: POLYGON
Dimension: XY
Bounding box: xmin: 252926.2 ymin: 7515102 xmax: 252989.8 ymax: 7515189
Projected CRS: WGS 84 / UTM zone 23S
First 10 features:
fid id Genotype geometry
1 1 1 H4 POLYGON ((252926.7 7515189,...
2 2 2 H6 POLYGON ((252926.4 7515186,...
3 3 3 H10 POLYGON ((252926.4 7515183,...
4 4 4 H39 POLYGON ((252926.9 7515181,...
5 5 5 V3 POLYGON ((252927.1 7515178,...
6 6 6 V6 POLYGON ((252926.8 7515176,...

I am trying to analyze the mosaic with the code below:

mosaic_analyze(mosaic = orto,
r = 1, g = 2, b = 3,
shapefile = parcelas,
include_if = "centroid",
segment_individuals = TRUE,
segment_index = "NGRDI", threshold = 0.08, invert = FALSE,
watershed = TRUE)

However, the following error always happens:

Extracting data from block 1
Error in dplyr::select():
! Can't subset columns that don't exist.
βœ– Column block doesn't exist.
Run rlang::last_trace() to see where the error occurred.

If I click on the last message about the error the following is shown:

rlang::last_trace()
<error/vctrs_error_subscript_oob>
Error in dplyr::select():
! Can't subset columns that don't exist.
βœ– Column block doesn't exist.


Backtrace:
β–†

  1. └─pliman::mosaic_analyze(...)
  2. β”œβ”€dplyr::select(...)
  3. └─dplyr:::select.data.frame(...)
    Run rlang::last_trace(drop = FALSE) to see 18 hidden frames.

rlang::last_trace(drop = FALSE)
<error/vctrs_error_subscript_oob>
Error in dplyr::select():
! Can't subset columns that don't exist.
βœ– Column block doesn't exist.


Backtrace:
β–†

  1. β”œβ”€pliman::mosaic_analyze(...)
  2. β”‚ β”œβ”€dplyr::select(...)
  3. β”‚ └─dplyr:::select.data.frame(...)
  4. β”‚ └─tidyselect::eval_select(expr(c(...)), data = .data, error_call = error_call)
  5. β”‚ └─tidyselect:::eval_select_impl(...)
  6. β”‚ β”œβ”€tidyselect:::with_subscript_errors(...)
  7. β”‚ β”‚ └─rlang::try_fetch(...)
  8. β”‚ β”‚ └─base::withCallingHandlers(...)
  9. β”‚ └─tidyselect:::vars_select_eval(...)
  10. β”‚ └─tidyselect:::walk_data_tree(expr, data_mask, context_mask)
  11. β”‚ └─tidyselect:::eval_c(expr, data_mask, context_mask)
  12. β”‚ └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
  13. β”‚ └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
  14. β”‚ └─tidyselect:::as_indices_sel_impl(...)
  15. β”‚ └─tidyselect:::as_indices_impl(...)
  16. β”‚ └─tidyselect:::chr_as_locations(x, vars, call = call, arg = arg)
  17. β”‚ └─vctrs::vec_as_location(...)
  18. └─vctrs (local) <fn>()
  19. └─vctrs:::stop_subscript_oob(...)
  20. └─vctrs:::stop_subscript(...)
    
  21.   └─rlang::abort(...)
    

I was thinking that the problem shoud be my shapefile. So, I did a small example of shapefile (on the same mosaic) in plimanshiny and tried to run the same code with the "new" shapefile, but the error was shown again.

Helcio

could not find function "mosaic_analyze"

I have successfully installed the pliman packed. Using the code examples for "Counting and measuring plants in a plot", I get an error stating "Error in mosaic_analyze(mo, r = 1, g = 2, b = 3, nrow = 12, segment_individuals = TRUE, :
could not find function "mosaic_analyze"

mosaic_analyze function dissapeared from PLIMAN package overnight

In R when you search for the function it's not appearing anymore (Please see the image I uploaded). From one day to another the function dissapeared. I just discovered that when I tried to run the following script:

res_pot<-mosaic_analyze(pot,

  •                     r=1,g=2,b=3,
    
  •                     nrow=9,
    
  •                     ncol=16,
    
  •                     buffer_row = -0.15, # 15% nΓ£o Γ© considerado entre filas
    
  •                     buffer_col = -0.05, #  5% nΓ£o Γ© considerado entre colunas
    
  •                     plot_index = c("GLI","NGRDI","VARI","BGI"),
    
  •                     summarize_fun = c("mean","stdev"),
    
  •                     plot=FALSE)
    

Error in mosaic_analyze(pot, r = 1, g = 2, b = 3, nrow = 9, ncol = 16, :
não foi possível encontrar a função "mosaic_analyze"
image (1)

No mosaic_analyze funcion

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/ or https://community.rstudio.com/.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.

Brief description of the problem

library(pliman)
> res <- mosaic_analyze(fa,
+                  nrow = 3,  # use 6 if you want to analyze in a single block
+                  ncol = 15,
+                  buffer_row = -0.15,
+                  buffer_col = -0.05,
+                  segment_plot = TRUE,
+                  segment_index = "NDVI", 
+                  plot_index = c("NDVI", "EVI", "NDRE"), 
+                  summarize_fun = c("min", "mean", "max"),
+                  attribute = "coverage")
#Error in mosaic_analyze(fa, nrow = 3, ncol = 15, buffer_row = -0.15, buffer_col = -0.05,  : 
 # ζ²‘ζœ‰"mosaic_analyze"θΏ™δΈͺ函数

analyse_object error

Hello

I am testing this very promising package.

I have an error with one photo attached, using the function analyze_objects

library(pliman)

leaves <- image_import("IMG-2581.jpg", plot = TRUE)

count <- analyze_objects(leaves,
                         marker = "id")

IMG-2581

Error in EBImage::distmap(img2) : 'x' shouldn't contain any NAs

Anything I am doing wrong ?

Thanks

get_measures outputs

I have some difficulty to interpret the outputs of the get_measures function data.frame.

For example, what are the differences between diam_max, major_axis and length ?

Likewise, differences between diam_min, minor_axis and width ?

I assume some of these measures refers to the best-fitted ellipse ?

Perhaps explanations are somewhere in the online documentation and I missed it.

Thanks for the clarification.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.