This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
im = Image.open('Foto.jpg') | |
im.save('Foto.png') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''make square matrix from vector''' | |
import numpy as np | |
nr_elems = 253 | |
vals = np.random.rand(nr_elems) | |
# first method using scipy distance: | |
from scipy.spatial import distance | |
vals_square_1 = distance.squareform(vals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# local to external hd | |
rsync -azP --delete /Users/ilkay.isik/project_folder_temp/fc_content/MRI_data/lscp_data /Volumes/ilkay_iMAC | |
# external hd to local | |
rsync -azP --delete /Volumes/ilkay_iMAC /Users/ilkay.isik/project_folder_temp/fc_content/MRI_data/lscp_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /path | |
convert -delay 50 -loop 0 cope6*.png cope6_gif.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# favorite jupyter notebook themes | |
#https://github.com/dunovank/jupyter-themes | |
# light | |
jt -r # restore default theme | |
jt -t grade3 -f roboto -fs 12 -ofs 11 -cellw 90% -lineh 130 -T -N | |
jupyter notebook | |
# dark can also be onedork |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 - cdf('t', tval, df) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
labels = ['pericalc','FFA','MT','comb_a','comb_b'] | |
comb_ind = [labels.index(l) for l in labels if l.startswith('comb')] | |
len_comb = len(comb_ind) | |
arr = np.arange(len(labels)) | |
arr = list(arr[~np.isin(arr, comb_ind)]) | |
labels = [i for j, i in enumerate(labels) if j in arr] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mask = np.zeros([18, 18, 1, 4]) | |
for i in range(mask.shape[3]): | |
mask[:, :, 0, :] = ipl_mask | |
no_mask = np.zeros_like(mask) | |
k = 0 | |
mask_all_sub = np.zeros_like(four_dim_array) | |
for s, sub in enumerate(sub_list): | |
if sub in missing_roi_sub: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# How to skip the first line while using read, | |
# how to check a value and increment based on the value of another variable, | |
# pipe a value from bash to awk to parse the line and get the value as a variable to use in another bash command | |
PREVCINDEX=99999 | |
i=1 # skip the first line (part 1) | |
while read LINE | |
do | |
test $i -eq 1 && ((i=i+1)) && continue # skip the first line (part 2) |
NewerOlder