Guest User

Untitled

a guest
Jan 15th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. ui <- fluidPage(titlePanel("Choose cells"),
  2. fluidRow(style = "margin: 15px;",
  3. column(4,h3("Input data"),div(id = "Available", style = "min-height: 600px;",lapply(1:6, function(i) {plotOutput(paste0('stack_image', i),inline = T)}))),
  4. column(4,h3("Postive class"),div(id = "Postive_class", style = "min-height: 600px;")),
  5. column(4,h3("Negative class"),div(id = "Negative_class", style = "min-height: 600px;"))),
  6. fluidRow(style = "margin: 15px;",
  7. column(12,downloadButton("Postive", label = "Download Potive"),downloadButton("Negative", label = "Download negative"))),
  8. dragulaOutput("dragula"))
  9.  
  10. server <- function(input, output) {
  11.  
  12.  
  13. Image_corrdinate <- reactive({
  14. setwd("~/Desktop/Gil_LabWork/AIMS/Shiny/123118/temp")
  15. Image_corrdinate<-readRDS("xy.rds")
  16. })
  17.  
  18.  
  19. output$dragula <- renderDragula({
  20. dragula(c("Available", "Postive_class","Negative_class"))
  21. })
  22.  
  23. lapply(1:6, function(i) {
  24. output[[paste0('stack_image', i)]] <- renderPlot({
  25. req(Image_corrdinate()[,,,i])
  26. plot(Image_corrdinate()[,,,i]*5,cex=1, cex.lab=1)}, height = 100, width = 100 )
  27. })
  28. output$Postive <- downloadHandler({
  29. state <- dragulaValue(input$dragula)
  30. saveRDS(state$Postive_class,"negative.rds")
  31.  
  32. })
  33.  
  34. output$Negative <- downloadHandler({
  35. state <- dragulaValue(input$dragula)
  36. saveRDS(state$Negative_class,"potive.rds")
  37.  
  38. })
  39.  
  40. }
  41.  
  42. shinyApp(ui = ui, server = server)
Add Comment
Please, Sign In to add comment