mattocci27 / leafarea Goto Github PK
View Code? Open in Web Editor NEWAn interface for the image processing program ImageJ, which allows a rapid digital image analysis for particle sizes.
An interface for the image processing program ImageJ, which allows a rapid digital image analysis for particle sizes.
Hi there,
I have been using the run.ij command as follows:
run.ij(path.imagej = NULL, set.memory = 4, set.directory,
distance.pixel = 2475.6, known.distance = 21, trim.pixel = 20,
low.circ = 0, upper.circ = 1, low.size = 0.1,
upper.size = "Infinity", prefix = "\.|-", log = F,
check.image = F, save.image = F)
The area function is working well and returns this:
run.ij(path.imagej = NULL, set.memory = 4, set.directory,
distance.pixel = 2475.6, known.distance = 21, trim.pixel = 20,
low.circ = 0, upper.circ = 1, low.size = 0.1,
upper.size = "Infinity", prefix = "\\.|-", log = F,
check.image = F, save.image = F)
** These are scans from pieces of paper of known size to check
How do I add the perimeter to this as well? I had a look at the 'adding perim' section but I'm confused sorry.
Cheers
Dear Mr. Masatoshi Katabuchi,
I have used your R package LeafArea.
I used images JPEG of zuquini leaves for estimat leaf area in the 2017 with succefull.
But now, in 2018, i am with problem and I have not found a solution yet.
I am doing the same way and not is ok.
If you can help me, I'd appreciate it.
Thanks
The error is:
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables
My codes son:
library(LeafArea)
run.ij(path.imagej = NULL, set.memory = 6, 'C:/Foto/Bloco1/BRQ1B1',distance.pixel = 37.2175,
known.distance = 1, trim.pixel = 500, low.circ = 0, upper.circ = 1,
low.size = 5, upper.size = "Infinity", prefix = "\\.|-",log=F,
check.image=F,save.image=T)
C:\Users\gusta\Documents>pushd C:\Program Files\ImageJ\
C:\Program Files\ImageJ>jre\bin\java -jar -Xmx6g ij.jar -batch C:\Users\gusta\AppData\Local\Temp\RtmpSGqBHD\macro10446825408b.txt C:/Foto/Bloco1/BRQ1B1/
Perim. XStart YStart
1 201.767 1741 579
C:\Program Files\ImageJ>pause
Press any key to continue. . .
C:\Program Files\ImageJ>exit
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric variables
I'm using this package (specifically the dev version with parameter) for automated extraction of leaf trait data but recently ran into an error that I have been unable to solve. I've looked through the other threads and seen some troubleshooting that was recommended for a similar problem, so I tried those but it didn't help. I've used this package for months without issue but until recently it stopped working and I'm unsure why. Here is what I have tried thus far:
Here's an image of the error I get when I try to run it.
The error I am getting in the console is:
Error in [.data.frame
(X[[i]], ...) : undefined columns selected
Dear Mr. Masatoshi Katabuchi,
I am using your package to analyze the area of six rice leaves in a figure.
The result generated by your package is 97.389, but the results from ImageJ by manual analysis is 1076.088.
So I do not keno which one is right.
This is the code I used in the analysis.
res <- run.ij(path.imagej = 'E:/ImageJ/ImageJ',
set.directory = 'C:/Users/Administrator/Desktop/test/')
Any reply is appreciated.
Thank you!
For Linux, where for example ImageJ standalone is in a directory ~/ImageJ
, when specifying the ImageJ path in run_ij
the documentation gives the impression path.imagej
should be ~/ImageJ
, but the function run_ij
appends ImageJ
to the path, giving error Specify the correct path to ImageJ
.
Maybe could make it clear in the documentation "path to directory containing ImageJ directory" or adjust the run_ij
function:
unix.check <- Sys.info()["sysname"]
if (unix.check == "Linux") {
if (file.exists(paste(path.imagej, "ij.jar",
sep = "")) != T & file.exists(paste(path.imagej, "ij.jar", sep = "/")) != T) {
warning("Specify the correct path to ImageJ")
return("ImageJ not found")
}
}
Dear Dr. Katabuchi,
I've found a small bug caused by a change in filepath in the most recent ImageJ. After receiving the "ImageJ not found" error, I discovered that more accurately, Java isn't found. Your code locates Java in "Contents/Resources/Java/ij.jar"; however, it now resides in "Contents/Java/ij.jar". My work around is to move the Java file into Resources which allows the code to run, although it still displays a hefty error message at the end:
Warning messages: 1: In if (imagej == "ImageJ not found") return("ImageJ not found") else path.imagej <- imagej : the condition has length > 1 and only the first element will be used 2: In if (file.exists(paste(path.imagej, "Contents/Resources/Java/ij.jar", : the condition has length > 1 and only the first element will be used 3: In if (temp.slash2 != "/") { : the condition has length > 1 and only the first element will be used
Thank you for writing and maintaining this code.
Best,
Hilary Rose Dawson
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.