Skip to content

Commit

Permalink
version 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Kort authored and gaborcsardi committed Jan 30, 2010
1 parent 9c9d60d commit d84c822
Show file tree
Hide file tree
Showing 19 changed files with 323 additions and 1,638 deletions.
37 changes: 25 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
Package: rtiff
Type: Package
Title: A tiff reader for R.
Version: 1.4
Date: 2009-01-21
Depends: pixmap
Author: Eric Kort
Maintainer: Eric Kort <eric.kort@vai.org>
SystemRequirements: libtiff
Description: This package will read (and, as of version 1.1, write) TIFF format images and return them as a pixmap object. Because the resulting object can be very large for even modestly sized TIFF images, images can be reduced as they are read for improved performance. This package is a wrapper around libtiff (www.libtiff.org), on which it depends (i.e. the libtiff shared library must be on your PATH for the binary to work, and tiffio.h must be on your system to build the package from source). By using libtiff's highlevel TIFFReadRGBAImage function, this package inherently support a wide range of image formats and compression schemes. This package also provides an implementation of the Ridler Autothresholding algorithm for easy generation of binary masks.
License: file LICENSE
Packaged: Thu Jan 22 09:17:22 2009; Eric.Kort
Package: rtiff
Type: Package
Title: A tiff reader for R.
Version: 1.4.1
Date: 2010-01-30
Depends: pixmap
Author: Eric Kort
Maintainer: Eric Kort <eric.kort@vai.org>
SystemRequirements: libtiff
Description: This package will read and write TIFF format images and
return them as a pixmap object. Because the resulting object
can be very large for even modestly sized TIFF images, images
can be reduced as they are read for improved performance. This
package is a wrapper around libtiff (www.libtiff.org), on which
it depends (i.e. the libtiff shared library must be on your
PATH for the binary to work, and tiffio.h must be on your
system to build the package from source). By using libtiff's
highlevel TIFFReadRGBAImage function, this package inherently
support a wide range of image formats and compression schemes.
This package also provides an implementation of the Ridler
Autothresholding algorithm for easy generation of binary masks.
License: file LICENSE
Packaged: 2012-01-24 16:34:21 UTC; ripley
Repository: CRAN
Date/Publication: 2012-01-24 16:35:31
52 changes: 26 additions & 26 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
This package depends upon the libtiff package (www.remotesensing.org/libtiff),
which has the following license:
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
Any portions of the package which do not depend upon libtiff are placed
This package depends upon the libtiff package (www.remotesensing.org/libtiff),
which has the following license:

Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.

Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.

THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.

Any portions of the package which do not depend upon libtiff are placed
under the GNU General Public License, version 3.0 or later.
27 changes: 27 additions & 0 deletions MD5
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
e8664ccf53ced5180654fb91e1be7d97 *DESCRIPTION
99cf42fffc53d0dbfefd8bc8f8728ea8 *LICENSE
a2f48e7f2b2bfee57e5d65ace0bf8c32 *NAMESPACE
9f3549f70c8df34ba0ec2893ca1215ca *R/autoThreshold.R
9d8ffcc8cf5bccaf171ae53e732128e1 *R/getDescription.R
fec1793e2150b51c54a6ab8907ef48ef *R/newPixmapRGB.R
a71bae4710db7b0380a0f55522156843 *R/plot.matrix.R
bb135cf6a30baec48f2c1e150631a12d *R/readTiff.R
8eadfda230b2013922cc9abeadd79c8c *R/updateDescription.R
7c4d0d58d0736e2851315b326f0ff8eb *R/writeTiff.R
465d57694acbeee1225885d40049ecc9 *configure
bce1bd359c045e19e938e05c1d17609e *configure.in
8e1eb8f6aa9c72998ff995e860943922 *inst/tiff/jello.tif
f0d7bcb90496c323c880a9773dfe93ff *inst/tiff/quad-jpeg.tif
3fa7bd7cf706309489ab8e0425eb49aa *inst/tiff/t1.tif
b33326eedd1914f2a92bbbc31d954596 *man/autoThreshold.Rd
73a2de8319565a14cbf61959bc32bc9d *man/getDescription.Rd
01e5e8e67f15cbb1f99a4f839e6520f8 *man/newPixmapRGB.Rd
372c5eb3e65a1e2eb9c642d552cb21bc *man/plot.matrix.Rd
6182d360b978af8dc3d4a5573b05d722 *man/readTiff.Rd
a9929e74a735ef0b5e0679e609211383 *man/rtiff.package.Rd
e2a8fbb665253da2e778c7e64cb8d340 *man/updateDescription.Rd
e82e788210b4c0e06e98e83ffd530aae *man/writeTiff.Rd
29bcb3becaa8ef7e9be1743a623b829e *src/Makevars
226cb8d694b6dd8fafeb3d5c3fc616fc *src/Makevars.in
5be412c81811c1db36131b5255f4729e *src/Makevars.win
5aa433b68a6371850b63ea32806b7c0e *src/rtiff.c
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
useDynLib("rtiff")

