Commit 089d657e authored by Jean-Karim Heriche's avatar Jean-Karim Heriche

Added option to rescale image intensity.

parent ea32e946
...@@ -61,7 +61,7 @@ ui <- function(request) { ...@@ -61,7 +61,7 @@ ui <- function(request) {
## Custom CSS to: ## Custom CSS to:
## - Reduce white space around boxes ## - Reduce white space around boxes
## - Chenge font size ## - Change font size
## - Change postion and size of notification box ## - Change postion and size of notification box
tags$head(tags$style(HTML( tags$head(tags$style(HTML(
'[class*="col-lg-"],[class*="col-md-"], '[class*="col-lg-"],[class*="col-md-"],
...@@ -145,7 +145,9 @@ ui <- function(request) { ...@@ -145,7 +145,9 @@ ui <- function(request) {
), ),
## Select column containing image file names ## Select column containing image file names
uiOutput("fileColumn1"), uiOutput("fileColumn1"),
uiOutput("fileColumn2") checkboxInput("normalize.img1", "Rescale intensity for image 1", TRUE),
uiOutput("fileColumn2"),
checkboxInput("normalize.img2", "Rescale intensity for image 2", TRUE)
), ),
box( width = 3, box( width = 3,
title = "ROIs", solidHeader = TRUE, status = "primary", title = "ROIs", solidHeader = TRUE, status = "primary",
...@@ -416,7 +418,8 @@ server <- function(input, output, session) { ...@@ -416,7 +418,8 @@ server <- function(input, output, session) {
settings <- list("selectedVar" = input$selectedVar, "colsOnHover" = input$colsOnHover, settings <- list("selectedVar" = input$selectedVar, "colsOnHover" = input$colsOnHover,
"colsToHide" = input$colsToHide, "groupLabels" = input$groupLabels, "roiX" = input$roiX, "colsToHide" = input$colsToHide, "groupLabels" = input$groupLabels, "roiX" = input$roiX,
"roiY" = input$roiY, "roiFrame" = input$roiFrame, "imgRoot" = rv$inputChoices[["imgRoot"]], "roiY" = input$roiY, "roiFrame" = input$roiFrame, "imgRoot" = rv$inputChoices[["imgRoot"]],
"fileCol1" = input$fileCol1, "fileCol2" = input$fileCol2) "fileCol1" = input$fileCol1, "fileCol2" = input$fileCol2,
"normalize.img1" = input$normalize.img1, "normalize.img2" = input$normalize.img2)
saveRDS(settings, file) saveRDS(settings, file)
} }
) )
...@@ -440,13 +443,14 @@ server <- function(input, output, session) { ...@@ -440,13 +443,14 @@ server <- function(input, output, session) {
updateSelectizeInput(session = session, inputId = "roiFrame", selected = rv$inputChoices[["roiFrame"]]) updateSelectizeInput(session = session, inputId = "roiFrame", selected = rv$inputChoices[["roiFrame"]])
updateSelectizeInput(session = session, inputId = "fileCol1", selected = rv$inputChoices[["fileCol1"]]) updateSelectizeInput(session = session, inputId = "fileCol1", selected = rv$inputChoices[["fileCol1"]])
updateSelectizeInput(session = session, inputId = "fileCol2", selected = rv$inputChoices[["fileCol2"]]) updateSelectizeInput(session = session, inputId = "fileCol2", selected = rv$inputChoices[["fileCol2"]])
updateCheckboxInput(session = session, inputId = "normalize.img1", value = rv$inputChoices[["normalize.img1"]])
updateCheckboxInput(session = session, inputId = "normalize.img2", value = rv$inputChoices[["normalize.img2"]])
}) })
# Vector of user input names (i.e. inputId) that we may want to restore from file # Vector of user input names (i.e. inputId) that we may want to restore from file
# Values are stored in rv$inputChoices # Values are stored in rv$inputChoices
inputChoices.params <- c("selectedVar", "colsOnHover", "colsToHide", "groupLabels", "roiX", "roiY", inputChoices.params <- c("selectedVar", "colsOnHover", "colsToHide", "groupLabels", "roiX", "roiY",
"roiFrame", "imgRoot", "fileCol1", "fileCol2") "roiFrame", "imgRoot", "fileCol1", "fileCol2", "normalize.img1", "normalize.img2")
rv <- reactiveValues(inputChoices = setNames(vector("list", length(inputChoices.params)),inputChoices.params), rv <- reactiveValues(inputChoices = setNames(vector("list", length(inputChoices.params)),inputChoices.params),
data = NULL, currentRows = NULL, selectedRows = NULL, clusters = NULL, imgRoot = NULL, data = NULL, currentRows = NULL, selectedRows = NULL, clusters = NULL, imgRoot = NULL,
imgPath1 = NULL, imgPath2 = NULL, pixelPosition = NULL, selectedFrame = NULL, imgPath1 = NULL, imgPath2 = NULL, pixelPosition = NULL, selectedFrame = NULL,
...@@ -864,6 +868,7 @@ server <- function(input, output, session) { ...@@ -864,6 +868,7 @@ server <- function(input, output, session) {
colorMode(image1) = Color colorMode(image1) = Color
image1 <- drawCircle(image1, rv$pixelPosition[1], rv$pixelPosition[2], r, "red", fill=TRUE, z=1) image1 <- drawCircle(image1, rv$pixelPosition[1], rv$pixelPosition[2], r, "red", fill=TRUE, z=1)
} }
if(input$normalize.img1) { image1 <- normalize(image1)}
display(image1, method = 'browser') display(image1, method = 'browser')
} }
}) })
...@@ -877,6 +882,7 @@ server <- function(input, output, session) { ...@@ -877,6 +882,7 @@ server <- function(input, output, session) {
colorMode(image2) = Color colorMode(image2) = Color
image2 <- drawCircle(image2, rv$pixelPosition[1], rv$pixelPosition[2], r, "red", fill=TRUE, z=1) image2 <- drawCircle(image2, rv$pixelPosition[1], rv$pixelPosition[2], r, "red", fill=TRUE, z=1)
} }
if(input$normalize.img2) { image2 <- normalize(image2)}
display(image2, method = 'browser') display(image2, method = 'browser')
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment