Skip to content

Instantly share code, notes, and snippets.

View muschellij2's full-sized avatar

John Muschelli muschellij2

View GitHub Profile
@muschellij2
muschellij2 / travis_helpers.sh
Last active May 28, 2025 21:35
Travis Helpers
#!/bin/bash
# https://gist.github.com/muschellij2/64f9104ccec09deb85d4928071b3c9e8
# set -e
# Comment out this line for quieter output:
# set -x
export cran_set='options(repos = "http://cran.rstudio.com"); '
# we may be able to change to remotes
export ig_package=devtools
@muschellij2
muschellij2 / antsr_travis.sh
Last active July 8, 2019 18:00
ANTsR Travis Before_install script
export LD_LIBRARY_PATH=/usr/local/clang/lib:${LD_LIBRARY_PATH}
wget -O travis_helpers.sh http://bit.ly/travis_helpers
source travis_helpers.sh
cat travis_helpers.sh
rm travis_helpers.sh
echo "ANTSR_TRAVIS VERSION 0.6"
# getting original path
export ORIG_PATH=${PATH}
# cmake may not be needed
library(neurobase)
library(papayar)
library(papayaWidget) # from muschellij2/papayaWidget
fname = "training01_01_mprage.nii.gz"
img = readnii(fname)
ortho2(img)
papaya(img)
papayaWidget(img)
@muschellij2
muschellij2 / ggbrain.R
Created May 31, 2017 16:38
Quick Shiny app of the brain
rm(list=ls())
library(ggplot2)
library(ggneuro)
library(RNifti)
library(kirby21.t1)
library(kirby21.fmri)
library(matrixStats)
library(shiny)
library(neurobase)
@muschellij2
muschellij2 / pitt_script.R
Created May 31, 2017 14:32
Quick reading in of an Image
have_package = function(x) {
x %in% installed.packages()
}
if (!have_package("neurobase")) {
install.packages("neurobase")
}
library(neurobase)
fname = "training01_01_mprage.nii.gz"
library(data.table)
n = 2 * 10^9
p = runif(n)
big_bh_adjust = function(p) {
n_over_k = NULL
if (any(is.na(p))) {
stop("p-values can't have NA in them for this function")
}
# Get the number of p-values (m)
m = length(p)
library(extrantsr)
library(neurobase)
library(drammsr)
library(lungct)
base = "19786L_phase1/insp_CT.nii.gz"
base_mask="19786L_phase1/insp_lung_mask.nii.gz"
follow = '19786L_phase2/insp_CT.nii.gz'
follow_mask="19786L_phase2/insp_lung_mask.nii.gz"
@muschellij2
muschellij2 / .gitignore
Last active June 15, 2017 18:37
Rewriting a DCF with removing remotes.
^\..*
@muschellij2
muschellij2 / Bug_in_read_dcf.R
Last active November 2, 2016 17:24
Bug for read.dcf - which is a problem with readLines(con = gzfile()) with no newline
x = "Package: test
Type: Package
Title: What the Package Does (Title Case)"
######################################
# No Newline
######################################
file = tempfile()
writeLines(x, file, sep = "")
readLines(file)
library(cluster)
m <- 4 #total number of outcomes
n <- 100 #total number of subjects
p <- 10 #total number of covariates
groups.m <- 2 ##number of groups for the columns of B
m.ind <- rep(1:groups.m, each = m/groups.m)
B <- matrix(0, p, m)