export(
readTiff,
Expand Down
5 changes: 0 additions & 5 deletions R/zzz.R

This file was deleted.

7 changes: 1 addition & 6 deletions man/autoThreshold.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ autoThreshold(d.m, est = 0.5)
\references{ Ridler T, Calvard S. Picture thresholding using an iterative selection method. IEEE Trans on Systems Man and Cybernetics, SMC 8;630-2. }
\author{ Eric Kort <eric.kort@vai.org> }
\examples{

library(rtiff)
tif <- readTiff(paste(.path.package("rtiff"), "/tiff/jello.tif", sep=""))
tif <- readTiff(system.file("tiff", "jello.tif", package="rtiff"))
threshold <- autoThreshold(tif@red)
plot(tif)

getOption("device")()

plot(tif@red > threshold[3])
}
\keyword{ utilities }
Expand Down
11 changes: 6 additions & 5 deletions man/getDescription.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ getDescription(fn)
\item{fn}{ The name of the tiff file. }
}
\value{
A string with the description field from the TIFF file.
A string with the description field from the TIFF file, or \code{NA}
if there is no such field.
}
\author{ Eric Kort <eric.kort@vai.org> }
\examples{

library(rtiff)
tif <- readTiff(paste(.path.package("rtiff"), "/tiff/jello.tif", sep=""))
getDescription(paste(.path.package("rtiff"), "/tiff/jello.tif", sep=""))
# This has no description
getDescription(system.file("tiff", "jello.tif", package="rtiff"))
# but this has
getDescription(system.file("tiff", "t1.tif", package="rtiff"))
}
\keyword{ utilities }
\keyword{ IO }
Expand Down
3 changes: 1 addition & 2 deletions man/newPixmapRGB.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ newPixmapRGB(red = NULL, green = NULL, blue = NULL)
\examples{

#this is tautological, but demonstrates the syntax...
library(rtiff)
tif <- readTiff(paste(.path.package("rtiff"), "/tiff/jello.tif", sep=""))
tif <- readTiff(system.file("tiff", "jello.tif", package="rtiff"))
myPixmap <- newPixmapRGB(tif@red, tif@green, tif@blue)
plot(myPixmap)

Expand Down
8 changes: 2 additions & 6 deletions man/plot.matrix.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
channel), and then plotting the resulting image.
}
\usage{
plot.matrix(x, ...)
\S3method{plot}{matrix}(x, ...)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
Expand All @@ -19,11 +19,7 @@ plot.matrix(x, ...)
}
\author{ Eric Kort <eric.kort@vai.org> }
\examples{

library(rtiff)
tif <- readTiff(paste(.path.package("rtiff"), "/tiff/jello.tif", sep=""))

tif <- readTiff(system.file("tiff", "jello.tif", package="rtiff"))
plot(tif@red)

}
\keyword{ utilities }
112 changes: 54 additions & 58 deletions man/readTiff.Rd
Original file line number Diff line number Diff line change
@@ -1,58 +1,54 @@
\name{readTiff}
\alias{readTiff}
\title{ A function to load TIFF images into a pixmap. }
\description{
Loads a TIFF image from a file and returns the image as a pixmap object, with optional scaling.
}
\usage{
readTiff(fn, page = 0, reduce = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{fn}{ Filename (the tiff image to load) }
\item{page}{ In the case of multi-page tiffs, which page do you want? }
\item{reduce}{ Optional scaling factor to improve performance with large images,
should be a value between 0 and 1 (i.e. a decimal representation of
a percentage). See details. }
}
\details{


This package is a wrapper around libtiff (www.libtiff.org), on which it depends. By using libtiff's
highlevel TIFFReadRGBAImage function, this package inherently support a wide range of image formats
and compression schemes (interestingly, thanks to libtiff, this package can load a number of TIFF formats
that tools like Window's Paint or the open source Gimp application will not load).

High resolution images (by which I mean images that contain a "large" number of pixels) will occupy
quite a bit of memory and will also plot very slowly. If you do not need all the resolution for your
purposes, you scan specify a scaling factor (reduce=x) to downsample the image. The factor is the
amount you want the image scaled BY, not TO. In otherwords, reduce=.90 will reduce the image by 90%,
yielding an image 10% the size of the orginal. The scaling is not sophisticated...a nearest neighbor
approach is used. Since we are reducing and not enlarging, I hope this will be suitable for your
applications.

For simplicity, an RGB pixmap is generated regardless of the colorspace of the original image (including
grayscale images, in which case the R, G, and B rasters are identical). The pixmap object requires
pixel intensities to be between 0 and 1, so the intensities in the orginal image file are scaled
accordingly.

}
\value{
A pixmap object containing the image rasters.
}

\author{ Eric Kort <eric.kort@vai.org> }


\examples{

library(rtiff)
tif <- readTiff(paste(.path.package("rtiff"), "/tiff/jello.tif", sep=""))
plot(tif)


}

\keyword{ utilities }
\keyword{ IO }
\keyword{ file }
\name{readTiff}
\alias{readTiff}
\title{ A function to load TIFF images into a pixmap. }
\description{
Loads a TIFF image from a file and returns the image as a pixmap object, with optional scaling.
}
\usage{
readTiff(fn, page = 0, reduce = 0)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{fn}{ Filename (the tiff image to load) }
\item{page}{ In the case of multi-page tiffs, which page do you want? }
\item{reduce}{ Optional scaling factor to improve performance with large images,
should be a value between 0 and 1 (i.e. a decimal representation of
a percentage). See details. }
}
\details{


This package is a wrapper around libtiff (www.libtiff.org), on which it depends. By using libtiff's
highlevel TIFFReadRGBAImage function, this package inherently support a wide range of image formats
and compression schemes (interestingly, thanks to libtiff, this package can load a number of TIFF formats
that tools like Window's Paint or the open source Gimp application will not load).

High resolution images (by which I mean images that contain a "large" number of pixels) will occupy
quite a bit of memory and will also plot very slowly. If you do not need all the resolution for your
purposes, you scan specify a scaling factor (reduce=x) to downsample the image. The factor is the
amount you want the image scaled BY, not TO. In otherwords, reduce=.90 will reduce the image by 90%,
yielding an image 10% the size of the orginal. The scaling is not sophisticated...a nearest neighbor
approach is used. Since we are reducing and not enlarging, I hope this will be suitable for your
applications.

For simplicity, an RGB pixmap is generated regardless of the colorspace of the original image (including
grayscale images, in which case the R, G, and B rasters are identical). The pixmap object requires
pixel intensities to be between 0 and 1, so the intensities in the orginal image file are scaled
accordingly.

}
\value{
A pixmap object containing the image rasters.
}

\author{ Eric Kort <eric.kort@vai.org> }


\examples{
tif <- readTiff(system.file("tiff", "jello.tif", package="rtiff"))
plot(tif)
}

\keyword{ utilities }
\keyword{ IO }
\keyword{ file }
2 changes: 1 addition & 1 deletion man/rtiff.package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Maintainer: Eric Kort <eric.kort@vai.org>
\examples{
library(rtiff)
tif <- readTiff(paste(.path.package("rtiff"), "/tiff/jello.tif", sep=""))
tif <- readTiff(system.file("tiff", "jello.tif", package="rtiff"))
plot(tif)
Expand Down
2 changes: 0 additions & 2 deletions man/updateDescription.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ updateDescription(fn, description)
None.
}
\author{ Eric Kort <eric.kort@vai.org> }
\examples{
}
\keyword{ utilities }
\keyword{ IO }
\keyword{ file }

0 comments on commit d84c822

Please sign in to comment.