[Rimagej-commits] r13 - in pkg/RImageJ: . R inst/java man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 9 07:52:54 CEST 2010


Author: phgrosjean
Date: 2010-10-09 07:52:53 +0200 (Sat, 09 Oct 2010)
New Revision: 13

Modified:
   pkg/RImageJ/DESCRIPTION
   pkg/RImageJ/NAMESPACE
   pkg/RImageJ/R/onLoad.R
   pkg/RImageJ/R/raster.R
   pkg/RImageJ/inst/java/ij.jar
   pkg/RImageJ/man/IJ.Rd
   pkg/RImageJ/man/RImageJ-package.Rd
   pkg/RImageJ/man/as.raster.Rd
Log:
Upgrade to ImageJ 1.44i + eliminate headless starting in Mac OS X (must use R under JGR on Mac OS X snow leopard anyway)
Added a notice to RImageJ-package.Rd to use JGR for Mac OS X

Modified: pkg/RImageJ/DESCRIPTION
===================================================================
--- pkg/RImageJ/DESCRIPTION	2010-04-16 15:30:38 UTC (rev 12)
+++ pkg/RImageJ/DESCRIPTION	2010-10-09 05:52:53 UTC (rev 13)
@@ -1,6 +1,6 @@
 Package: RImageJ
-Version: 0.2-143
-Date: 2010-02-18
+Version: 0.2-144
+Date: 2010-10-09
 Title: R bindings for ImageJ
 Author: Romain Francois, Philippe Grosjean with contributions from Paul Murrell
 Maintainer: Romain Francois <romain at r-enthusiasts.com>

Modified: pkg/RImageJ/NAMESPACE
===================================================================
--- pkg/RImageJ/NAMESPACE	2010-04-16 15:30:38 UTC (rev 12)
+++ pkg/RImageJ/NAMESPACE	2010-10-09 05:52:53 UTC (rev 13)
@@ -1,6 +1,6 @@
 import("rJava")
 export(IJ) 
 
-importFrom( "grDevices", "as.raster" )
-S3method( "as.raster", "jobjRef" )
+importFrom("grDevices", "as.raster")
+S3method("as.raster", "jobjRef")
 

Modified: pkg/RImageJ/R/onLoad.R
===================================================================
--- pkg/RImageJ/R/onLoad.R	2010-04-16 15:30:38 UTC (rev 12)
+++ pkg/RImageJ/R/onLoad.R	2010-10-09 05:52:53 UTC (rev 13)
@@ -1,10 +1,13 @@
 .onLoad <- function (libname, pkgname) {
-	if (substring(R.Version()$os, 1, 6) == "darwin") {
-		# There is a problem starting Java with AWT on Mac OS X (Snow) Leopard
-		# This tries to correct it!
-		options(java.parameters = paste(getOption("java.parameters"),
-			"-Djava.awt.headless=true"))
-	}
+	#if (substring(R.Version()$os, 1, 6) == "darwin") {
+	#	# There is a problem starting Java with AWT on Mac OS X (Snow) Leopard
+	#	# This tries to correct it!
+	#	options(java.parameters = paste(getOption("java.parameters"),
+	#		"-Djava.awt.headless=true"))
+	#}
+	# Note: this does not solve *all* the problem because methods in IJ that
+	#       rely on genericDialog still do not work. The only solution I [PhG]
+	#       have found until now is to start RImageJ from within JGR.
 	.jpackage(pkgname)
 	cat("ImageJ version: ", IJ$getVersion(), "\n", sep = "")
 }

Modified: pkg/RImageJ/R/raster.R
===================================================================
--- pkg/RImageJ/R/raster.R	2010-04-16 15:30:38 UTC (rev 12)
+++ pkg/RImageJ/R/raster.R	2010-10-09 05:52:53 UTC (rev 13)
@@ -1,31 +1,30 @@
-# based on a contribution by Paul Murell
+### Based on a contribution by Paul Murell
 
 #setGeneric("as.raster" )
 #
