Viewer

Column {.sidebar data-width=250}

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])

Help

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

Big thanks on the contributors of the following packages:

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)
                                  )
                 )
})

Column

Table

# dataTableOutput("df_table")

dataTableOutput("df_table2")

Column

Test

papayaOutput("papayaViewer",  
             height = "1000px", 
             width = "1200px"
             )

# textOutput("")#,

Data Overview

Test 2

Overview

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)


wulms/bidsconvertr documentation built on Sept. 17, 2023, 11:22 p.m.