selectInput("subject", "Subject:", unique(image_df$subject) %>% sort(), multiple = FALSE, selected = image_df$subject[1]) selectInput("session", "Session:", unique(image_df$session) %>% sort(), multiple = FALSE, selected = image_df$session[1]) selectInput("sequence", "Sequence:", unique(image_df$sequence) %>% sort(), multiple = FALSE, selected = image_df$sequence[1])
Please click the globe button in the right top corner of the viewer to view image in original space alignment!
Debug: Cannot open the connection - This means, that a file is missing! Check in the data overview your selection of parameters
The viewer is the papaya viewer
Brought to R by John Muschelli
Brought to Shiny by John Muschelli
filtered_df <- reactive({ df <- image_df %>% filter(subject %in% input$subject) %>% filter(session %in% input$session) %>% filter(sequence %in% input$sequence) }) filtered_subject <- reactive({ df <- image_df %>% filter(subject %in% input$subject) %>% select(-subject, -nii_files) %>% mutate(existing = 1) %>% pivot_wider(names_from = session, values_from = existing, names_sep = ", ") %>% arrange(type, sequence) })
output$text <- renderText({ img1 <- filtered_df()$BIDS_nii[1] }) # output$df_table <- renderDataTable({ # filtered_subject() # }) output$df_table2 <- renderDataTable(filtered_subject(), #filter = 'none', #rownames = FALSE, options = list(dom = 't'), #ordering = F ) output$papayaViewer <- renderPapaya({ img1 <- filtered_df()$nii_files[1] papayaWidget::papaya(img = c(img1), orthogonal = TRUE, # width = 500, # height = 1000, hide_controls = FALSE, hide_toolbar = FALSE, options = list(papayaOptions(alpha = 1) ) ) })
# dataTableOutput("df_table") dataTableOutput("df_table2")
papayaOutput("papayaViewer", height = "1000px", width = "1200px" ) # textOutput("")#,
image_df <- params$df DT::datatable( image_df, extensions = c('Scroller'), options = list( search = list(regex = TRUE), searchHighlight = TRUE, pageLength = 25, dom = 'Bfrtip', deferRender = TRUE, scrollY = 800, scroller = TRUE ), filter = 'top' )
session$onSessionEnded(stopApp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.