Tuesday, May 7, 2013

New geomorph function to digitize multiple 2d images

Hi Morphometricians!

We've enhanced geomorph's ability to continuously digitize multiple specimens' images in 2d, if these are within the same directory. This new function allows one to digitize 2d images without interruption. Thanks to Samuel Brown and Karl Fetter for suggesting the improvement.

We will incorporate this function in our next package update. I'm including demonstration code and a link to archaeological lithic specimens below. To replicate the excercise, first download zipped folder containing the images of 3 specimens from this link .

These images are of Middle and Upper Paleolithic tools from excavations at Tor Sadaf, Jordan, conducted by Dr. Nancy Coinman

Cheers,

Erik

DIgitizing instructions can be found in the geomorph package manual (pp. 11-12)


# create a folder named "2d_midpaleolithic_specs" and unzip images there
# dir.create("C:/2d_midpaleolithic_specs/")

# then set the directory to where the images are located
> setwd("C:/2d_midpaleolithic_specs/")

> # create the file name character vector named "specs"
> # ensure that only ".jpg" files are called (for future reference)
> specs<-list.files()[grep(".JPG",list.files())]
> specs
[1] "spec100.JPG" "spec143.JPG" "spec164.JPG"

> # source the function "digitize2d.multi()"
> source(url("http://www.people.fas.harvard.edu/~eotarolacastillo/software/digitze2dmulti.R"))

> # To begin digitizing images call the function with with:
> diged.imgs <- lapply(specs, digitize2d.multi, nlandmarks=3, scale=1)
Loading required package: jpeg
set scale = 1

# to set the scale, use the mouse to digitize the length of the scale in the image


select landmarks 1:3

# to select landmarks, "point-and-click" at the locations of the landmarks of interest. in this case, the ends of a preparation platform and the tip were selected.


set scale = 1
select landmarks 1:3

(figure not shown)
set scale = 1
select landmarks 1:3

# here is another example using an upper-paleolithic blade.


2 comments:

  1. Hi,
    I'm new to geomorph and wonder if it is possible to zoom into the picture you want to digitize? Or will you have to make sure the resolution is good enough when you load the pictures that you don't need to zoom in R?
    Best,
    Maria

    ReplyDelete
  2. Hi Maria, thanks for your question. Zooming isn't possible in the current version I'm afraid. I'd suggest making sure the plot window takes up the whole screen to maximise what you have. Also crop your images to have the specimen as large as possible in them. If you've got further queries on digitizing in geomorph, please email me and we can discuss: sherratt[at]iastate[dot]edu

    ReplyDelete