Skip to content

Instantly share code, notes, and snippets.

View RyanZurrin's full-sized avatar
💭
Trying my best , failure is not an option for me.

Ryan Zurrin RyanZurrin

💭
Trying my best , failure is not an option for me.
View GitHub Profile

Feed-Answer Unpacking and Processing Notes

1. Feed-Answer Unpacking

Identify the subjects you wish to unpack from DICOM to nifti format and create a case list text file of the subjects you wish to unpack. The case list text file should be formatted as follows:

sub-<subject_label>
sub-<subject_label>
sub-
@RyanZurrin
RyanZurrin / libstdc_issue_fix.md
Created October 24, 2024 20:00
Fix issue with libstdc++.so.6 which does not provide the required ABI version (CXXABI_1.3.9) as needed by some python packages (matplotlib and pillow).

Solution 1: Install GCC and libstdc++ via Conda

Create or Activate a Conda Environment If you don’t already have a Conda environment, create one:

conda create -n gcc_env python=3.8
conda activate gcc_env

BUILDING TMUX LOCALLY

Set HOME directory: export HOME=/data/pnlx/home/$USER

Install OpenSSL

@RyanZurrin
RyanZurrin / renameToBIDSAnySession.sh
Last active July 11, 2024 17:49
renameToBIDSAnySession is a bash script designed to create symlinks for neuroimaging data files in a BIDS (Brain Imaging Data Structure) format. The script processes structural, diffusion, and rfMRI files, creating the appropriate directory structure and symlinks.
#!/bin/bash
# Initialize variables
input_dir="/path/to/input/directory"
bids_root="/path/to/BIDS/rawdata/"
log_file="logs/$(date +%Y%m%d_%H%M%S)_renameToBIDSAnySession.log"
cases=""
case_list=""
# Function to display help message
@RyanZurrin
RyanZurrin / copy_random_subjects.sh
Created July 8, 2024 17:38
copy random subjects from s3 bucket
#!/bin/bash
# Usage:
# ./copy_random_subjects.sh s3://nda-enclave-c3371/HCP/HCPD/ 10 /local/destination/path
S3_PATH="$1" # S3 bucket and path without trailing slash
NUM_SUBJECTS="$2" # Number of subjects to randomly select
DESTINATION_PATH="$3" # Local destination path
# Ensure awscli is installed
@RyanZurrin
RyanZurrin / consolidate_csv_vtp_measures.py
Last active July 1, 2024 21:57
Condolidates multiple subject csv vtp measure files into a single csv file.
import os
import pandas as pd
import glob
import argparse
from tqdm import tqdm
DEBUG = True
error_log = []
log = []
@RyanZurrin
RyanZurrin / space_usage_report.sh
Created May 13, 2024 11:33
bash script to generate space usage reports
#!/bin/bash
# Directory to scan; you can modify this to be the root '/' or any specific directory
TARGET_DIRECTORY="/"
# Output directory for the reports
REPORT_DIR="/var/log/space_reports"
mkdir -p "${REPORT_DIR}"
# Filename includes date for weekly tracking
@RyanZurrin
RyanZurrin / .vimrc
Last active May 17, 2024 03:54
my favorite .vimrc settings
set number
syntax on
filetype plugin on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set wrap
set showcmd
import nibabel as nib
import numpy as np
import csv
import sys
from tqdm import tqdm
def dice_coefficient(mask1, mask2):
"""
Compute the Dice coefficient, a measure of set similarity.
Parameters
@RyanZurrin
RyanZurrin / symlink_full_directory.sh
Created April 30, 2024 15:46
symlink target directory to source directory