## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup, include=FALSE-----------------------------------------------------
library(MRIreduce)
library(DT)

## ----echo=FALSE, results='asis'-----------------------------------------------
# Set the correct path to the RData file within the package
data_path <- system.file("extdata", "eve_label_info_dataframe.RData", package = "MRIreduce")
# Load the data
load(data_path)

# Enhanced table format using kableExtra
datatable(lab_df[c("integer_label", "text_label", "structure")], 
             options = list(pageLength = 20),  # Set number of rows per page
             caption = 'Interactive table of complete data from the brain regions dataset.')

## ----eval = FALSE-------------------------------------------------------------
# eve_T1(fpath, outpath, fsl_path , fsl_outputtype = "NIFTI_GZ")

## ----echo=FALSE---------------------------------------------------------------
# Example output dimensions from a processed image
example_dims <- c(181, 217, 181)
print(example_dims)

## ----eval=FALSE---------------------------------------------------------------
# # Run the partition pipeline with specified parameters
# run_partition_pipeline(
#   tind = 5,
#   nfl = list.files(
#     '/Users/jinyaotian/Downloads/pipeline_test/eve_t1',
#     full.names = TRUE
#   ),
#   main_dir = "/Users/jinyaotian/Downloads/pipeline_test",
#   tissue_type = 2,
#   ICC_thresh_vec = c(0.8, 0.9),
#   num_cores = 4,
#   suppar_thresh_vec = seq(0.7, 1, 0.01),
#   B = 2000,
#   outp_volume = TRUE
# )

## ----echo=FALSE, results='asis'-----------------------------------------------
data_path <- system.file("extdata", "intensities_whole.rds", package = "MRIreduce")

# Load the data
df = readRDS(data_path)

datatable(df, 
          options = list(
          pageLength = 4,        # Set number of rows per page
          scrollX = TRUE,        # Enable horizontal scrolling for columns
          autoWidth = TRUE       # Automatically adjust column widths
          ), 
         caption = 'Interactive table displaying intensity data after the data pipeline for the inferior frontal gyrus (left) region, using a 0.8 partition threshold')

## ----eval=FALSE---------------------------------------------------------------
# loc_df <- map_feature2_loc(feature_name = "inferior_frontal_gyrus_left_module4_reduced_var_13",
#                            threshold = 0.8,
#                            main_dir = "/path/to/data")

## ----echo=FALSE, results='asis'-----------------------------------------------
library(DT)

# Set the correct path to the RDS file within the package
data_path <- system.file("extdata", "loc_df.rds", package = "MRIreduce")

# Load the data
df <- readRDS(data_path)

# Enhanced table format using datatable
datatable(df, 
          options = list(
            pageLength = 4,        # Set number of rows per page
            scrollX = TRUE,        # Enable horizontal scrolling for columns
            autoWidth = TRUE       # Automatically adjust column widths
          ), 
          caption = 'Mapping "inferior_frontal_gyrus_left_module4_reduced_var_13" back to Brain Image Voxel Locations')

## ----eval=FALSE---------------------------------------------------------------
# map2_eve(mask_img_path = "~/mask_nifti_GM_Volume_pm25_test1_avg_red.nii.gz",
#          save_path = '~/test.png',
#          title = "Mask on EVE Template" )

