R/editExposure.R

Defines functions editExposure

Documented in editExposure

editExposure <- function(exposures, image.path, which) {
  for (j in which) {
    name <- exposures[j,'image']
      to.load <- paste0(image.path,name, '.jpg')
        image.target <- brick(to.load)
        # image.target <- .binaryConvert(image.target)
        # cut.image <- image.target[coords['y1']:coords['y2'],
        # coords['x1']:coords['x2']]
        # cut.image.binary <- round(cut.image)
        par(mfrow=c(2,1))
        plotRGB(image.target)
        plot(0, type='n')
        act.value <- exposures[j,'numerics']
        text(1,0, act.value, cex=5)
        correct.value <- ask('type in the correct exposure value or press enter to keep it as it is: ')
        if(nchar(correct.value)==0) {
                  exposures$exposure[j] <- exposures$numerics[j]
        } else {
        exposures$exposure[j] <- as.numeric(correct.value)
    }
  }
  return(exposures)
}

Try the phenopix package in your browser

Any scripts or data that you put into this service are public.

phenopix documentation built on Aug. 9, 2023, 5:10 p.m.