-#setMethod( "as.raster", "jobjRef", function(x){
-as.raster.jobjRef <- function(x, ...){	
-	# first check that this is an instance  of ij.ImagePlus
+#setMethod( "as.raster", "jobjRef", function (x) {
+as.raster.jobjRef <- function (x, ...)
+{	
+	## First check that this is an instance of ij.ImagePlus
     if (!x %instanceof% "ij.ImagePlus")
     	stop("'x' must be a reference to an \"ImagePlus\" object")
     	
-    # Image dimensions
+    ## Image dimensions
     w <- x$getWidth()
     h <- x$getHeight()
-    # Force to RGB image
+    ## Force to RGB image
     ijp <- x$getProcessor()
     ijrgb <- ijp$convertToRGB()
-    # Grab the pixels (which should now be integers)
+    ## Grab the pixels (which should now be integers)
     pixels <- ijrgb$getPixels()
-    # Convert the integers to R colours
+    ## Convert the integers to R colours
     colourChars <- as.character(as.hexmode(pixels))
     red <- substr(colourChars, 3, 4)
     green <- substr(colourChars, 5, 6)
     blue <- substr(colourChars, 7, 8)
-    colours <- paste("#", red, green, blue, sep="")
+    colours <- paste("#", red, green, blue, sep = "")
     r <- colours
     dim(r) <- c(h, w)
     class(r) <- "raster"
-    r 
+    return(r) 
 }
-# )
-

Modified: pkg/RImageJ/inst/java/ij.jar
===================================================================
(Binary files differ)

Modified: pkg/RImageJ/man/IJ.Rd
===================================================================
--- pkg/RImageJ/man/IJ.Rd	2010-04-16 15:30:38 UTC (rev 12)
+++ pkg/RImageJ/man/IJ.Rd	2010-10-09 05:52:53 UTC (rev 13)
@@ -1,35 +1,41 @@
 \name{IJ}
-\Rdversion{1.1}
 \alias{IJ}
 \docType{data}
+
 \title{
 IJ object
 }
+
 \description{
-This represents an object of class \code{ij.IJ} created when the 
-RImageJ package is loaded
+  This represents an object of class \code{ij.IJ} created when the RImageJ
+  package is loaded.
 }
+
 \usage{IJ}
+
 \format{
-This is a java object, instance of the class \code{ij.IJ}, that is created when the 
-package is loaded.
+  This is a java object, instance of the class \code{ij.IJ}, that is created
+  when the package is loaded.
 }
+
 \details{
-The ImageJ macro language is basically made of calls to methods of 
-the IJ class. This object allows to mimic the macro language by using 
-the convenient dollar notation. See examples below.
+ The ImageJ macro language is basically made of calls to methods of the IJ
+ class. This object allows to mimic the macro language by using the convenient
+ dollar notation. See examples below.
 }
+
 \references{
-The java documentation of the class IJ: 
-\url{http://rsbweb.nih.gov/ij/developer/api/ij/IJ.html}
+  The java documentation of the class IJ:
+  \url{http://rsbweb.nih.gov/ij/developer/api/ij/IJ.html}
+  
+  ImageJ macro language:
+  \url{http://rsbweb.nih.gov/ij/developer/macro/macros.html}
+}
 
-ImageJ macro language
-\url{http://rsbweb.nih.gov/ij/developer/macro/macros.html}
-}
 \examples{
 \dontrun{
-logo <- system.file( "images", "R.jpg", package = "RImageJ" )
-image <- IJ$openImage( logo )
+logo <- system.file("images", "R.jpg", package = "RImageJ")
+image <- IJ$openImage(logo)
 image$show()
 IJ$run("8-bit")
 IJ$run("Invert")

Modified: pkg/RImageJ/man/RImageJ-package.Rd
===================================================================
--- pkg/RImageJ/man/RImageJ-package.Rd	2010-04-16 15:30:38 UTC (rev 12)
+++ pkg/RImageJ/man/RImageJ-package.Rd	2010-10-09 05:52:53 UTC (rev 13)
@@ -1,31 +1,41 @@
 \name{RImageJ-package}
-\Rdversion{1.1}
 \alias{RImageJ-package}
 \docType{package}
-\title{
-R bindings for ImageJ
-}
+
+\title{ R bindings for ImageJ }
+
 \description{
-bindings between R and the java based image processing 
-and analysis platform ImageJ
+  Bindings between R and the java based image processing and analysis platform
+  ImageJ.
 }
+
 \details{
-\tabular{ll}{
-Package: \tab RImageJ\cr
-Type: \tab Package\cr
-Version: \tab 0.2-143\cr
-Date: \tab 2010-02-18\cr
-License: \tab GPL-3\cr
-LazyLoad: \tab yes\cr
+  \tabular{ll}{
+    Package: \tab RImageJ\cr
+    Type: \tab Package\cr
+    Version: \tab 0.2-144\cr
+    Date: \tab 2010-10-09\cr
+    License: \tab GPL-3\cr
+    LazyLoad: \tab yes\cr
+  }
 }
+
+\details{
+  On certain Mac OS X systems (like Snow Leopard), it is impossible to start AWT
+  from rJava started from R.app or from the terminal. Since ImageJ depends on
+  AWT, it will not run. The solution is to use R and RImageJ from within JGR
+  \url{http://www.rforge.net/JGR/}.
 }
+
 \author{
-Romain Francois for the R package
-Wayne Rasband for ImageJ
+  Romain Francois & Philippe Grosjean for the R package
+  Wayne Rasband for ImageJ
 
-Maintainer: Romain Francois <romain at r-enthusiasts.com>
+  Maintainer: Romain Francois <romain at r-enthusiasts.com>
 }
+
 \references{
-ImageJ: \url{http://rsbweb.nih.gov/ij/index.html}
+  ImageJ: \url{http://rsbweb.nih.gov/ij/index.html}
 }
+
 \keyword{ package }

Modified: pkg/RImageJ/man/as.raster.Rd
===================================================================
--- pkg/RImageJ/man/as.raster.Rd	2010-04-16 15:30:38 UTC (rev 12)
+++ pkg/RImageJ/man/as.raster.Rd	2010-10-09 05:52:53 UTC (rev 13)
@@ -1,37 +1,42 @@
 \name{as.raster.jobjRef}
 \alias{as.raster.jobjRef}
-\title{
-Support for converting ImageJ images to raster images
-}
+
+\title{ Support for converting ImageJ images to raster images }
+
 \description{
-Support for converting ImageJ images to raster images
+  Support for converting ImageJ images to raster images.
 }
+
 \usage{
-\S3method{as.raster}{jobjRef}(x, ...)
+\S3method{as.raster}{jobjRef}(x, \dots)
 }
 \arguments{
-\item{x}{A java reference of class \samp{ij.ImagePlus} }
-\item{...}{not used}
+  \item{x}{ A java reference of class \samp{ij.ImagePlus}. }
+  \item{\dots}{ Not used. }
 }
+
 \value{
-A raster object. See \link[grDevices]{as.raster}
+  A raster object. See \link[grDevices]{as.raster}.
 }
+
 \author{
-Contributed by Paul Murrell \url{http://www.stat.auckland.ac.nz/~paul/}
+  Contributed by Paul Murrell \url{http://www.stat.auckland.ac.nz/~paul/}
 }
+
 \seealso{
-\link[grDevices]{as.raster}, \link[graphics]{raster}
+  \link[grDevices]{as.raster}, \link[graphics]{raster}
 }
+
 \examples{
 \dontrun{
-logo <- system.file( "images", "R.jpg", package = "RImageJ" )
-image = IJ$openImage( logo )
-plot(c(100, 250), c(300, 450), type = "n", xlab="", ylab="")
-raster(image, 100, 300, 150, 350, interpolate=FALSE)
+logo <- system.file("images", "R.jpg", package = "RImageJ")
+image <- IJ$openImage(logo)
+plot(c(100, 250), c(300, 450), type = "n", xlab = "", ylab = "")
+raster(image, 100, 300, 150, 350, interpolate = FALSE)
 raster(image, 100, 400, 150, 450)
-raster(image, 200, 300, 200 + xinch(.5), 300 + yinch(.3),
-       interpolate=FALSE)
-raster(image, 200, 400, 250, 450, angle=15, interpolate=FALSE)
+raster(image, 200, 300, 200 + xinch(.5), 300 + yinch(.3), interpolate = FALSE)
+raster(image, 200, 400, 250, 450, angle = 15, interpolate = FALSE)
 }
 }
+
 \keyword{ graphics}



More information about the Rimagej-commits mailing list